openwebbeans-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dblev...@apache.org
Subject svn commit: r1058749 [1/3] - in /openwebbeans/trunk: webbeans-ejb/src/main/java/org/apache/webbeans/ejb/common/proxy/ webbeans-ejb/src/main/java/org/apache/webbeans/ejb/common/util/ webbeans-el10/src/main/java/org/apache/webbeans/el10/ webbeans-impl/sr...
Date Thu, 13 Jan 2011 20:57:14 GMT
Author: dblevins
Date: Thu Jan 13 20:57:13 2011
New Revision: 1058749

URL: http://svn.apache.org/viewvc?rev=1058749&view=rev
Log:
De-static WebBeansUtil methods that use WebBeansContext
OWB-503 status: 571 code uses
Total of 17710 static synchronized accesses and 18132 hashed calls in 340 tests
Average of 52 static synchronized accesses and 53 hashed calls per test

Modified:
    openwebbeans/trunk/webbeans-ejb/src/main/java/org/apache/webbeans/ejb/common/proxy/EjbBeanProxyHandler.java
    openwebbeans/trunk/webbeans-ejb/src/main/java/org/apache/webbeans/ejb/common/util/CdiDefaultEjbInjector.java
    openwebbeans/trunk/webbeans-ejb/src/main/java/org/apache/webbeans/ejb/common/util/EjbDefinitionUtility.java
    openwebbeans/trunk/webbeans-ejb/src/main/java/org/apache/webbeans/ejb/common/util/EjbUtility.java
    openwebbeans/trunk/webbeans-el10/src/main/java/org/apache/webbeans/el10/EL10Resolver.java
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/AbstractOwbBean.java
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/ProducerFieldBean.java
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/ProducerMethodBean.java
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/creation/ManagedBeanCreatorImpl.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/DefinitionUtil.java
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/config/ManagedBeanConfigurator.java
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/config/WebBeansContext.java
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/container/BeanManagerImpl.java
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/container/ResolutionUtil.java
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/context/creational/CreationalContextImpl.java
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/conversation/ConversationImpl.java
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/corespi/DefaultSingletonService.java
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/decorator/DecoratorUtil.java
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/decorator/WebBeansDecoratorConfig.java
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/event/NotificationManager.java
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/event/ObserverMethodImpl.java
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/inject/AbstractInjectable.java
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/inject/InjectableMethods.java
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/inject/impl/InjectionPointFactory.java
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/inject/impl/InjectionPointImpl.java
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/intercept/InvocationContextImpl.java
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/intercept/NormalScopedBeanInterceptorHandler.java
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/intercept/WebBeansInterceptorConfig.java
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/intercept/ejb/EJBInterceptorConfig.java
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/intercept/webbeans/WebBeansInterceptor.java
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/portable/events/discovery/AfterBeanDiscoveryImpl.java
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/util/WebBeansAnnotatedTypeUtil.java
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/util/WebBeansUtil.java
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/xml/XMLDefinitionUtil.java
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/xml/XMLUtil.java
    openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/specializes/logger/LoggerSpecializationTest.java

Modified: openwebbeans/trunk/webbeans-ejb/src/main/java/org/apache/webbeans/ejb/common/proxy/EjbBeanProxyHandler.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-ejb/src/main/java/org/apache/webbeans/ejb/common/proxy/EjbBeanProxyHandler.java?rev=1058749&r1=1058748&r2=1058749&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-ejb/src/main/java/org/apache/webbeans/ejb/common/proxy/EjbBeanProxyHandler.java (original)
+++ openwebbeans/trunk/webbeans-ejb/src/main/java/org/apache/webbeans/ejb/common/proxy/EjbBeanProxyHandler.java Thu Jan 13 20:57:13 2011
@@ -43,7 +43,6 @@ import org.apache.webbeans.ejb.common.in
 import org.apache.webbeans.logger.WebBeansLogger;
 import org.apache.webbeans.util.ClassUtil;
 import org.apache.webbeans.util.SecurityUtil;
-import org.apache.webbeans.util.WebBeansUtil;
 
 import javassist.util.proxy.MethodHandler;
 
@@ -69,7 +68,9 @@ public class EjbBeanProxyHandler impleme
     
     /**Creational Context*/
     private CreationalContext<?> creationalContext;
-    
+
+    private WebBeansContext webBeansContext;
+
     //DO NOT REMOVE, used by PASSIVATION.
     public EjbBeanProxyHandler() 
     {
@@ -82,8 +83,8 @@ public class EjbBeanProxyHandler impleme
     public EjbBeanProxyHandler(BaseEjbBean<?> ejbBean, CreationalContext<?> creationalContext)
     {
         this.ejbBean = ejbBean;
-        
-        if(WebBeansUtil.isScopeTypeNormal(ejbBean.getScope()))
+
+        if(ejbBean.getWebBeansContext().getWebBeansUtil()._isScopeTypeNormal(ejbBean.getScope()))
         {
             initiateBeanBag((OwbBean<Object>)ejbBean, (CreationalContext<Object>)creationalContext);
         }
@@ -97,7 +98,8 @@ public class EjbBeanProxyHandler impleme
             isDependent = true;
             dependentEJB = null;
         }
-    }    
+        webBeansContext = ejbBean.getWebBeansContext();
+    }
     
     /**
      * {@inheritDoc}
@@ -138,7 +140,7 @@ public class EjbBeanProxyHandler impleme
             OpenWebBeansEjbInterceptor.setThreadLocal(this.ejbBean, getContextualCreationalContext());
 
             // Context of the bean
-            Context webbeansContext = WebBeansContext.getInstance().getBeanManagerImpl().getContext(this.ejbBean.getScope());
+            Context webbeansContext = webBeansContext.getBeanManagerImpl().getContext(this.ejbBean.getScope());
 
             // Don't go into a _dependent_ context on subsequent method calls in
             // this proxy!
@@ -244,7 +246,7 @@ public class EjbBeanProxyHandler impleme
         
         OwbBean<Object> contextual = (OwbBean<Object>)this.ejbBean;
         //Context of the bean
-        Context webbeansContext = WebBeansContext.getInstance().getBeanManagerImpl().getContext(this.ejbBean.getScope());
+        Context webbeansContext = webBeansContext.getBeanManagerImpl().getContext(this.ejbBean.getScope());
         if (webbeansContext instanceof AbstractContext)
         {
             AbstractContext owbContext = (AbstractContext)webbeansContext;
@@ -257,7 +259,7 @@ public class EjbBeanProxyHandler impleme
             //contained in @ApplicationScopedBean
             if(creationalContext == null)
             {
-                creationalContext = WebBeansContext.getInstance().getCreationalContextFactory().getCreationalContext(contextual);
+                creationalContext = webBeansContext.getCreationalContextFactory().getCreationalContext(contextual);
                 owbContext.initContextualBag((OwbBean<Object>)this.ejbBean, creationalContext);
             }            
         }
@@ -267,7 +269,7 @@ public class EjbBeanProxyHandler impleme
     
     private void initiateBeanBag(OwbBean<Object> bean, CreationalContext<Object> creationalContext)
     {
-        Context webbeansContext =  WebBeansContext.getInstance().getBeanManagerImpl().getContext(bean.getScope());
+        Context webbeansContext =  webBeansContext.getBeanManagerImpl().getContext(bean.getScope());
         if (webbeansContext instanceof AbstractContext)
         {
             AbstractContext owbContext = (AbstractContext)webbeansContext;
@@ -315,7 +317,7 @@ public class EjbBeanProxyHandler impleme
         String passivationId = (String) s.readObject();
         if (passivationId != null)
         {
-            this.ejbBean = (BaseEjbBean<?>) WebBeansContext.getInstance().getBeanManagerImpl().getPassivationCapableBean(passivationId);
+            this.ejbBean = (BaseEjbBean<?>) webBeansContext.getBeanManagerImpl().getPassivationCapableBean(passivationId);
         }
         
         this.isDependent = s.readBoolean();
@@ -355,7 +357,7 @@ public class EjbBeanProxyHandler impleme
         String passivationId = (String) in.readObject();
         if (passivationId != null)
         {
-            this.ejbBean = (BaseEjbBean<?>) WebBeansContext.getInstance().getBeanManagerImpl().getPassivationCapableBean(passivationId);
+            this.ejbBean = (BaseEjbBean<?>) webBeansContext.getBeanManagerImpl().getPassivationCapableBean(passivationId);
         }
         
         this.isDependent = in.readBoolean();

Modified: openwebbeans/trunk/webbeans-ejb/src/main/java/org/apache/webbeans/ejb/common/util/CdiDefaultEjbInjector.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-ejb/src/main/java/org/apache/webbeans/ejb/common/util/CdiDefaultEjbInjector.java?rev=1058749&r1=1058748&r2=1058749&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-ejb/src/main/java/org/apache/webbeans/ejb/common/util/CdiDefaultEjbInjector.java (original)
+++ openwebbeans/trunk/webbeans-ejb/src/main/java/org/apache/webbeans/ejb/common/util/CdiDefaultEjbInjector.java Thu Jan 13 20:57:13 2011
@@ -46,14 +46,17 @@ public class CdiDefaultEjbInjector
         new ConcurrentHashMap<Object, CreationalContextImpl<Object>>();
     
     private final BeanManagerImpl beanManager;
-    
+
+    private final WebBeansContext webBeansContext;
+
     /**
      * Default constructor.
      */
     public CdiDefaultEjbInjector()
     {
         super();
-        this.beanManager = WebBeansContext.getInstance().getBeanManagerImpl();
+        webBeansContext = WebBeansContext.getInstance();
+        this.beanManager = webBeansContext.getBeanManagerImpl();
     }
     
     /**
@@ -139,7 +142,7 @@ public class CdiDefaultEjbInjector
     {
         if(!(ctx instanceof CreationalContextImpl))
         {
-            ctx = WebBeansContext.getInstance().getCreationalContextFactory().wrappedCreationalContext(ctx, bean);
+            ctx = this.webBeansContext.getCreationalContextFactory().wrappedCreationalContext(ctx, bean);
         }
         
         Object oldInstanceUnderInjection = AbstractInjectable.instanceUnderInjection.get();

Modified: openwebbeans/trunk/webbeans-ejb/src/main/java/org/apache/webbeans/ejb/common/util/EjbDefinitionUtility.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-ejb/src/main/java/org/apache/webbeans/ejb/common/util/EjbDefinitionUtility.java?rev=1058749&r1=1058748&r2=1058749&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-ejb/src/main/java/org/apache/webbeans/ejb/common/util/EjbDefinitionUtility.java (original)
+++ openwebbeans/trunk/webbeans-ejb/src/main/java/org/apache/webbeans/ejb/common/util/EjbDefinitionUtility.java Thu Jan 13 20:57:13 2011
@@ -23,7 +23,6 @@ import javax.enterprise.context.spi.Crea
 import javassist.util.proxy.ProxyFactory;
 import javassist.util.proxy.ProxyObject;
 
-import org.apache.webbeans.config.WebBeansContext;
 import org.apache.webbeans.ejb.common.component.BaseEjbBean;
 import org.apache.webbeans.ejb.common.component.EjbBeanCreatorImpl;
 import org.apache.webbeans.ejb.common.proxy.EjbBeanProxyHandler;
@@ -62,7 +61,7 @@ public final class EjbDefinitionUtility
         try
         {
             T proxyInstance = null;
-            Class<?> clazz = WebBeansContext.getInstance().getJavassistProxyFactory().getEjbBeanProxyClass(bean, iface);
+            Class<?> clazz = bean.getWebBeansContext().getJavassistProxyFactory().getEjbBeanProxyClass(bean, iface);
             if(clazz == null)
             {
                 ProxyFactory factory = new ProxyFactory();
@@ -76,7 +75,7 @@ public final class EjbDefinitionUtility
                     factory.setSuperclass(iface);
                 }
 
-                clazz = WebBeansContext.getInstance().getJavassistProxyFactory().defineEjbBeanProxyClass(bean, iface, factory);
+                clazz = bean.getWebBeansContext().getJavassistProxyFactory().defineEjbBeanProxyClass(bean, iface, factory);
             }
             
             proxyInstance = (T) ClassUtil.newInstance(clazz);

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=1058749&r1=1058748&r2=1058749&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 Thu Jan 13 20:57:13 2011
@@ -63,8 +63,9 @@ public final class EjbUtility
         
     public static <T> void fireEvents(Class<T> clazz, BaseEjbBean<T> ejbBean,ProcessAnnotatedType<T> event)
     {
-        BeanManagerImpl manager = WebBeansContext.getInstance().getBeanManagerImpl();
-        AnnotatedElementFactory annotatedElementFactory = WebBeansContext.getInstance().getAnnotatedElementFactory();
+        WebBeansContext webBeansContext = ejbBean.getWebBeansContext();
+        BeanManagerImpl manager = webBeansContext.getBeanManagerImpl();
+        AnnotatedElementFactory annotatedElementFactory = webBeansContext.getAnnotatedElementFactory();
 
         AnnotatedType<T> annotatedType = annotatedElementFactory.newAnnotatedType(clazz);
         
@@ -98,8 +99,10 @@ public final class EjbUtility
         Set<ObserverMethod<?>> observerMethods = ejbBeanCreator.defineObserverMethods();        
         
         //Fires ProcessInjectionTarget
-        ProcessInjectionTargetImpl<T> processInjectionTargetEvent = WebBeansUtil.fireProcessInjectionTargetEvent(ejbBean);     
-        WebBeansUtil.inspectErrorStack("There are errors that are added by ProcessInjectionTarget event observers. Look at logs for further details");
+        ProcessInjectionTargetImpl<T> processInjectionTargetEvent =
+            webBeansContext.getWebBeansUtil()._fireProcessInjectionTargetEvent(ejbBean);
+        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, new InjectionTargetWrapper(processInjectionTargetEvent.getInjectionTarget()));
         
@@ -107,8 +110,11 @@ public final class EjbUtility
         for(ProducerMethodBean<?> producerMethod : producerMethodBeans)
         {
             AnnotatedMethod<?> method = annotatedElementFactory.newAnnotatedMethod(producerMethod.getCreatorMethod(), annotatedType);
-            ProcessProducerImpl<?, ?> producerEvent = WebBeansUtil.fireProcessProducerEventForMethod(producerMethod,method);
-            WebBeansUtil.inspectErrorStack("There are errors that are added by ProcessProducer event observers for ProducerMethods. Look at logs for further details");
+            ProcessProducerImpl<?, ?> producerEvent =
+                webBeansContext.getWebBeansUtil()._fireProcessProducerEventForMethod(producerMethod,
+                                                                                                   method);
+            webBeansContext.getWebBeansUtil()._inspectErrorStack(
+                "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()));
@@ -120,9 +126,11 @@ public final class EjbUtility
         for(ProducerFieldBean<?> producerField : producerFieldBeans)
         {
             AnnotatedField<?> field = annotatedElementFactory.newAnnotatedField(producerField.getCreatorField(), annotatedType);
-            ProcessProducerImpl<?, ?> producerEvent = WebBeansUtil.fireProcessProducerEventForField(producerField, field);
-            WebBeansUtil.inspectErrorStack("There are errors that are added by ProcessProducer event observers for ProducerFields. Look at logs for further details");
-            
+            ProcessProducerImpl<?, ?> producerEvent =
+                webBeansContext.getWebBeansUtil()._fireProcessProducerEventForField(producerField, field);
+            webBeansContext.getWebBeansUtil()._inspectErrorStack(
+                "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()));
 
@@ -141,21 +149,25 @@ public final class EjbUtility
 
         //Fires ProcessManagedBean
         ProcessSessionBeanImpl<T> processBeanEvent = new GProcessSessionBean((Bean<Object>)ejbBean,annotatedType,ejbBean.getEjbName(),ejbBean.getEjbType());
-        WebBeansContext.getInstance().getBeanManagerImpl().fireEvent(processBeanEvent, new Annotation[0]);
-        WebBeansUtil.inspectErrorStack("There are errors that are added by ProcessSessionBean event observers for managed beans. Look at logs for further details");
-        
-        
+        webBeansContext.getBeanManagerImpl().fireEvent(processBeanEvent, new Annotation[0]);
+        webBeansContext.getWebBeansUtil()._inspectErrorStack(
+            "There are errors that are added by ProcessSessionBean event observers for managed beans. Look at logs for further details");
+
         //Fires ProcessProducerMethod
-        WebBeansUtil.fireProcessProducerMethodBeanEvent(annotatedMethods, annotatedType);
-        WebBeansUtil.inspectErrorStack("There are errors that are added by ProcessProducerMethod event observers for producer method beans. Look at logs for further details");
-        
+        webBeansContext.getWebBeansUtil()._fireProcessProducerMethodBeanEvent(annotatedMethods,
+                                                                                            annotatedType);
+        webBeansContext.getWebBeansUtil()._inspectErrorStack(
+            "There are errors that are added by ProcessProducerMethod event observers for producer method beans. Look at logs for further details");
+
         //Fires ProcessProducerField
-        WebBeansUtil.fireProcessProducerFieldBeanEvent(annotatedFields);
-        WebBeansUtil.inspectErrorStack("There are errors that are added by ProcessProducerField event observers for producer field beans. Look at logs for further details");
-        
+        webBeansContext.getWebBeansUtil()._fireProcessProducerFieldBeanEvent(annotatedFields);
+        webBeansContext.getWebBeansUtil()._inspectErrorStack(
+            "There are errors that are added by ProcessProducerField event observers for producer field beans. Look at logs for further details");
+
         //Fire ObservableMethods
-        WebBeansUtil.fireProcessObservableMethodBeanEvent(observerMethodsMap);
-        WebBeansUtil.inspectErrorStack("There are errors that are added by ProcessObserverMethod event observers for observer methods. Look at logs for further details");
+        webBeansContext.getWebBeansUtil()._fireProcessObservableMethodBeanEvent(observerMethodsMap);
+        webBeansContext.getWebBeansUtil()._inspectErrorStack(
+            "There are errors that are added by ProcessObserverMethod event observers for observer methods. Look at logs for further details");
 
         manager.addBean(ejbBean);
         try

Modified: openwebbeans/trunk/webbeans-el10/src/main/java/org/apache/webbeans/el10/EL10Resolver.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-el10/src/main/java/org/apache/webbeans/el10/EL10Resolver.java?rev=1058749&r1=1058748&r2=1058749&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-el10/src/main/java/org/apache/webbeans/el10/EL10Resolver.java (original)
+++ openwebbeans/trunk/webbeans-el10/src/main/java/org/apache/webbeans/el10/EL10Resolver.java Thu Jan 13 20:57:13 2011
@@ -67,10 +67,11 @@ public class EL10Resolver extends ELReso
         //Check that application is OWB enabled
         //For JSF applications that are not
         //OWB enabled, no need to go with this resolver....
-        AbstractOwbJsfPlugin jsfPlugin = WebBeansContext.getInstance().getPluginLoader().getJsfPlugin();
+        WebBeansContext webBeansContext = WebBeansContext.getInstance();
+        AbstractOwbJsfPlugin jsfPlugin = webBeansContext.getPluginLoader().getJsfPlugin();
         
         //No JSF plugin, sure that not OWB  
-        if(jsfPlugin == null && !(WebBeansContext.getInstance().getOpenWebBeansConfiguration().isJspApplication()))
+        if(jsfPlugin == null && !(webBeansContext.getOpenWebBeansConfiguration().isJspApplication()))
         {
             return null;
         }        

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=1058749&r1=1058748&r2=1058749&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 Thu Jan 13 20:57:13 2011
@@ -39,7 +39,6 @@ import org.apache.webbeans.context.creat
 import org.apache.webbeans.exception.WebBeansConfigurationException;
 import org.apache.webbeans.logger.WebBeansLogger;
 import org.apache.webbeans.util.ClassUtil;
-import org.apache.webbeans.util.WebBeansUtil;
 
 /**
  * Abstract implementation of the {@link OwbBean} contract. 
@@ -682,7 +681,7 @@ public abstract class AbstractOwbBean<T>
             {
                 if(!injectionPoint.isTransient())
                 {
-                    if(!WebBeansUtil.isPassivationCapableDependency(injectionPoint))
+                    if(!getWebBeansContext().getWebBeansUtil()._isPassivationCapableDependency(injectionPoint))
                     {
                         if(injectionPoint.getAnnotated().isAnnotationPresent(Disposes.class))
                         {

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/ProducerFieldBean.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/ProducerFieldBean.java?rev=1058749&r1=1058748&r2=1058749&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/ProducerFieldBean.java (original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/ProducerFieldBean.java Thu Jan 13 20:57:13 2011
@@ -178,7 +178,8 @@ public class ProducerFieldBean<T> extend
                               " return type in the component implementation class : " +
                               this.ownerComponent.getReturnType().getName() + " with passivating scope @" +
                               this.getScope().getName() + " must be Serializable";
-        WebBeansUtil.checkSerializableScopeType(this.getScope(), this.isSerializable(), errorMessage);
+        getWebBeansContext().getWebBeansUtil()._checkSerializableScopeType(this.getScope(),
+                                                                                    this.isSerializable(), errorMessage);
     }
     
     @Override

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/ProducerMethodBean.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/ProducerMethodBean.java?rev=1058749&r1=1058748&r2=1058749&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/ProducerMethodBean.java (original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/ProducerMethodBean.java Thu Jan 13 20:57:13 2011
@@ -385,7 +385,8 @@ public class ProducerMethodBean<T> exten
                               " return type in the component implementation class : " +
                               this.ownerComponent.getReturnType().getName() + " with passivating scope @" +
                               this.getScope().getName() + " must be Serializable";
-        WebBeansUtil.checkSerializableScopeType(this.getScope(), this.isSerializable(), errorMessage);
+        getWebBeansContext().getWebBeansUtil()._checkSerializableScopeType(this.getScope(),
+                                                                                    this.isSerializable(), errorMessage);
 
     }
     

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/creation/ManagedBeanCreatorImpl.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/creation/ManagedBeanCreatorImpl.java?rev=1058749&r1=1058748&r2=1058749&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/creation/ManagedBeanCreatorImpl.java (original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/creation/ManagedBeanCreatorImpl.java Thu Jan 13 20:57:13 2011
@@ -25,6 +25,7 @@ import javax.enterprise.inject.spi.Annot
 import org.apache.webbeans.component.ManagedBean;
 import org.apache.webbeans.config.DefinitionUtil;
 import org.apache.webbeans.config.ManagedBeanConfigurator;
+import org.apache.webbeans.config.WebBeansContext;
 import org.apache.webbeans.util.WebBeansAnnotatedTypeUtil;
 import org.apache.webbeans.util.WebBeansUtil;
 
@@ -37,6 +38,7 @@ import org.apache.webbeans.util.WebBeans
  */
 public class ManagedBeanCreatorImpl<T> extends AbstractInjectedTargetBeanCreator<T> implements ManagedBeanCreator<T>
 {
+    private final WebBeansContext webBeansContext;
 
     /**
      * Creates a new creator.
@@ -46,6 +48,7 @@ public class ManagedBeanCreatorImpl<T> e
     public ManagedBeanCreatorImpl(ManagedBean<T> managedBean)
     {
         super(managedBean);
+        webBeansContext = managedBean.getWebBeansContext();
     }
     
     
@@ -66,7 +69,7 @@ public class ManagedBeanCreatorImpl<T> e
         
         WebBeansUtil.checkGenericType(getBean());
         //Check Unproxiable
-        WebBeansUtil.checkUnproxiableApiType(getBean(), getBean().getScope());                                
+        webBeansContext.getWebBeansUtil()._checkUnproxiableApiType(getBean(), getBean().getScope());
     }
 
 

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=1058749&r1=1058748&r2=1058749&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 Thu Jan 13 20:57:13 2011
@@ -262,8 +262,9 @@ public class BeansDeployer
     {
         BeanManagerImpl manager = webBeansContext.getBeanManagerImpl();
         manager.fireEvent(new AfterBeanDiscoveryImpl(),new Annotation[0]);
-        
-        WebBeansUtil.inspectErrorStack("There are errors that are added by AfterBeanDiscovery event observers. Look at logs for further details");
+
+        webBeansContext.getWebBeansUtil()._inspectErrorStack(
+            "There are errors that are added by AfterBeanDiscovery event observers. Look at logs for further details");
     }
     
     /**
@@ -273,8 +274,9 @@ public class BeansDeployer
     {
         BeanManagerImpl manager = webBeansContext.getBeanManagerImpl();
         manager.fireEvent(new AfterDeploymentValidationImpl(),new Annotation[0]);
-        
-        WebBeansUtil.inspectErrorStack("There are errors that are added by AfterDeploymentValidation event observers. Look at logs for further details");
+
+        webBeansContext.getWebBeansUtil()._inspectErrorStack(
+            "There are errors that are added by AfterDeploymentValidation event observers. Look at logs for further details");
     }
     
     /**
@@ -519,7 +521,8 @@ public class BeansDeployer
     private void deploySingleAnnotatedType(Class implClass, AnnotatedType annotatedType)
     {
         // Fires ProcessAnnotatedType
-        ProcessAnnotatedTypeImpl<?> processAnnotatedEvent = WebBeansUtil.fireProcessAnnotatedTypeEvent(annotatedType);
+        ProcessAnnotatedTypeImpl<?> processAnnotatedEvent =
+            webBeansContext.getWebBeansUtil()._fireProcessAnnotatedTypeEvent(annotatedType);
 
         // if veto() is called
         if (processAnnotatedEvent.isVeto())
@@ -628,14 +631,14 @@ public class BeansDeployer
                         specialClassList.add(specialClass);
                     }
                 }
-                WebBeansUtil.configureSpecializations(specialClassList);                        
+                webBeansContext.getWebBeansUtil()._configureSpecializations(specialClassList);
             }
 
             // XML Defined Specializations
             checkXMLSpecializations();
             
             //configure specialized producer beans.
-            WebBeansUtil.configureProducerMethodSpecializations();
+            webBeansContext.getWebBeansUtil()._configureProducerMethodSpecializations();
         }
         catch(Exception e)
         {
@@ -678,7 +681,7 @@ public class BeansDeployer
             }
             specialClassList.add(specialClass);
         }
-        WebBeansUtil.configureSpecializations(specialClassList);
+        webBeansContext.getWebBeansUtil()._configureSpecializations(specialClassList);
     }
 
     /**
@@ -788,12 +791,15 @@ public class BeansDeployer
         //Fires ProcessInjectionTarget event for Java EE components instances
         //That supports injections but not managed beans
         ProcessInjectionTargetImpl<T> processInjectionTargetEvent = null;
-        if(WebBeansUtil.supportsJavaEeComponentInjections(clazz))
+        if(webBeansContext.getWebBeansUtil()._supportsJavaEeComponentInjections(clazz))
         {
             //Fires ProcessInjectionTarget
-            processInjectionTargetEvent = WebBeansUtil.fireProcessInjectionTargetEventForJavaEeComponents(clazz);    
-            WebBeansUtil.inspectErrorStack("There are errors that are added by ProcessInjectionTarget event observers. Look at logs for further details");
-            
+            processInjectionTargetEvent =
+                webBeansContext.getWebBeansUtil()._fireProcessInjectionTargetEventForJavaEeComponents(
+                    clazz);
+            webBeansContext.getWebBeansUtil()._inspectErrorStack(
+                "There are errors that are added by ProcessInjectionTarget event observers. Look at logs for further details");
+
             //Sets custom InjectionTarget instance
             if(processInjectionTargetEvent.isSet())
             {
@@ -828,7 +834,8 @@ public class BeansDeployer
             //If ProcessInjectionTargetEvent is not set, set it
             if(processInjectionTargetEvent == null)
             {
-                processInjectionTargetEvent = WebBeansUtil.fireProcessInjectionTargetEvent(managedBean);   
+                processInjectionTargetEvent =
+                    webBeansContext.getWebBeansUtil()._fireProcessInjectionTargetEvent(managedBean);
             }    
             
             //Decorator
@@ -844,7 +851,8 @@ public class BeansDeployer
                 }
                 else
                 {
-                    WebBeansUtil.defineDecorator(managedBeanCreator, processInjectionTargetEvent);
+                    webBeansContext.getWebBeansUtil()._defineDecorator(managedBeanCreator,
+                                                                                     processInjectionTargetEvent);
                 }
             }
             //Interceptor
@@ -860,7 +868,8 @@ public class BeansDeployer
                 }
                 else
                 {
-                    WebBeansUtil.defineInterceptor(managedBeanCreator, processInjectionTargetEvent);
+                    webBeansContext.getWebBeansUtil()._defineInterceptor(managedBeanCreator,
+                                                                                       processInjectionTargetEvent);
                 }
             }
             else
@@ -875,7 +884,8 @@ public class BeansDeployer
                 {
                     logger.debug("Found Managed Bean with class name : [{0}]", annotatedType.getJavaClass().getName());
                 }
-                WebBeansUtil.defineManagedBean(managedBeanCreator, processInjectionTargetEvent);   
+                webBeansContext.getWebBeansUtil()._defineManagedBean(managedBeanCreator,
+                                                                                   processInjectionTargetEvent);
             }
             
             return true;
@@ -896,6 +906,6 @@ public class BeansDeployer
     protected <T> void defineEnterpriseWebBean(Class<T> clazz, ProcessAnnotatedType<T> processAnnotatedTypeEvent)
     {
         InjectionTargetBean<T> bean = (InjectionTargetBean<T>) EJBWebBeansConfigurator.defineEjbBean(clazz, processAnnotatedTypeEvent);
-        WebBeansUtil.setInjectionTargetBeanEnableFlag(bean);
+        webBeansContext.getWebBeansUtil()._setInjectionTargetBeanEnableFlag(bean);
     }
 }

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/config/DefinitionUtil.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/config/DefinitionUtil.java?rev=1058749&r1=1058748&r2=1058749&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/config/DefinitionUtil.java (original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/config/DefinitionUtil.java Thu Jan 13 20:57:13 2011
@@ -220,7 +220,7 @@ public final class DefinitionUtil
      */
     public static <T> void defineQualifiers(AbstractOwbBean<T> component, Annotation[] annotations)
     {
-        final AnnotationManager annotationManager = WebBeansContext.getInstance().getAnnotationManager();
+        final AnnotationManager annotationManager = component.getWebBeansContext().getAnnotationManager();
 
         boolean find = false;
         for (Annotation annotation : annotations)
@@ -318,7 +318,7 @@ public final class DefinitionUtil
     {
         boolean found = false;
 
-        List<ExternalScope> additionalScopes = WebBeansContext.getInstance().getBeanManagerImpl().getAdditionalScopes();
+        List<ExternalScope> additionalScopes = component.getWebBeansContext().getBeanManagerImpl().getAdditionalScopes();
         
         for (Annotation annotation : annotations)
         {   
@@ -393,7 +393,7 @@ public final class DefinitionUtil
 
     public static <T> void defineStereoTypes(OwbBean<?> component, Annotation[] anns)
     {
-        final AnnotationManager annotationManager = WebBeansContext.getInstance().getAnnotationManager();
+        final AnnotationManager annotationManager = component.getWebBeansContext().getAnnotationManager();
         if (annotationManager.hasStereoTypeMetaAnnotation(anns))
         {
             Annotation[] steroAnns =
@@ -534,7 +534,7 @@ public final class DefinitionUtil
         if (nameAnnot == null) // no @Named
         {
             // Check for stereottype
-            if (WebBeansContext.getInstance().getAnnotationManager().hasNamedOnStereoTypes(component))
+            if (component.getWebBeansContext().getAnnotationManager().hasNamedOnStereoTypes(component))
             {
                 isDefault = true;
             }
@@ -683,14 +683,15 @@ public final class DefinitionUtil
         defineStereoTypes(component, method.getDeclaredAnnotations());
 
         Annotation[] methodAnns = method.getDeclaredAnnotations();
-        
-        WebBeansUtil.setBeanEnableFlagForProducerBean(parent, component, methodAnns);
+
+        WebBeansContext webBeansContext = parent.getWebBeansContext();
+        webBeansContext.getWebBeansUtil()._setBeanEnableFlagForProducerBean(parent, component, methodAnns);
 
         DefinitionUtil.defineProducerMethodApiTypes(component, method.getGenericReturnType(), methodAnns);
         DefinitionUtil.defineScopeType(component, methodAnns, "WebBeans producer method : " + method.getName() + " in class " + parent.getReturnType().getName()
                                                               + " must declare default @Scope annotation");
-        WebBeansUtil.checkUnproxiableApiType(component, component.getScope());
-        WebBeansUtil.checkProducerGenericType(component,method);        
+        webBeansContext.getWebBeansUtil()._checkUnproxiableApiType(component, component.getScope());
+        WebBeansUtil.checkProducerGenericType(component,method);
         DefinitionUtil.defineQualifiers(component, methodAnns);
         DefinitionUtil.defineName(component, methodAnns, WebBeansUtil.getProducerDefaultName(method.getName()));
 
@@ -739,13 +740,14 @@ public final class DefinitionUtil
         defineStereoTypes(component, field.getDeclaredAnnotations());
 
         Annotation[] fieldAnns = field.getDeclaredAnnotations();
-        
-        WebBeansUtil.setBeanEnableFlagForProducerBean(parent, component, fieldAnns);
+
+        WebBeansContext webBeansContext = parent.getWebBeansContext();
+        webBeansContext.getWebBeansUtil()._setBeanEnableFlagForProducerBean(parent, component, fieldAnns);
 
         DefinitionUtil.defineProducerMethodApiTypes(component, field.getGenericType(), fieldAnns);
         DefinitionUtil.defineScopeType(component, fieldAnns, "WebBeans producer method : " + field.getName() + " in class " + parent.getReturnType().getName()
                                                              + " must declare default @Scope annotation");
-        WebBeansUtil.checkUnproxiableApiType(component, component.getScope());
+        webBeansContext.getWebBeansUtil()._checkUnproxiableApiType(component, component.getScope());
         WebBeansUtil.checkProducerGenericType(component,field);
         DefinitionUtil.defineQualifiers(component, fieldAnns);
         DefinitionUtil.defineName(component, fieldAnns, field.getName());
@@ -766,7 +768,7 @@ public final class DefinitionUtil
 
     private static <T> void createDisposalMethods(AbstractOwbBean<T> component, Method[] methods, Class<?> clazz)
     {
-        final AnnotationManager annotationManager = WebBeansContext.getInstance().getAnnotationManager();
+        final AnnotationManager annotationManager = component.getWebBeansContext().getAnnotationManager();
 
         ProducerMethodBean<?> previous = null;
         for (Method declaredMethod : methods)
@@ -857,7 +859,8 @@ public final class DefinitionUtil
     public static <T> void defineInternalInjectedFields(AbstractInjectionTargetBean<T> component, Class<T> clazz, boolean fromSuperClazz)
     {
 
-        final AnnotationManager annotationManager = WebBeansContext.getInstance().getAnnotationManager();
+        WebBeansContext webBeansContext = component.getWebBeansContext();
+        final AnnotationManager annotationManager = webBeansContext.getAnnotationManager();
 
         Field[] fields = SecurityUtil.doPrivilegedGetDeclaredFields(clazz);
 
@@ -868,7 +871,7 @@ public final class DefinitionUtil
                 //Check for public fields
                 if(ClassUtil.isPublic(field.getModifiers()) && !ClassUtil.isStatic(field.getModifiers()))
                 {
-                    if(WebBeansContext.getInstance().getBeanManagerImpl().isNormalScope(component.getScope()))
+                    if(webBeansContext.getBeanManagerImpl().isNormalScope(component.getScope()))
                     {
                         throw new WebBeansConfigurationException("If bean has a public field, bean scope must be defined as @Scope. Bean is : "
                                                                  + component.toString());
@@ -1080,7 +1083,7 @@ public final class DefinitionUtil
         Asserts.assertNotNull(component, "component parameter can not be null");
         Asserts.nullCheckForClass(clazz);
 
-        NotificationManager manager = WebBeansContext.getInstance().getBeanManagerImpl().getNotificationManager();
+        NotificationManager manager = component.getWebBeansContext().getBeanManagerImpl().getNotificationManager();
 
         Method[] candidateMethods = AnnotationUtil.getMethodsWithParameterAnnotation(clazz, Observes.class);
 

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=1058749&r1=1058748&r2=1058749&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 Thu Jan 13 20:57:13 2011
@@ -95,7 +95,7 @@ public final class ManagedBeanConfigurat
     {
         try
         {
-            WebBeansUtil.isManagedBeanClass(clazz);
+            WebBeansContext.getInstance().getWebBeansUtil()._isManagedBeanClass(clazz);
 
         }
         catch (WebBeansConfigurationException e)
@@ -117,15 +117,16 @@ public final class ManagedBeanConfigurat
     @SuppressWarnings("unchecked")
     public static <T> ManagedBean<T> define(Class<T> clazz, WebBeansType type) throws WebBeansConfigurationException
     {
-        BeanManagerImpl manager = WebBeansContext.getInstance().getBeanManagerImpl();
+        WebBeansContext webBeansContext = WebBeansContext.getInstance();
+        BeanManagerImpl manager = webBeansContext.getBeanManagerImpl();
 
         checkManagedBeanCondition(clazz);
 
         ManagedBean<T> component = new ManagedBean<T>(clazz, type);
         manager.putInjectionTargetWrapper(component, new InjectionTargetWrapper(new InjectionTargetProducer(component)));
-        
-        WebBeansUtil.setInjectionTargetBeanEnableFlag(component);   
-        
+
+        webBeansContext.getWebBeansUtil()._setInjectionTargetBeanEnableFlag(component);
+
         DefinitionUtil.defineSerializable(component);
         DefinitionUtil.defineStereoTypes(component, clazz.getDeclaredAnnotations());
                 

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/config/WebBeansContext.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/config/WebBeansContext.java?rev=1058749&r1=1058748&r2=1058749&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/config/WebBeansContext.java (original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/config/WebBeansContext.java Thu Jan 13 20:57:13 2011
@@ -47,6 +47,7 @@ import org.apache.webbeans.spi.ContextsS
 import org.apache.webbeans.spi.ScannerService;
 import org.apache.webbeans.spi.plugins.OpenWebBeansPlugin;
 import org.apache.webbeans.util.ClassUtil;
+import org.apache.webbeans.util.WebBeansUtil;
 import org.apache.webbeans.xml.WebBeansNameSpaceContainer;
 import org.apache.webbeans.xml.XMLAnnotationTypeManager;
 import org.apache.webbeans.xml.XMLSpecializesManager;
@@ -57,6 +58,7 @@ import org.apache.webbeans.xml.XMLSpecia
 public class WebBeansContext
 {
 
+    private WebBeansUtil webBeansUtil = new WebBeansUtil(this);
     private ContextFactory contextFactory = new ContextFactory(this);
     private AlternativesManager alternativesManager = new AlternativesManager(this);
     private AnnotatedElementFactory annotatedElementFactory = new AnnotatedElementFactory();
@@ -158,6 +160,11 @@ public class WebBeansContext
         return serviceInterface.cast(get(implName));
     }
 
+    public WebBeansUtil getWebBeansUtil()
+    {
+        return webBeansUtil;
+    }
+
     public ContextFactory getContextFactory()
     {
         return contextFactory;
@@ -279,7 +286,7 @@ public class WebBeansContext
 
     public <T> T get(Class<T> clazz)
     {
-        //util.Track.get(singletonName);
+        //util.Track.get(clazz);
         T object = clazz.cast(managerMap.get(clazz));
 
         /* No singleton for this application, create one */

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=1058749&r1=1058748&r2=1058749&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 Thu Jan 13 20:57:13 2011
@@ -836,7 +836,7 @@ public class BeanManagerImpl implements 
         
                 
         //Scope is normal
-        if (WebBeansUtil.isScopeTypeNormal(bean.getScope()))
+        if (webBeansContext.getWebBeansUtil()._isScopeTypeNormal(bean.getScope()))
         {
             instance = getEjbOrJmsProxyReference(bean, beanType,creationalContext);
             
@@ -883,7 +883,7 @@ public class BeanManagerImpl implements 
         //Create session bean proxy
         if(bean instanceof EnterpriseBeanMarker)
         {
-            if(WebBeansUtil.isScopeTypeNormal(bean.getScope()))
+            if(webBeansContext.getWebBeansUtil()._isScopeTypeNormal(bean.getScope()))
             {
                 //Maybe it is cached
                 if(this.cacheProxies.containsKey(bean))

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/container/ResolutionUtil.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/container/ResolutionUtil.java?rev=1058749&r1=1058748&r2=1058749&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/container/ResolutionUtil.java (original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/container/ResolutionUtil.java Thu Jan 13 20:57:13 2011
@@ -30,7 +30,6 @@ import javax.enterprise.inject.spi.Injec
 import org.apache.webbeans.config.WebBeansContext;
 import org.apache.webbeans.util.Asserts;
 import org.apache.webbeans.util.ClassUtil;
-import org.apache.webbeans.util.WebBeansUtil;
 import static org.apache.webbeans.util.InjectionExceptionUtils.*;
 
 public final class ResolutionUtil
@@ -102,7 +101,7 @@ public final class ResolutionUtil
         }
 
         Bean<?> bean = resolvedSet.iterator().next();
-        WebBeansUtil.checkUnproxiableApiType(bean, bean.getScope());
+        WebBeansContext.getInstance().getWebBeansUtil()._checkUnproxiableApiType(bean, bean.getScope());
 
     }    
 }

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/context/creational/CreationalContextImpl.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/context/creational/CreationalContextImpl.java?rev=1058749&r1=1058748&r2=1058749&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/context/creational/CreationalContextImpl.java (original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/context/creational/CreationalContextImpl.java Thu Jan 13 20:57:13 2011
@@ -317,6 +317,7 @@ public class CreationalContextImpl<T> im
     @SuppressWarnings("unchecked")
     public void removeAllDependents()
     {
+        WebBeansContext webBeansContext = WebBeansContext.getInstance();
         Collection<List<DependentCreationalContext<?>>> values = this.dependentObjects.values();
         if(values != null)
         {
@@ -328,7 +329,7 @@ public class CreationalContextImpl<T> im
                     while(iterator.hasNext())
                     {
                         DependentCreationalContext<T> dependent = (DependentCreationalContext<T>)iterator.next();
-                        final CreationalContextFactory contextFactory = WebBeansContext.getInstance().getCreationalContextFactory();
+                        final CreationalContextFactory contextFactory = webBeansContext.getCreationalContextFactory();
                         dependent.getContextual().destroy((T)dependent.getInstance(), contextFactory.getCreationalContext(dependent.getContextual()));
                     }                        
                 }                

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/conversation/ConversationImpl.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/conversation/ConversationImpl.java?rev=1058749&r1=1058748&r2=1058749&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/conversation/ConversationImpl.java (original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/conversation/ConversationImpl.java Thu Jan 13 20:57:13 2011
@@ -108,13 +108,14 @@ public class ConversationImpl implements
             this.id = Integer.toString(conversationIdGenerator.incrementAndGet());
             
             //Conversation manager
-            ConversationManager manager = WebBeansContext.getInstance().getConversationManager();
+            WebBeansContext webBeansContext = WebBeansContext.getInstance();
+            ConversationManager manager = webBeansContext.getConversationManager();
             try
             {
                 //Gets current converation context instance.
                 //Each conversation has its own conversation context instance.
                 //Sets at the beginning of each JSF request.
-                manager.addConversationContext(this, (ConversationContext) WebBeansContext.getInstance().getBeanManagerImpl().getContext(ConversationScoped.class));
+                manager.addConversationContext(this, (ConversationContext) webBeansContext.getBeanManagerImpl().getContext(ConversationScoped.class));
                 
             }
             catch(Exception e)

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/corespi/DefaultSingletonService.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/corespi/DefaultSingletonService.java?rev=1058749&r1=1058748&r2=1058749&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/corespi/DefaultSingletonService.java (original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/corespi/DefaultSingletonService.java Thu Jan 13 20:57:13 2011
@@ -48,10 +48,10 @@ public class DefaultSingletonService imp
         ClassLoader classLoader = (ClassLoader) key;
         synchronized (singletonMap)
         {
-            //util.Track.sync(singletonName);
+            //util.Track.sync(key);
             
             WebBeansContext webBeansContext = singletonMap.get(classLoader);
-            //util.Track.get(singletonName);
+            //util.Track.get(key);
 
             if (webBeansContext == null)
             {

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/decorator/DecoratorUtil.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/decorator/DecoratorUtil.java?rev=1058749&r1=1058748&r2=1058749&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/decorator/DecoratorUtil.java (original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/decorator/DecoratorUtil.java Thu Jan 13 20:57:13 2011
@@ -32,7 +32,6 @@ import javax.enterprise.inject.spi.Decor
 
 import org.apache.webbeans.component.AbstractInjectionTargetBean;
 import org.apache.webbeans.config.OWBLogConst;
-import org.apache.webbeans.config.WebBeansContext;
 import org.apache.webbeans.exception.WebBeansConfigurationException;
 import org.apache.webbeans.exception.WebBeansException;
 import org.apache.webbeans.logger.WebBeansLogger;
@@ -101,7 +100,7 @@ public final class DecoratorUtil
 
         if(decoratorList == null)
         {
-            decoratorList = WebBeansContext.getInstance().getBeanManagerImpl().resolveDecorators(bean.getTypes(), anns);
+            decoratorList = bean.getWebBeansContext().getBeanManagerImpl().resolveDecorators(bean.getTypes(), anns);
         }
         if (!decoratorList.isEmpty())
         {

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/decorator/WebBeansDecoratorConfig.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/decorator/WebBeansDecoratorConfig.java?rev=1058749&r1=1058748&r2=1058749&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/decorator/WebBeansDecoratorConfig.java (original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/decorator/WebBeansDecoratorConfig.java Thu Jan 13 20:57:13 2011
@@ -81,14 +81,14 @@ public final class WebBeansDecoratorConf
         
         logger.debug("Configuring decorator class : [{0}]", delegate.getReturnType());
         WebBeansDecorator<T> decorator = new WebBeansDecorator<T>(delegate);
-        WebBeansContext.getInstance().getBeanManagerImpl().addDecorator(decorator);
+        delegate.getWebBeansContext().getBeanManagerImpl().addDecorator(decorator);
     }
 
     public static <T> void configureXMLDecoratorClass(AbstractInjectionTargetBean<T> delegate, XMLInjectionPointModel model)
     {
         logger.debug("Configuring XML decorator class : [{0}]", delegate.getReturnType());
         WebBeansXMLDecorator<T> decorator = new WebBeansXMLDecorator<T>(delegate, model);
-        WebBeansContext.getInstance().getBeanManagerImpl().addDecorator(decorator);
+        delegate.getWebBeansContext().getBeanManagerImpl().addDecorator(decorator);
     }
 
     public static void configureDecarotors(AbstractInjectionTargetBean<?> component)
@@ -97,7 +97,7 @@ public final class WebBeansDecoratorConf
         Annotation[] anns = new Annotation[qualifiers.size()];
         anns = qualifiers.toArray(anns);
 
-        List<Decorator<?>> decoratorList = WebBeansContext.getInstance().getBeanManagerImpl().resolveDecorators(component.getTypes(), anns);
+        List<Decorator<?>> decoratorList = component.getWebBeansContext().getBeanManagerImpl().resolveDecorators(component.getTypes(), anns);
         
         if(decoratorList != null && !decoratorList.isEmpty())
         {
@@ -147,7 +147,7 @@ public final class WebBeansDecoratorConf
         List<Object> decoratorStack = new ArrayList<Object>();
         List<Decorator<?>> decoratorList = component.getDecoratorStack();        
         Iterator<Decorator<?>> itList = decoratorList.iterator();
-        BeanManager manager = WebBeansContext.getInstance().getBeanManagerImpl();
+        BeanManager manager = component.getWebBeansContext().getBeanManagerImpl();
         while (itList.hasNext())
         {
             Object decoratorInstance = null;

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/event/NotificationManager.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/event/NotificationManager.java?rev=1058749&r1=1058748&r2=1058749&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/event/NotificationManager.java (original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/event/NotificationManager.java Thu Jan 13 20:57:13 2011
@@ -548,7 +548,7 @@ public final class NotificationManager
         
         //Looking for qualifiers
         Annotation[] observerQualifiers =
-            WebBeansContext.getInstance().getAnnotationManager().getAnnotatedMethodFirstParameterQualifierWithGivenAnnotation(
+            bean.getWebBeansContext().getAnnotationManager().getAnnotatedMethodFirstParameterQualifierWithGivenAnnotation(
                 annotatedMethod, Observes.class);
         
         //Getting observer event type

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/event/ObserverMethodImpl.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/event/ObserverMethodImpl.java?rev=1058749&r1=1058748&r2=1058749&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/event/ObserverMethodImpl.java (original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/event/ObserverMethodImpl.java Thu Jan 13 20:57:13 2011
@@ -229,7 +229,7 @@ public class ObserverMethodImpl<T> imple
             }
             else
             {
-                BeanManagerImpl manager = WebBeansContext.getInstance().getBeanManagerImpl();
+                BeanManagerImpl manager = bean.getWebBeansContext().getBeanManagerImpl();
                 specializedComponent = (AbstractOwbBean<Object>)WebBeansUtil.getMostSpecializedBean(manager, baseComponent);        
                 Context context = null;
                 try
@@ -316,7 +316,7 @@ public class ObserverMethodImpl<T> imple
     @SuppressWarnings("unchecked")
     protected List<ObserverParams> getMethodArguments(Object event)
     {
-        WebBeansContext webBeansContext = WebBeansContext.getInstance();
+        WebBeansContext webBeansContext = bean.getWebBeansContext();
         AnnotatedElementFactory annotatedElementFactory = webBeansContext.getAnnotatedElementFactory();
         AnnotationManager annotationManager = webBeansContext.getAnnotationManager();
 
@@ -407,7 +407,7 @@ public class ObserverMethodImpl<T> imple
      */
     protected List<ObserverParams> getAnnotatedMethodArguments(Object event)
     {
-        final WebBeansContext webBeansContext = WebBeansContext.getInstance();
+        final WebBeansContext webBeansContext = bean.getWebBeansContext();
         final AnnotationManager annotationManager = webBeansContext.getAnnotationManager();
         final BeanManagerImpl manager = webBeansContext.getBeanManagerImpl();
         List<ObserverParams> list = new ArrayList<ObserverParams>();

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/inject/AbstractInjectable.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/inject/AbstractInjectable.java?rev=1058749&r1=1058748&r2=1058749&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/inject/AbstractInjectable.java (original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/inject/AbstractInjectable.java Thu Jan 13 20:57:13 2011
@@ -36,7 +36,6 @@ import org.apache.webbeans.component.Eve
 import org.apache.webbeans.component.InjectionPointBean;
 import org.apache.webbeans.component.InstanceBean;
 import org.apache.webbeans.component.OwbBean;
-import org.apache.webbeans.config.WebBeansContext;
 import org.apache.webbeans.container.InjectionResolver;
 import org.apache.webbeans.context.creational.CreationalContextImpl;
 import org.apache.webbeans.context.creational.DependentCreationalContext;
@@ -131,7 +130,7 @@ public abstract class AbstractInjectable
         }        
         
         //Gets injectable reference for injected bean
-        injected = WebBeansContext.getInstance().getBeanManagerImpl().getInjectableReference(injectionPoint, this.injectionOwnerCreationalContext);
+        injected = injectionOwnerBean.getWebBeansContext().getBeanManagerImpl().getInjectableReference(injectionPoint, this.injectionOwnerCreationalContext);
         
         if(dependentProducer)
         {

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/inject/InjectableMethods.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/inject/InjectableMethods.java?rev=1058749&r1=1058748&r2=1058749&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/inject/InjectableMethods.java (original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/inject/InjectableMethods.java Thu Jan 13 20:57:13 2011
@@ -35,7 +35,6 @@ import javax.enterprise.inject.spi.Injec
 import org.apache.webbeans.annotation.DefaultLiteral;
 import org.apache.webbeans.component.OwbBean;
 import org.apache.webbeans.component.ProducerMethodBean;
-import org.apache.webbeans.config.WebBeansContext;
 import org.apache.webbeans.container.InjectionResolver;
 import org.apache.webbeans.context.creational.CreationalContextImpl;
 import org.apache.webbeans.exception.WebBeansException;
@@ -94,7 +93,7 @@ public class InjectableMethods<T> extend
                     {
                         if(parameter.getBaseType().equals(InjectionPoint.class))
                         {
-                            BeanManager manager = WebBeansContext.getInstance().getBeanManagerImpl();
+                            BeanManager manager = injectionOwnerBean.getWebBeansContext().getBeanManagerImpl();
                             Bean<?> injectionPointBean = manager.getBeans(InjectionPoint.class, new DefaultLiteral()).iterator().next();
                             Object reference = manager.getReference(injectionPointBean, InjectionPoint.class, manager.createCreationalContext(injectionPointBean));
                             

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/inject/impl/InjectionPointFactory.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/inject/impl/InjectionPointFactory.java?rev=1058749&r1=1058748&r2=1058749&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/inject/impl/InjectionPointFactory.java (original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/inject/impl/InjectionPointFactory.java Thu Jan 13 20:57:13 2011
@@ -45,6 +45,7 @@ import org.apache.webbeans.annotation.Na
 import org.apache.webbeans.config.WebBeansContext;
 import org.apache.webbeans.inject.xml.XMLInjectionModelType;
 import org.apache.webbeans.inject.xml.XMLInjectionPointModel;
+import org.apache.webbeans.portable.AnnotatedElementFactory;
 import org.apache.webbeans.util.AnnotationUtil;
 import org.apache.webbeans.util.Asserts;
 
@@ -103,9 +104,10 @@ public class InjectionPointFactory
         
         if(!checkFieldApplicable(annots))
         {
-            AnnotatedType<?> annotated = WebBeansContext.getInstance().getAnnotatedElementFactory().newAnnotatedType(member.getDeclaringClass());
-            return getGenericInjectionPoint(owner, annots, member.getGenericType(), member,
-                    WebBeansContext.getInstance().getAnnotatedElementFactory().newAnnotatedField(member, annotated));
+            AnnotatedElementFactory annotatedElementFactory = WebBeansContext.getInstance().getAnnotatedElementFactory();
+            
+            AnnotatedType<?> annotated = annotatedElementFactory.newAnnotatedType(member.getDeclaringClass());
+            return getGenericInjectionPoint(owner, annots, member.getGenericType(), member, annotatedElementFactory.newAnnotatedField(member, annotated));
         }        
         else
         {
@@ -209,8 +211,9 @@ public class InjectionPointFactory
 
         List<InjectionPoint> lists = new ArrayList<InjectionPoint>();
 
-        AnnotatedType<?> annotated = WebBeansContext.getInstance().getAnnotatedElementFactory().newAnnotatedType(member.getDeclaringClass());
-        AnnotatedMethod method = WebBeansContext.getInstance().getAnnotatedElementFactory().newAnnotatedMethod(member, annotated);
+        AnnotatedElementFactory annotatedElementFactory = WebBeansContext.getInstance().getAnnotatedElementFactory();
+        AnnotatedType<?> annotated = annotatedElementFactory.newAnnotatedType(member.getDeclaringClass());
+        AnnotatedMethod method = annotatedElementFactory.newAnnotatedMethod(member, annotated);
         List<AnnotatedParameter<?>> parameters = method.getParameters();
         
         InjectionPoint point = null;
@@ -314,8 +317,9 @@ public class InjectionPointFactory
 
         List<InjectionPoint> lists = new ArrayList<InjectionPoint>();
 
-        AnnotatedType<Object> annotated = (AnnotatedType<Object>) WebBeansContext.getInstance().getAnnotatedElementFactory().newAnnotatedType(member.getDeclaringClass());
-        AnnotatedConstructor constructor = WebBeansContext.getInstance().getAnnotatedElementFactory().newAnnotatedConstructor((Constructor<Object>)member,annotated);
+        WebBeansContext webBeansContext = WebBeansContext.getInstance();
+        AnnotatedType<Object> annotated = (AnnotatedType<Object>) webBeansContext.getAnnotatedElementFactory().newAnnotatedType(member.getDeclaringClass());
+        AnnotatedConstructor constructor = webBeansContext.getAnnotatedElementFactory().newAnnotatedConstructor((Constructor<Object>)member,annotated);
         List<AnnotatedParameter<?>> parameters = constructor.getParameters();
         
         InjectionPoint point = null;

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/inject/impl/InjectionPointImpl.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/inject/impl/InjectionPointImpl.java?rev=1058749&r1=1058748&r2=1058749&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/inject/impl/InjectionPointImpl.java (original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/inject/impl/InjectionPointImpl.java Thu Jan 13 20:57:13 2011
@@ -208,7 +208,8 @@ class InjectionPointImpl implements Inje
 
         Class<?> beanClass = (Class<?>)in.readObject();
         Set<Annotation> anns = new HashSet<Annotation>();
-        AnnotatedElementFactory annotatedElementFactory = WebBeansContext.getInstance().getAnnotatedElementFactory();
+        WebBeansContext webBeansContext = WebBeansContext.getInstance();
+        AnnotatedElementFactory annotatedElementFactory = webBeansContext.getAnnotatedElementFactory();
 
         while(!in.readObject().equals(new Character('~')))   // read throw-away '-' or '~' terminal delimiter.
         {
@@ -217,7 +218,7 @@ class InjectionPointImpl implements Inje
         }
         
         //process annotations
-        this.ownerBean = WebBeansContext.getInstance().getBeanManagerImpl().getBeans(beanClass, anns.toArray(new Annotation[anns.size()])).iterator().next();
+        this.ownerBean = webBeansContext.getBeanManagerImpl().getBeans(beanClass, anns.toArray(new Annotation[anns.size()])).iterator().next();
         this.qualifierAnnotations = anns;
         
         // determine type of injection point member (0=field, 1=method, 2=constructor) and read...

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/intercept/InvocationContextImpl.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/intercept/InvocationContextImpl.java?rev=1058749&r1=1058748&r2=1058749&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/intercept/InvocationContextImpl.java (original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/intercept/InvocationContextImpl.java Thu Jan 13 20:57:13 2011
@@ -31,7 +31,6 @@ import javax.interceptor.InvocationConte
 
 import org.apache.webbeans.component.EnterpriseBeanMarker;
 import org.apache.webbeans.component.OwbBean;
-import org.apache.webbeans.config.WebBeansContext;
 import org.apache.webbeans.context.creational.CreationalContextImpl;
 import org.apache.webbeans.util.ClassUtil;
 import org.apache.webbeans.util.SecurityUtil;
@@ -125,7 +124,7 @@ public class InvocationContextImpl imple
     @SuppressWarnings("unchecked")
     private void configureTarget(OwbBean<?> bean)
     {
-        Context webbeansContext = WebBeansContext.getInstance().getBeanManagerImpl().getContext(bean.getScope());
+        Context webbeansContext = bean.getWebBeansContext().getBeanManagerImpl().getContext(bean.getScope());
         
         this.target = webbeansContext.get((Contextual<Object>)bean, (CreationalContext<Object>)this.creationalContext);        
         

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/intercept/NormalScopedBeanInterceptorHandler.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/intercept/NormalScopedBeanInterceptorHandler.java?rev=1058749&r1=1058748&r2=1058749&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/intercept/NormalScopedBeanInterceptorHandler.java (original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/intercept/NormalScopedBeanInterceptorHandler.java Thu Jan 13 20:57:13 2011
@@ -28,8 +28,8 @@ import javax.enterprise.context.spi.Crea
 import javax.enterprise.inject.UnproxyableResolutionException;
 
 import org.apache.webbeans.component.OwbBean;
-import org.apache.webbeans.config.WebBeansContext;
 import org.apache.webbeans.context.AbstractContext;
+import org.apache.webbeans.context.creational.CreationalContextFactory;
 import org.apache.webbeans.context.creational.CreationalContextImpl;
 
 
@@ -148,6 +148,7 @@ public class NormalScopedBeanInterceptor
         OwbBean<Object> contextual = (OwbBean<Object>)this.bean;
         //Context of the bean
         Context webbeansContext = getBeanManager().getContext(bean.getScope());
+        CreationalContextFactory contextFactory = bean.getWebBeansContext().getCreationalContextFactory();
         if (webbeansContext instanceof AbstractContext)
         {
             AbstractContext owbContext = (AbstractContext)webbeansContext;
@@ -160,7 +161,7 @@ public class NormalScopedBeanInterceptor
             //contained in @ApplicationScopedBean
             if(creationalContext == null)
             {
-                creationalContext = WebBeansContext.getInstance().getCreationalContextFactory().getCreationalContext(contextual);
+                creationalContext = contextFactory.getCreationalContext(contextual);
                 owbContext.initContextualBag((OwbBean<Object>)this.bean, creationalContext);
             }
         }
@@ -172,7 +173,7 @@ public class NormalScopedBeanInterceptor
         // preceding call to Context.get(Contextual) (without any CreationalContext)
         if(creationalContext == null)
         {
-            creationalContext = WebBeansContext.getInstance().getCreationalContextFactory().getCreationalContext(contextual);
+            creationalContext = contextFactory.getCreationalContext(contextual);
         }
 
         return creationalContext;



Mime
View raw message