Author: pete.muir(a)jboss.org
Date: 2009-01-07 13:06:14 -0500 (Wed, 07 Jan 2009)
New Revision: 811
Modified:
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/SimpleBean.java
Log:
Support methods annotated with @EJB
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/SimpleBean.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/SimpleBean.java 2009-01-07
17:10:28 UTC (rev 810)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/SimpleBean.java 2009-01-07
18:06:14 UTC (rev 811)
@@ -223,6 +223,14 @@
field.inject(beanInstance, ejbInstance);
}
+ for (AnnotatedMethod<?> method :
annotatedItem.getAnnotatedMethods(manager.getEjbResolver().getEJBAnnotation()))
+ {
+ InjectionPoint injectionPoint = new InjectionPointImpl(method, this,
beanInstance);
+ String name = manager.getEjbResolver().resolveEjb(injectionPoint);
+ Object ejbInstance = manager.getNaming().lookup(name, Object.class);
+ method.invoke(beanInstance, ejbInstance);
+ }
+
for (AnnotatedField<?> field :
annotatedItem.getAnnotatedFields(manager.getEjbResolver().getPersistenceContextAnnotation()))
{
InjectionPoint injectionPoint = new InjectionPointImpl(field, this,
beanInstance);
Show replies by date