geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dblev...@apache.org
Subject svn commit: r1148151 - /geronimo/server/trunk/plugins/openwebbeans/geronimo-openwebbeans-builder/src/main/java/org/apache/geronimo/openwebbeans/deployment/OpenWebBeansModuleBuilderExtension.java
Date Tue, 19 Jul 2011 04:26:07 GMT
Author: dblevins
Date: Tue Jul 19 04:26:07 2011
New Revision: 1148151

URL: http://svn.apache.org/viewvc?rev=1148151&view=rev
Log:
GERONIMO-6038: testNonContextualSessionBeanReferenceIsIntercepted(org.jboss.jsr299.tck.tests.interceptors.definition.enterprise.nonContextualReference.SessionBeanInterceptorOnNonContextualEjbReferenceTest)

Ensure CDI beans are scanned for @EJB references

Modified:
    geronimo/server/trunk/plugins/openwebbeans/geronimo-openwebbeans-builder/src/main/java/org/apache/geronimo/openwebbeans/deployment/OpenWebBeansModuleBuilderExtension.java

Modified: geronimo/server/trunk/plugins/openwebbeans/geronimo-openwebbeans-builder/src/main/java/org/apache/geronimo/openwebbeans/deployment/OpenWebBeansModuleBuilderExtension.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/openwebbeans/geronimo-openwebbeans-builder/src/main/java/org/apache/geronimo/openwebbeans/deployment/OpenWebBeansModuleBuilderExtension.java?rev=1148151&r1=1148150&r2=1148151&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/openwebbeans/geronimo-openwebbeans-builder/src/main/java/org/apache/geronimo/openwebbeans/deployment/OpenWebBeansModuleBuilderExtension.java
(original)
+++ geronimo/server/trunk/plugins/openwebbeans/geronimo-openwebbeans-builder/src/main/java/org/apache/geronimo/openwebbeans/deployment/OpenWebBeansModuleBuilderExtension.java
Tue Jul 19 04:26:07 2011
@@ -19,6 +19,7 @@ package org.apache.geronimo.openwebbeans
 
 import java.lang.annotation.Annotation;
 import java.lang.reflect.Field;
+import java.lang.reflect.Member;
 import java.lang.reflect.Method;
 import java.net.URL;
 import java.util.ArrayList;
@@ -30,6 +31,7 @@ import java.util.Map;
 import java.util.Set;
 import java.util.jar.JarFile;
 
+import javax.ejb.EJB;
 import javax.enterprise.inject.Produces;
 
 import org.apache.geronimo.common.DeploymentException;
@@ -213,15 +215,19 @@ public class OpenWebBeansModuleBuilderEx
                 }
 
             });
-            Set<Class<?>> classes = new HashSet<Class<?>>();
-            List<Method> methods = bundleAnnotationFinder.findAnnotatedMethods(Produces.class);
-            for (Method method: methods) {
-                classes.add(method.getDeclaringClass());
-            }
-            List<Field> fields = bundleAnnotationFinder.findAnnotatedFields(Produces.class);
-            for (Field field: fields) {
-                classes.add(field.getDeclaringClass());
+
+            final List<Member> members = new ArrayList<Member>();
+
+            members.addAll(bundleAnnotationFinder.findAnnotatedMethods(Produces.class));
+            members.addAll(bundleAnnotationFinder.findAnnotatedFields(Produces.class));
+            members.addAll(bundleAnnotationFinder.findAnnotatedFields(EJB.class));
+            members.addAll(bundleAnnotationFinder.findAnnotatedMethods(EJB.class));
+
+            final Set<Class<?>> classes = new HashSet<Class<?>>();
+            for (Member member : members) {
+                classes.add(member.getDeclaringClass());
             }
+
             return new ArrayList<Class<?>>(classes);
         } catch (Exception e) {
             throw new DeploymentException("Fail to scan jsr299 annotations", e);



Mime
View raw message