[jboss-cvs] JBossAS SVN: r63097 - in trunk/ejb3/src/main/org/jboss: injection and 1 other directory.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Wed May 16 10:35:53 EDT 2007


Author: wolfc
Date: 2007-05-16 10:35:53 -0400 (Wed, 16 May 2007)
New Revision: 63097

Modified:
   trunk/ejb3/src/main/org/jboss/ejb3/Ejb3DescriptorHandler.java
   trunk/ejb3/src/main/org/jboss/injection/ResourceHandler.java
Log:
EJBTHREE-966: handle setSessionContext as a method with @Resource

Modified: trunk/ejb3/src/main/org/jboss/ejb3/Ejb3DescriptorHandler.java
===================================================================
--- trunk/ejb3/src/main/org/jboss/ejb3/Ejb3DescriptorHandler.java	2007-05-16 14:29:44 UTC (rev 63096)
+++ trunk/ejb3/src/main/org/jboss/ejb3/Ejb3DescriptorHandler.java	2007-05-16 14:35:53 UTC (rev 63097)
@@ -784,6 +784,12 @@
             annotationClass = javax.annotation.PreDestroy.class;
             method.setMethodName("ejbRemove");
             addAnnotations(annotationClass, annotation, container, method);
+            
+            annotation = new ResourceImpl();
+            annotationClass = Resource.class;
+            method.setMethodName("setSessionContext");
+            // TODO: set param?
+            addAnnotations(annotationClass, annotation, container, method);
          }
       }
    }

Modified: trunk/ejb3/src/main/org/jboss/injection/ResourceHandler.java
===================================================================
--- trunk/ejb3/src/main/org/jboss/injection/ResourceHandler.java	2007-05-16 14:29:44 UTC (rev 63096)
+++ trunk/ejb3/src/main/org/jboss/injection/ResourceHandler.java	2007-05-16 14:35:53 UTC (rev 63097)
@@ -235,7 +235,7 @@
 
    public void handleMethodAnnotations(Method method, InjectionContainer container, Map<AccessibleObject, Injector> injectors)
    {
-      Resource ref = method.getAnnotation(Resource.class);
+      Resource ref = container.getAnnotation(Resource.class, method);
       if (ref == null) return;
 
       log.trace("method " + method + " has @Resource");
@@ -332,7 +332,7 @@
    
    public void handleFieldAnnotations(Field field, InjectionContainer container, Map<AccessibleObject, Injector> injectors)
    {
-      Resource ref = field.getAnnotation(Resource.class);
+      Resource ref = container.getAnnotation(Resource.class, field);
       if (ref == null) return;
 
       log.trace("field " + field + " has @Resource");




More information about the jboss-cvs-commits mailing list