openwebbeans-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From strub...@apache.org
Subject svn commit: r1413573 - in /openwebbeans/trunk: webbeans-ejb/src/main/java/org/apache/webbeans/ejb/common/util/ webbeans-impl/src/main/java/org/apache/webbeans/component/ webbeans-impl/src/main/java/org/apache/webbeans/config/ webbeans-impl/src/main/jav...
Date Mon, 26 Nov 2012 12:25:47 GMT
Author: struberg
Date: Mon Nov 26 12:25:46 2012
New Revision: 1413573

URL: http://svn.apache.org/viewvc?rev=1413573&view=rev
Log:
OWB-730 remove InjectionTargetWrapper

part 2 EJB and EE stuff

Removed:
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/InjectionTargetWrapper.java
Modified:
    openwebbeans/trunk/webbeans-ejb/src/main/java/org/apache/webbeans/ejb/common/util/EjbUtility.java
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/AbstractOwbBean.java
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/config/BeansDeployer.java
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/config/ManagedBeanConfigurator.java
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/container/BeanManagerImpl.java
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/util/WebBeansUtil.java
    openwebbeans/trunk/webbeans-tomcat6/src/main/java/org/apache/webbeans/web/tomcat/TomcatUtil.java
    openwebbeans/trunk/webbeans-tomcat7/src/main/java/org/apache/webbeans/web/tomcat/TomcatUtil.java

Modified: openwebbeans/trunk/webbeans-ejb/src/main/java/org/apache/webbeans/ejb/common/util/EjbUtility.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-ejb/src/main/java/org/apache/webbeans/ejb/common/util/EjbUtility.java?rev=1413573&r1=1413572&r2=1413573&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-ejb/src/main/java/org/apache/webbeans/ejb/common/util/EjbUtility.java
(original)
+++ openwebbeans/trunk/webbeans-ejb/src/main/java/org/apache/webbeans/ejb/common/util/EjbUtility.java
Mon Nov 26 12:25:46 2012
@@ -32,8 +32,8 @@ import javax.enterprise.inject.spi.Annot
 import javax.enterprise.inject.spi.Bean;
 import javax.enterprise.inject.spi.ObserverMethod;
 import javax.enterprise.inject.spi.ProcessAnnotatedType;
+import javax.enterprise.inject.spi.Producer;
 
-import org.apache.webbeans.component.InjectionTargetWrapper;
 import org.apache.webbeans.component.ProducerFieldBean;
 import org.apache.webbeans.component.ProducerMethodBean;
 import org.apache.webbeans.component.creation.BeanCreator.MetaDataProvider;
@@ -105,7 +105,7 @@ public final class EjbUtility
         webBeansContext.getWebBeansUtil().inspectErrorStack(
             "There are errors that are added by ProcessInjectionTarget event observers. Look
at logs for further details");
         //Put final InjectionTarget instance
-        manager.putInjectionTargetWrapper(ejbBean, processInjectionTargetEvent.getInjectionTarget());
+        manager.putProducer(ejbBean, processInjectionTargetEvent.getInjectionTarget());
         
         Map<ProducerMethodBean<?>,AnnotatedMethod<?>> annotatedMethods
= new HashMap<ProducerMethodBean<?>, AnnotatedMethod<?>>(); 
         for(ProducerMethodBean<?> producerMethod : producerMethodBeans)
@@ -118,7 +118,7 @@ public final class EjbUtility
                 "There are errors that are added by ProcessProducer event observers for ProducerMethods.
Look at logs for further details");
 
             annotatedMethods.put(producerMethod, method);
-            manager.putInjectionTargetWrapper(producerMethod, new InjectionTargetWrapper(producerEvent.getProducer()));
+            manager.putProducer(producerMethod, (Producer) producerEvent.getProducer());
         }
         
         Map<ProducerFieldBean<?>,AnnotatedField<?>> annotatedFields = new
HashMap<ProducerFieldBean<?>, AnnotatedField<?>>();
@@ -131,7 +131,7 @@ public final class EjbUtility
                 "There are errors that are added by ProcessProducer event observers for ProducerFields.
Look at logs for further details");
 
             annotatedFields.put(producerField, field);
-            manager.putInjectionTargetWrapper(producerField, new InjectionTargetWrapper(producerEvent.getProducer()));
+            manager.putProducer(producerField, (Producer) producerEvent.getProducer());
         }
         
         Map<ObserverMethod<?>,AnnotatedMethod<?>> observerMethodsMap =
new HashMap<ObserverMethod<?>, AnnotatedMethod<?>>(); 
@@ -204,7 +204,7 @@ public final class EjbUtility
             webBeansContext.getWebBeansUtil().inspectErrorStack(String.format(message, "ProcessProducer",
"ProducerMethods"));
 
             annotatedMethods.put(producerMethod, method);
-            manager.putInjectionTargetWrapper(producerMethod, new InjectionTargetWrapper(producerEvent.getProducer()));
+            manager.putProducer(producerMethod, (Producer)producerEvent.getProducer());
         }
 
         // PRODUCER FIELDS
@@ -218,7 +218,7 @@ public final class EjbUtility
             webBeansContext.getWebBeansUtil().inspectErrorStack(String.format(message, "ProcessProducer",
"ProducerFields"));
 
             annotatedFields.put(producerField, field);
-            manager.putInjectionTargetWrapper(producerField, new InjectionTargetWrapper(producerEvent.getProducer()));
+            manager.putProducer(producerField, (Producer) producerEvent.getProducer());
         }
 
         //Fires ProcessProducerMethod

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/AbstractOwbBean.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/AbstractOwbBean.java?rev=1413573&r1=1413572&r2=1413573&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/AbstractOwbBean.java
(original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/AbstractOwbBean.java
Mon Nov 26 12:25:46 2012
@@ -176,7 +176,7 @@ public abstract class AbstractOwbBean<T>
                         creationalContext, this); 
             }
            
-            Producer<T> wrapper = getManager().getInjectionTargetWrapper(this);
+            Producer<T> wrapper = getManager().getProducer(this);
             //If wrapper not null
             if(wrapper != null)
             {
@@ -247,7 +247,7 @@ public abstract class AbstractOwbBean<T>
     {
         try
         {
-            Producer<T> wrapper = getManager().getInjectionTargetWrapper(this);
+            Producer<T> wrapper = getManager().getProducer(this);
             if(wrapper != null)
             {
                 // instance might be null if we only created a proxy

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/config/BeansDeployer.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/config/BeansDeployer.java?rev=1413573&r1=1413572&r2=1413573&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/config/BeansDeployer.java
(original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/config/BeansDeployer.java
Mon Nov 26 12:25:46 2012
@@ -40,13 +40,12 @@ import javax.enterprise.inject.spi.Decor
 import javax.enterprise.inject.spi.InjectionPoint;
 import javax.enterprise.inject.spi.InjectionTarget;
 import javax.enterprise.inject.spi.ProcessAnnotatedType;
-import javax.interceptor.Interceptor;
+
 import org.apache.webbeans.annotation.AnnotationManager;
 import org.apache.webbeans.component.AbstractInjectionTargetBean;
 import org.apache.webbeans.component.AbstractProducerBean;
 import org.apache.webbeans.component.EnterpriseBeanMarker;
 import org.apache.webbeans.component.InjectionTargetBean;
-import org.apache.webbeans.component.InjectionTargetWrapper;
 import org.apache.webbeans.component.InterceptedMarker;
 import org.apache.webbeans.component.ManagedBean;
 import org.apache.webbeans.component.NewBean;
@@ -790,8 +789,7 @@ public class BeansDeployer
             if(processInjectionTargetEvent.isSet())
             {
                 //Adding injection target
-                manager.putInjectionTargetWrapperForJavaEeComponents(clazz,
-                        new InjectionTargetWrapper<T>(processInjectionTargetEvent.getInjectionTarget()));
+                manager.putInjectionTargetWrapperForJavaEeComponents(clazz, processInjectionTargetEvent.getInjectionTarget());
             }
             
             //Checks that not contains @Inject InjectionPoint
@@ -884,7 +882,7 @@ public class BeansDeployer
                             .fireProcessInjectionTargetEvent(processInjectionTarget).getInjectionTarget();
                     if (updatedInjectionTarget != originalInjectionTarget)
                     {
-                        webBeansContext.getBeanManagerImpl().putInjectionTargetWrapper(managedBean,
updatedInjectionTarget);
+                        webBeansContext.getBeanManagerImpl().putProducer(managedBean, updatedInjectionTarget);
                     }
                 }
             }

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/config/ManagedBeanConfigurator.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/config/ManagedBeanConfigurator.java?rev=1413573&r1=1413572&r2=1413573&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/config/ManagedBeanConfigurator.java
(original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/config/ManagedBeanConfigurator.java
Mon Nov 26 12:25:46 2012
@@ -25,7 +25,6 @@ import java.util.Set;
 import javax.decorator.Decorator;
 import javax.interceptor.Interceptor;
 
-import org.apache.webbeans.component.InjectionTargetWrapper;
 import org.apache.webbeans.component.ManagedBean;
 import org.apache.webbeans.component.ProducerFieldBean;
 import org.apache.webbeans.component.ProducerMethodBean;
@@ -133,7 +132,7 @@ public final class ManagedBeanConfigurat
         }
 
         ManagedBean<T> component = new ManagedBean<T>(clazz, type, webBeansContext);
-        manager.putInjectionTargetWrapper(component, new InjectionTargetProducer(component));
+        manager.putProducer(component, new InjectionTargetProducer(component));
 
         webBeansContext.getWebBeansUtil().setInjectionTargetBeanEnableFlag(component);
 
@@ -164,7 +163,7 @@ public final class ManagedBeanConfigurat
         {
             // add them one after the other to enable serialization handling et al
             manager.addBean(producerMethod);
-            manager.putInjectionTargetWrapper(producerMethod, new InjectionTargetWrapper(new
ProducerBeansProducer(producerMethod)));
+            manager.putProducer(producerMethod, new ProducerBeansProducer(producerMethod));
         }
 
         Set<ProducerFieldBean<?>> producerFields = definitionUtil.defineProducerFields(component);
@@ -172,7 +171,7 @@ public final class ManagedBeanConfigurat
         {
             // add them one after the other to enable serialization handling et al
             manager.addBean(producerField);
-            manager.putInjectionTargetWrapper(producerField, new InjectionTargetWrapper(new
ProducerBeansProducer(producerField)));
+            manager.putProducer(producerField, new ProducerBeansProducer(producerField));
         }
 
 

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/container/BeanManagerImpl.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/container/BeanManagerImpl.java?rev=1413573&r1=1413572&r2=1413573&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/container/BeanManagerImpl.java
(original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/container/BeanManagerImpl.java
Mon Nov 26 12:25:46 2012
@@ -63,7 +63,6 @@ import org.apache.webbeans.component.Abs
 import org.apache.webbeans.component.EnterpriseBeanMarker;
 import org.apache.webbeans.component.InjectionPointBean;
 import org.apache.webbeans.component.InjectionTargetBean;
-import org.apache.webbeans.component.InjectionTargetWrapper;
 import org.apache.webbeans.component.JmsBeanMarker;
 import org.apache.webbeans.component.NewBean;
 import org.apache.webbeans.component.OwbBean;
@@ -184,13 +183,12 @@ public class BeanManagerImpl implements 
      */
     private ConcurrentHashMap<String, Bean<?>> passivationBeans = new ConcurrentHashMap<String,
Bean<?>>(); 
 
-    //X TODO rename to reflect producers
-    private Map<Contextual<?>, Producer<?>> injectionTargetWrappers =
+    private Map<Contextual<?>, Producer<?>> producers =
         Collections.synchronizedMap(new IdentityHashMap<Contextual<?>, Producer<?>>());
     
     /**InjectionTargets for Java EE component instances that supports injections*/
-    private Map<Class<?>, InjectionTargetWrapper<?>> injectionTargetForJavaEeComponents
= 
-        new ConcurrentHashMap<Class<?>, InjectionTargetWrapper<?>>();
+    private Map<Class<?>, Producer<?>> injectionTargetForJavaEeComponents
=
+        new ConcurrentHashMap<Class<?>, Producer<?>>();
 
     private AnnotatedElementFactory annotatedElementFactory;
 
@@ -217,21 +215,21 @@ public class BeanManagerImpl implements 
         annotatedElementFactory = webBeansContext.getAnnotatedElementFactory();
     }
 
-    public <T> void putInjectionTargetWrapper(Contextual<T> contextual, Producer<T>
wrapper)
+    public <T> void putProducer(Contextual<T> contextual, Producer<T> producer)
     {
         Asserts.assertNotNull(contextual);
-        Asserts.assertNotNull(wrapper);
+        Asserts.assertNotNull(producer);
 
-        injectionTargetWrappers.put(contextual, wrapper);
+        producers.put(contextual, producer);
     }
     
-    public <T> Producer<T> getInjectionTargetWrapper(Contextual<T> contextual)
+    public <T> Producer<T> getProducer(Contextual<T> contextual)
     {
         Asserts.assertNotNull(contextual);
-        return (Producer<T>) injectionTargetWrappers.get(contextual);
+        return (Producer<T>) producers.get(contextual);
     }
     
-    public <T> void putInjectionTargetWrapperForJavaEeComponents(Class<T> javaEeComponentClass,
InjectionTargetWrapper<T> wrapper)
+    public <T> void putInjectionTargetWrapperForJavaEeComponents(Class<T> javaEeComponentClass,
Producer<T> wrapper)
     {
         Asserts.assertNotNull(javaEeComponentClass);
         Asserts.assertNotNull(wrapper);
@@ -239,10 +237,10 @@ public class BeanManagerImpl implements 
         injectionTargetForJavaEeComponents.put(javaEeComponentClass, wrapper);
     }
     
-    public <T> InjectionTargetWrapper<T> getInjectionTargetWrapper(Class<T>
javaEeComponentClass)
+    public <T> Producer<T> getInjectionTargetWrapper(Class<T> javaEeComponentClass)
     {
         Asserts.assertNotNull(javaEeComponentClass);
-        return (InjectionTargetWrapper<T>) injectionTargetForJavaEeComponents.get(javaEeComponentClass);
+        return (Producer<T>) injectionTargetForJavaEeComponents.get(javaEeComponentClass);
     }    
     
     public ErrorStack getErrorStack()
@@ -1113,7 +1111,7 @@ public class BeanManagerImpl implements 
         deploymentBeans.clear();
         errorStack.clear();
         injectionTargetForJavaEeComponents.clear();
-        injectionTargetWrappers.clear();
+        producers.clear();
         passivationBeans.clear();
         webBeansDecorators.clear();
         webBeansInterceptors.clear();

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/util/WebBeansUtil.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/util/WebBeansUtil.java?rev=1413573&r1=1413572&r2=1413573&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/util/WebBeansUtil.java
(original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/util/WebBeansUtil.java
Mon Nov 26 12:25:46 2012
@@ -2614,7 +2614,7 @@ public final class WebBeansUtil
             }
 
             //Put final InjectionTarget instance
-            manager.putInjectionTargetWrapper(managedBean, processInjectionTargetEvent.getInjectionTarget());
+            manager.putProducer(managedBean, processInjectionTargetEvent.getInjectionTarget());
 
             Map<ProducerMethodBean<?>,AnnotatedMethod<?>> annotatedMethods
=
                     new HashMap<ProducerMethodBean<?>, AnnotatedMethod<?>>();
@@ -2628,7 +2628,7 @@ public final class WebBeansUtil
                                                + "ProducerMethods. Look at logs for further
details");
 
                 annotatedMethods.put(producerMethod, method);
-                manager.putInjectionTargetWrapper(producerMethod, (Producer) producerEvent.getProducer());
+                manager.putProducer(producerMethod, (Producer) producerEvent.getProducer());
             }
 
             Map<ProducerFieldBean<?>,AnnotatedField<?>> annotatedFields
=
@@ -2642,7 +2642,7 @@ public final class WebBeansUtil
                                                + " ProducerFields. Look at logs for further
details");
 
                 annotatedFields.put(producerField, field);
-                manager.putInjectionTargetWrapper(producerField, (Producer) producerEvent.getProducer());
+                manager.putProducer(producerField, (Producer) producerEvent.getProducer());
             }
 
             Map<ObserverMethod<?>,AnnotatedMethod<?>> observerMethodsMap
=

Modified: openwebbeans/trunk/webbeans-tomcat6/src/main/java/org/apache/webbeans/web/tomcat/TomcatUtil.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-tomcat6/src/main/java/org/apache/webbeans/web/tomcat/TomcatUtil.java?rev=1413573&r1=1413572&r2=1413573&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-tomcat6/src/main/java/org/apache/webbeans/web/tomcat/TomcatUtil.java
(original)
+++ openwebbeans/trunk/webbeans-tomcat6/src/main/java/org/apache/webbeans/web/tomcat/TomcatUtil.java
Mon Nov 26 12:25:46 2012
@@ -18,13 +18,13 @@
  */
 package org.apache.webbeans.web.tomcat;
 
-import org.apache.webbeans.component.InjectionTargetWrapper;
 import org.apache.webbeans.config.WebBeansContext;
 import org.apache.webbeans.container.BeanManagerImpl;
 import org.apache.webbeans.inject.OWBInjector;
 
 import javax.enterprise.context.spi.CreationalContext;
 import javax.enterprise.inject.spi.BeanManager;
+import javax.enterprise.inject.spi.Producer;
 
 public class TomcatUtil
 {
@@ -54,10 +54,10 @@ public class TomcatUtil
         try
         {
             final BeanManagerImpl beanManager = WebBeansContext.currentInstance().getBeanManagerImpl();
-            final InjectionTargetWrapper wrapper = beanManager.getInjectionTargetWrapper(instance.object.getClass());
-            if (wrapper != null)
+            final Producer producer = beanManager.getInjectionTargetWrapper(instance.object.getClass());
+            if (producer != null)
             {
-                wrapper.dispose(instance.object);
+                producer.dispose(instance.object);
             }
             else if (instance.context != null)
             {

Modified: openwebbeans/trunk/webbeans-tomcat7/src/main/java/org/apache/webbeans/web/tomcat/TomcatUtil.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-tomcat7/src/main/java/org/apache/webbeans/web/tomcat/TomcatUtil.java?rev=1413573&r1=1413572&r2=1413573&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-tomcat7/src/main/java/org/apache/webbeans/web/tomcat/TomcatUtil.java
(original)
+++ openwebbeans/trunk/webbeans-tomcat7/src/main/java/org/apache/webbeans/web/tomcat/TomcatUtil.java
Mon Nov 26 12:25:46 2012
@@ -18,13 +18,13 @@
  */
 package org.apache.webbeans.web.tomcat;
 
-import org.apache.webbeans.component.InjectionTargetWrapper;
 import org.apache.webbeans.config.WebBeansContext;
 import org.apache.webbeans.container.BeanManagerImpl;
 import org.apache.webbeans.inject.OWBInjector;
 
 import javax.enterprise.context.spi.CreationalContext;
 import javax.enterprise.inject.spi.BeanManager;
+import javax.enterprise.inject.spi.Producer;
 
 public class TomcatUtil
 {
@@ -54,10 +54,10 @@ public class TomcatUtil
         try
         {
             final BeanManagerImpl beanManager = WebBeansContext.currentInstance().getBeanManagerImpl();
-            final InjectionTargetWrapper wrapper = beanManager.getInjectionTargetWrapper(instance.object.getClass());
-            if (wrapper != null)
+            final Producer producer = beanManager.getInjectionTargetWrapper(instance.object.getClass());
+            if (producer != null)
             {
-                wrapper.dispose(instance.object);
+                producer.dispose(instance.object);
             }
             else if (instance.context != null)
             {



Mime
View raw message