Author: rmannibucau
Date: Tue Jun  5 00:17:14 2012
New Revision: 1346196

URL: http://svn.apache.org/viewvc?rev=1346196&view=rev
Log:
we were firing too early the process injection target event

Modified:
    
openejb/trunk/openejb/container/openejb-core/src/main/java/org/apache/openejb/cdi/BeansDeployer.java

Modified: 
openejb/trunk/openejb/container/openejb-core/src/main/java/org/apache/openejb/cdi/BeansDeployer.java
URL: 
http://svn.apache.org/viewvc/openejb/trunk/openejb/container/openejb-core/src/main/java/org/apache/openejb/cdi/BeansDeployer.java?rev=1346196&r1=1346195&r2=1346196&view=diff
==============================================================================
--- 
openejb/trunk/openejb/container/openejb-core/src/main/java/org/apache/openejb/cdi/BeansDeployer.java
 (original)
+++ 
openejb/trunk/openejb/container/openejb-core/src/main/java/org/apache/openejb/cdi/BeansDeployer.java
 Tue Jun  5 00:17:14 2012
@@ -21,7 +21,6 @@ import java.util.ArrayList;
 import java.util.HashSet;
 import java.util.Set;
 import java.util.Stack;
-
 import javax.enterprise.inject.Model;
 import javax.enterprise.inject.Specializes;
 import javax.enterprise.inject.spi.AnnotatedType;
@@ -30,7 +29,6 @@ import javax.enterprise.inject.spi.BeanM
 import javax.enterprise.inject.spi.Decorator;
 import javax.enterprise.inject.spi.InjectionPoint;
 import javax.interceptor.Interceptor;
-
 import org.apache.webbeans.annotation.AnnotationManager;
 import org.apache.webbeans.component.AbstractInjectionTargetBean;
 import org.apache.webbeans.component.AbstractProducerBean;
@@ -57,13 +55,11 @@ import org.apache.webbeans.exception.inj
 import org.apache.webbeans.intercept.webbeans.WebBeansInterceptor;
 import org.apache.webbeans.logger.WebBeansLogger;
 import org.apache.webbeans.portable.events.ProcessAnnotatedTypeImpl;
-import org.apache.webbeans.portable.events.ProcessInjectionTargetImpl;
 import org.apache.webbeans.portable.events.discovery.AfterBeanDiscoveryImpl;
 import 
org.apache.webbeans.portable.events.discovery.AfterDeploymentValidationImpl;
 import org.apache.webbeans.portable.events.discovery.BeforeBeanDiscoveryImpl;
+import org.apache.webbeans.portable.events.generics.GProcessInjectionTarget;
 import org.apache.webbeans.spi.ScannerService;
-import org.apache.webbeans.spi.plugins.OpenWebBeansJavaEEPlugin;
-import org.apache.webbeans.spi.plugins.OpenWebBeansWebPlugin;
 import org.apache.webbeans.util.AnnotationUtil;
 import org.apache.webbeans.util.ClassUtil;
 import org.apache.webbeans.util.WebBeansUtil;
@@ -480,7 +476,7 @@ public class BeansDeployer {
 
         //Fires ProcessInjectionTarget event for Java EE components instances
         //That supports injections but not managed beans
-        ProcessInjectionTargetImpl<T> processInjectionTargetEvent = null;
+        GProcessInjectionTarget processInjectionTargetEvent = null;
         if 
(webBeansContext.getWebBeansUtil().supportsJavaEeComponentInjections(clazz)) {
             //Fires ProcessInjectionTarget
             processInjectionTargetEvent = 
webBeansContext.getWebBeansUtil().fireProcessInjectionTargetEventForJavaEeComponents(clazz);
@@ -516,7 +512,8 @@ public class BeansDeployer {
 
             //If ProcessInjectionTargetEvent is not set, set it
             if (processInjectionTargetEvent == null) {
-                processInjectionTargetEvent = 
webBeansContext.getWebBeansUtil().fireProcessInjectionTargetEvent(managedBean);
+                // processInjectionTargetEvent = 
webBeansContext.getWebBeansUtil().fireProcessInjectionTargetEvent(managedBean);
+                processInjectionTargetEvent = 
webBeansContext.getWebBeansUtil().createProcessInjectionTargetEvent(managedBean);
             }
 
             //Decorator
@@ -552,6 +549,10 @@ public class BeansDeployer {
                 
webBeansContext.getWebBeansUtil().defineManagedBean(managedBeanCreator, 
processInjectionTargetEvent, false);
             }
 
+            if(processInjectionTargetEvent != null) {
+                
webBeansContext.getWebBeansUtil().fireProcessInjectionTargetEvent(processInjectionTargetEvent);
+            }
+
             return true;
         }
         //Not a managed bean


Reply via email to