openwebbeans-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dblev...@apache.org
Subject svn commit: r1042099 [2/4] - in /openwebbeans/trunk: samples/ejb-sample/src/main/java/org/apache/webbeans/sample/bean/ webbeans-ejb/src/main/java/org/apache/webbeans/ejb/common/component/ webbeans-ejb/src/main/java/org/apache/webbeans/ejb/common/interc...
Date Sat, 04 Dec 2010 04:27:24 GMT
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=1042099&r1=1042098&r2=1042099&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 Sat Dec  4 04:27:19 2010
@@ -28,7 +28,7 @@ import javax.enterprise.context.spi.Crea
 import javax.enterprise.inject.spi.Decorator;
 import javax.enterprise.inject.spi.Interceptor;
 
-import org.apache.webbeans.container.BeanManagerImpl;
+import org.apache.webbeans.config.WebBeansContext;
 import org.apache.webbeans.context.creational.DependentCreationalContext.DependentType;
 import org.apache.webbeans.util.Asserts;
 import org.apache.webbeans.util.WebBeansUtil;
@@ -288,11 +288,12 @@ public class CreationalContextImpl<T> im
         List<DependentCreationalContext<?>> values = this.dependentObjects.get(ownerInstance);
         if(values != null)
         {
+            final CreationalContextFactory contextFactory = WebBeansContext.getInstance().getCreationalContextFactory();
             Iterator<?> iterator = values.iterator();        
             while(iterator.hasNext())
             {
                 DependentCreationalContext<T> dependent = (DependentCreationalContext<T>)iterator.next();
-                dependent.getContextual().destroy((T)dependent.getInstance(), CreationalContextFactory.getInstance().getCreationalContext(dependent.getContextual()));
+                dependent.getContextual().destroy((T)dependent.getInstance(), contextFactory.getCreationalContext(dependent.getContextual()));
             }
 
             this.dependentObjects.remove(ownerInstance);                        
@@ -327,7 +328,8 @@ public class CreationalContextImpl<T> im
                     while(iterator.hasNext())
                     {
                         DependentCreationalContext<T> dependent = (DependentCreationalContext<T>)iterator.next();
-                        dependent.getContextual().destroy((T)dependent.getInstance(), CreationalContextFactory.getInstance().getCreationalContext(dependent.getContextual()));
+                        final CreationalContextFactory contextFactory = WebBeansContext.getInstance().getCreationalContextFactory();
+                        dependent.getContextual().destroy((T)dependent.getInstance(), contextFactory.getCreationalContext(dependent.getContextual()));
                     }                        
                 }                
             }
@@ -421,7 +423,7 @@ public class CreationalContextImpl<T> im
         String id = (String) s.readObject();
         if (id != null)
         {
-            contextual = (Contextual<T>) BeanManagerImpl.getManager().getPassivationCapableBean(id);
+            contextual = (Contextual<T>) WebBeansContext.getInstance().getBeanManagerImpl().getPassivationCapableBean(id);
         }
                 
         ejbInterceptors = (ConcurrentMap<Object, List<EjbInterceptorContext>>) s.readObject();

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/context/creational/DependentCreationalContext.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/context/creational/DependentCreationalContext.java?rev=1042099&r1=1042098&r2=1042099&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/context/creational/DependentCreationalContext.java (original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/context/creational/DependentCreationalContext.java Sat Dec  4 04:27:19 2010
@@ -26,7 +26,7 @@ import java.io.Serializable;
 
 import javax.enterprise.context.spi.Contextual;
 
-import org.apache.webbeans.container.BeanManagerImpl;
+import org.apache.webbeans.config.WebBeansContext;
 import org.apache.webbeans.util.WebBeansUtil;
 
 public class DependentCreationalContext<S> implements Serializable
@@ -142,7 +142,7 @@ public class DependentCreationalContext<
         String id = (String) s.readObject();
         if (id != null)
         {
-            contextual = (Contextual<S>) BeanManagerImpl.getManager().getPassivationCapableBean(id);
+            contextual = (Contextual<S>) WebBeansContext.getInstance().getBeanManagerImpl().getPassivationCapableBean(id);
         }
     }
 

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=1042099&r1=1042098&r2=1042099&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 Sat Dec  4 04:27:19 2010
@@ -26,7 +26,7 @@ import javax.enterprise.context.Conversa
 import javax.enterprise.context.ConversationScoped;
 
 import org.apache.webbeans.config.OWBLogConst;
-import org.apache.webbeans.container.BeanManagerImpl;
+import org.apache.webbeans.config.WebBeansContext;
 import org.apache.webbeans.context.ConversationContext;
 import org.apache.webbeans.logger.WebBeansLogger;
 import org.apache.webbeans.util.Asserts;
@@ -99,13 +99,13 @@ public class ConversationImpl implements
             this.id = Integer.toString(conversationIdGenerator.incrementAndGet());
             
             //Conversation manager
-            ConversationManager manager = ConversationManager.getInstance();            
+            ConversationManager manager = WebBeansContext.getInstance().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) BeanManagerImpl.getManager().getContext(ConversationScoped.class));
+                manager.addConversationContext(this, (ConversationContext) WebBeansContext.getInstance().getBeanManagerImpl().getContext(ConversationScoped.class));
                 
             }
             catch(Exception e)
@@ -129,7 +129,9 @@ public class ConversationImpl implements
     public void begin(String id)
     {   
         //Look at other conversation, that may collate with this is
-        if(ConversationManager.getInstance().isConversationExistWithGivenId(id))
+        final WebBeansContext webBeansContext = WebBeansContext.getInstance();
+        final ConversationManager conversationManager = webBeansContext.getConversationManager();
+        if(conversationManager.isConversationExistWithGivenId(id))
         {
             throw new IllegalArgumentException("Conversation with id=" + id + " is already exist!");
         }
@@ -140,7 +142,7 @@ public class ConversationImpl implements
             this.isTransient = false;
             this.id = id;
             this.updateTimeOut();
-            ConversationManager.getInstance().addConversationContext(this, (ConversationContext) BeanManagerImpl.getManager().getContext(ConversationScoped.class));            
+            conversationManager.addConversationContext(this, (ConversationContext) webBeansContext.getBeanManagerImpl().getContext(ConversationScoped.class));
         }
     }
     
@@ -153,8 +155,8 @@ public class ConversationImpl implements
         if(!this.isTransient)
         {
             this.isTransient = true;
-            
-            ConversationManager.getInstance().removeConversation(this);            
+
+            WebBeansContext.getInstance().getConversationManager().removeConversation(this);
         }
         else
         {

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/conversation/ConversationManager.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/conversation/ConversationManager.java?rev=1042099&r1=1042098&r2=1042099&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/conversation/ConversationManager.java (original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/conversation/ConversationManager.java Sat Dec  4 04:27:19 2010
@@ -30,8 +30,8 @@ import javax.enterprise.inject.spi.Bean;
 import javax.enterprise.inject.spi.BeanManager;
 
 import org.apache.webbeans.annotation.DefaultLiteral;
+import org.apache.webbeans.config.WebBeansContext;
 import org.apache.webbeans.config.WebBeansFinder;
-import org.apache.webbeans.container.BeanManagerImpl;
 import org.apache.webbeans.context.ConversationContext;
 import org.apache.webbeans.util.Asserts;
 
@@ -59,10 +59,11 @@ public class ConversationManager
      * Gets conversation manager instance.
      * @return conversation manager
      */
+    @Deprecated
     public static ConversationManager getInstance()
     {
         ConversationManager manager = (ConversationManager) WebBeansFinder.getSingletonInstance(ConversationManager.class.getName());
-        
+
         return manager;
     }
 
@@ -209,7 +210,7 @@ public class ConversationManager
     @SuppressWarnings("unchecked")
     public Conversation getConversationBeanReference()
     {
-        BeanManager beanManager = BeanManagerImpl.getManager();
+        BeanManager beanManager = WebBeansContext.getInstance().getBeanManagerImpl();
         Bean<Conversation> bean = (Bean<Conversation>)beanManager.getBeans(Conversation.class, new DefaultLiteral()).iterator().next();
         Conversation conversation =(Conversation) beanManager.getReference(bean, Conversation.class, beanManager.createCreationalContext(bean));
 

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=1042099&r1=1042098&r2=1042099&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 Sat Dec  4 04:27:19 2010
@@ -62,6 +62,7 @@ public class DefaultSingletonService imp
         synchronized (singletonMap)
         {
             WebBeansContext managerMap = singletonMap.get(classLoader);
+//            util.Track.get(singletonName);
 
             if (managerMap == null)
             {

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/corespi/ServiceLoader.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/corespi/ServiceLoader.java?rev=1042099&r1=1042098&r2=1042099&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/corespi/ServiceLoader.java (original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/corespi/ServiceLoader.java Sat Dec  4 04:27:19 2010
@@ -21,10 +21,9 @@ package org.apache.webbeans.corespi;
 import java.util.List;
 
 import org.apache.webbeans.config.OWBLogConst;
-import org.apache.webbeans.config.OpenWebBeansConfiguration;
+import org.apache.webbeans.config.WebBeansContext;
 import org.apache.webbeans.config.WebBeansFinder;
 import org.apache.webbeans.logger.WebBeansLogger;
-import org.apache.webbeans.plugins.PluginLoader;
 import org.apache.webbeans.spi.plugins.OpenWebBeansPlugin;
 
 /**
@@ -51,12 +50,12 @@ public class ServiceLoader
     @SuppressWarnings("unchecked")
     public static <T> T getService(Class<T> serviceInterface)
     {
-        String implName = OpenWebBeansConfiguration.getInstance().getProperty(serviceInterface.getName());
+        String implName = WebBeansContext.getInstance().getOpenWebBeansConfiguration().getProperty(serviceInterface.getName());
         
         if (implName == null)
         {
             //Look for plugins
-            List<OpenWebBeansPlugin> plugins = PluginLoader.getInstance().getPlugins();
+            List<OpenWebBeansPlugin> plugins = WebBeansContext.getInstance().getPluginLoader().getPlugins();
             if(plugins != null && plugins.size() > 0)
             {
                 for(OpenWebBeansPlugin plugin : plugins)
@@ -87,11 +86,11 @@ public class ServiceLoader
     @SuppressWarnings("unchecked")
     public static <T> T getService(Class<T> serviceInterface, ClassLoader cl)
     {
-        String implName = OpenWebBeansConfiguration.getInstance().getProperty(serviceInterface.getName());
+        String implName = WebBeansContext.getInstance().getOpenWebBeansConfiguration().getProperty(serviceInterface.getName());
         if (implName == null)
         {
             //Look for plugins
-            List<OpenWebBeansPlugin> plugins = PluginLoader.getInstance().getPlugins();
+            List<OpenWebBeansPlugin> plugins = WebBeansContext.getInstance().getPluginLoader().getPlugins();
             if(plugins != null && plugins.size() > 0)
             {
                 for(OpenWebBeansPlugin plugin : plugins)

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/corespi/scanner/AbstractMetaDataDiscovery.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/corespi/scanner/AbstractMetaDataDiscovery.java?rev=1042099&r1=1042098&r2=1042099&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/corespi/scanner/AbstractMetaDataDiscovery.java (original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/corespi/scanner/AbstractMetaDataDiscovery.java Sat Dec  4 04:27:19 2010
@@ -26,6 +26,7 @@ import java.util.Map;
 import java.util.Set;
 
 import org.apache.webbeans.config.OpenWebBeansConfiguration;
+import org.apache.webbeans.config.WebBeansContext;
 import org.apache.webbeans.corespi.se.BeansXmlAnnotationDB;
 import org.apache.webbeans.corespi.se.DefaultBDABeansXmlScanner;
 import org.apache.webbeans.exception.WebBeansDeploymentException;
@@ -93,7 +94,7 @@ public abstract class AbstractMetaDataDi
         // set per BDA beans.xml flag here because setting it in constructor
         // occurs before
         // properties are loaded.
-        String usage = OpenWebBeansConfiguration.getInstance().getProperty(OpenWebBeansConfiguration.USE_BDA_BEANSXML_SCANNER);
+        String usage = WebBeansContext.getInstance().getOpenWebBeansConfiguration().getProperty(OpenWebBeansConfiguration.USE_BDA_BEANSXML_SCANNER);
         this.isBDAScannerEnabled = Boolean.parseBoolean(usage);
         if (isBDAScannerEnabled)
         {

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/decorator/DecoratorComparator.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/decorator/DecoratorComparator.java?rev=1042099&r1=1042098&r2=1042099&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/decorator/DecoratorComparator.java (original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/decorator/DecoratorComparator.java Sat Dec  4 04:27:19 2010
@@ -23,6 +23,8 @@ import java.util.Comparator;
 
 import javax.enterprise.inject.spi.Decorator;
 
+import org.apache.webbeans.config.WebBeansContext;
+
 public class DecoratorComparator<T> implements Comparator<Decorator<T>>, Serializable
 {
 
@@ -43,7 +45,7 @@ public class DecoratorComparator<T> impl
             Class<?> o1Clazz = src.getClazz();
             Class<?> o2Clazz = target.getClazz();
 
-            return DecoratorsManager.getInstance().compare(o1Clazz, o2Clazz);
+            return WebBeansContext.getInstance().getDecoratorsManager().compare(o1Clazz, o2Clazz);
 
         }
     }

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=1042099&r1=1042098&r2=1042099&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 Sat Dec  4 04:27:19 2010
@@ -32,7 +32,7 @@ import javax.enterprise.inject.spi.Decor
 
 import org.apache.webbeans.component.AbstractInjectionTargetBean;
 import org.apache.webbeans.config.OWBLogConst;
-import org.apache.webbeans.container.BeanManagerImpl;
+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 +101,7 @@ public final class DecoratorUtil
 
         if(decoratorList == null)
         {
-            decoratorList = BeanManagerImpl.getManager().resolveDecorators(bean.getTypes(), anns);   
+            decoratorList = WebBeansContext.getInstance().getBeanManagerImpl().resolveDecorators(bean.getTypes(), anns);
         }
         if (!decoratorList.isEmpty())
         {

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/decorator/DecoratorsManager.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/decorator/DecoratorsManager.java?rev=1042099&r1=1042098&r2=1042099&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/decorator/DecoratorsManager.java (original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/decorator/DecoratorsManager.java Sat Dec  4 04:27:19 2010
@@ -40,6 +40,7 @@ public class DecoratorsManager
         manager = webBeansContext.getBeanManagerImpl();
     }
 
+    @Deprecated
     public static DecoratorsManager getInstance()
     {
         return WebBeansContext.getInstance().getDecoratorsManager();

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/decorator/DelegateHandler.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/decorator/DelegateHandler.java?rev=1042099&r1=1042098&r2=1042099&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/decorator/DelegateHandler.java (original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/decorator/DelegateHandler.java Sat Dec  4 04:27:19 2010
@@ -32,7 +32,7 @@ import javax.interceptor.InvocationConte
 import org.apache.webbeans.component.EnterpriseBeanMarker;
 import org.apache.webbeans.component.OwbBean;
 import org.apache.webbeans.config.OWBLogConst;
-import org.apache.webbeans.container.BeanManagerImpl;
+import org.apache.webbeans.config.WebBeansContext;
 import org.apache.webbeans.exception.WebBeansException;
 import org.apache.webbeans.logger.WebBeansLogger;
 import org.apache.webbeans.util.SecurityUtil;
@@ -230,7 +230,7 @@ public class DelegateHandler implements 
         {
             return;
         }
-        bean = (OwbBean<?>) BeanManagerImpl.getManager().getPassivationCapableBean(id);
+        bean = (OwbBean<?>) WebBeansContext.getInstance().getBeanManagerImpl().getPassivationCapableBean(id);
         actualBean = in.readObject();
         decorators = (List<Object>) in.readObject();
     }    

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/decorator/WebBeansDecorator.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/decorator/WebBeansDecorator.java?rev=1042099&r1=1042098&r2=1042099&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/decorator/WebBeansDecorator.java (original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/decorator/WebBeansDecorator.java Sat Dec  4 04:27:19 2010
@@ -23,12 +23,11 @@ import org.apache.webbeans.component.Abs
 import org.apache.webbeans.component.ManagedBean;
 import org.apache.webbeans.component.WebBeansType;
 import org.apache.webbeans.config.OWBLogConst;
-import org.apache.webbeans.container.BeanManagerImpl;
+import org.apache.webbeans.config.WebBeansContext;
 import org.apache.webbeans.exception.WebBeansConfigurationException;
 import org.apache.webbeans.exception.WebBeansException;
 import org.apache.webbeans.inject.InjectableField;
 import org.apache.webbeans.inject.InjectableMethods;
-import org.apache.webbeans.proxy.JavassistProxyFactory;
 import org.apache.webbeans.util.AnnotationUtil;
 import org.apache.webbeans.util.ClassUtil;
 import org.apache.webbeans.util.SecurityUtil;
@@ -341,10 +340,10 @@ public class WebBeansDecorator<T> extend
         {
             return this.customDecorator.create(creationalContext);
         }
-        
-        Context context = BeanManagerImpl.getManager().getContext(getScope());
+
+        Context context = WebBeansContext.getInstance().getBeanManagerImpl().getContext(getScope());
         Object actualInstance = context.get((Bean<Object>)this.wrappedBean, (CreationalContext<Object>)creationalContext);
-        T proxy = (T)JavassistProxyFactory.getInstance().createDependentScopedBeanProxy(this.wrappedBean, actualInstance, creationalContext);
+        T proxy = (T) WebBeansContext.getInstance().getJavassistProxyFactory().createDependentScopedBeanProxy(this.wrappedBean, actualInstance, creationalContext);
         
         return proxy;        
     }

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=1042099&r1=1042098&r2=1042099&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 Sat Dec  4 04:27:19 2010
@@ -36,7 +36,7 @@ import org.apache.webbeans.annotation.De
 import org.apache.webbeans.component.AbstractInjectionTargetBean;
 import org.apache.webbeans.component.InjectionTargetBean;
 import org.apache.webbeans.config.OWBLogConst;
-import org.apache.webbeans.container.BeanManagerImpl;
+import org.apache.webbeans.config.WebBeansContext;
 import org.apache.webbeans.context.creational.CreationalContextImpl;
 import org.apache.webbeans.corespi.ServiceLoader;
 import org.apache.webbeans.decorator.xml.WebBeansXMLDecorator;
@@ -83,14 +83,14 @@ public final class WebBeansDecoratorConf
         
         logger.debug("Configuring decorator class : [{0}]", delegate.getReturnType());
         WebBeansDecorator<T> decorator = new WebBeansDecorator<T>(delegate);
-        BeanManagerImpl.getManager().addDecorator(decorator);
+        WebBeansContext.getInstance().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);
-        BeanManagerImpl.getManager().addDecorator(decorator);
+        WebBeansContext.getInstance().getBeanManagerImpl().addDecorator(decorator);
     }
 
     public static void configureDecarotors(AbstractInjectionTargetBean<?> component)
@@ -99,7 +99,7 @@ public final class WebBeansDecoratorConf
         Annotation[] anns = new Annotation[qualifiers.size()];
         anns = qualifiers.toArray(anns);
 
-        List<Decorator<?>> decoratorList = BeanManagerImpl.getManager().resolveDecorators(component.getTypes(), anns);
+        List<Decorator<?>> decoratorList = WebBeansContext.getInstance().getBeanManagerImpl().resolveDecorators(component.getTypes(), anns);
         
         if(decoratorList != null && !decoratorList.isEmpty())
         {
@@ -149,7 +149,7 @@ public final class WebBeansDecoratorConf
         List<Object> decoratorStack = new ArrayList<Object>();
         List<Decorator<?>> decoratorList = component.getDecoratorStack();        
         Iterator<Decorator<?>> itList = decoratorList.iterator();
-        BeanManager manager = BeanManagerImpl.getManager();
+        BeanManager manager = WebBeansContext.getInstance().getBeanManagerImpl();
         while (itList.hasNext())
         {
             Object decoratorInstance = null;
@@ -183,7 +183,7 @@ public final class WebBeansDecoratorConf
 
     private static Set<Decorator<?>> getWebBeansDecorators()
     {
-        return Collections.unmodifiableSet(BeanManagerImpl.getManager().getDecorators());
+        return Collections.unmodifiableSet(WebBeansContext.getInstance().getBeanManagerImpl().getDecorators());
     }
 
     public static Set<Decorator<?>> findDeployedWebBeansDecorator(Set<Type> apiType, Annotation... anns)

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/deployment/StereoTypeManager.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/deployment/StereoTypeManager.java?rev=1042099&r1=1042098&r2=1042099&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/deployment/StereoTypeManager.java (original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/deployment/StereoTypeManager.java Sat Dec  4 04:27:19 2010
@@ -50,6 +50,7 @@ public class StereoTypeManager
      * Returns manager for this application.
      * @return singleton instance.
      */
+    @Deprecated
     public static StereoTypeManager getInstance()
     {
         return WebBeansContext.getInstance().getStereoTypeManager();

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/el/ELContextStore.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/el/ELContextStore.java?rev=1042099&r1=1042098&r2=1042099&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/el/ELContextStore.java (original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/el/ELContextStore.java Sat Dec  4 04:27:19 2010
@@ -18,6 +18,7 @@
  */
 package org.apache.webbeans.el;
 
+import org.apache.webbeans.config.WebBeansContext;
 import org.apache.webbeans.container.BeanManagerImpl;
 
 import java.util.HashMap;
@@ -185,7 +186,7 @@ public class ELContextStore
     {
         if (beanManager == null)
         {
-            beanManager = BeanManagerImpl.getManager();
+            beanManager = WebBeansContext.getInstance().getBeanManagerImpl();
         }
         return beanManager;
     }

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/event/EventImpl.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/event/EventImpl.java?rev=1042099&r1=1042098&r2=1042099&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/event/EventImpl.java (original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/event/EventImpl.java Sat Dec  4 04:27:19 2010
@@ -30,6 +30,7 @@ import java.util.Set;
 import javax.enterprise.event.Event;
 import javax.enterprise.util.TypeLiteral;
 
+import org.apache.webbeans.config.WebBeansContext;
 import org.apache.webbeans.container.BeanManagerImpl;
 import org.apache.webbeans.util.AnnotationUtil;
 import org.apache.webbeans.util.ClassUtil;
@@ -65,7 +66,7 @@ public class EventImpl<T> implements Eve
     {
         this.injectedBindings = injectedBindings;
         this.eventType = eventType;
-        this.manager = BeanManagerImpl.getManager();
+        this.manager = WebBeansContext.getInstance().getBeanManagerImpl();
     }
 
     /**
@@ -164,7 +165,7 @@ public class EventImpl<T> implements Eve
         final ObjectInputStream inputStream = new OwbCustomObjectInputStream(in, WebBeansUtil.getCurrentClassLoader());
         this.eventType = (Type)inputStream.readObject();
         this.injectedBindings = (Annotation[])inputStream.readObject();
-        
-        this.manager = BeanManagerImpl.getManager();
+
+        this.manager = WebBeansContext.getInstance().getBeanManagerImpl();
     }
 }
\ No newline at end of file

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=1042099&r1=1042098&r2=1042099&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 Sat Dec  4 04:27:19 2010
@@ -22,6 +22,7 @@ package org.apache.webbeans.event;
 import org.apache.webbeans.annotation.AnyLiteral;
 import org.apache.webbeans.component.InjectionTargetBean;
 import org.apache.webbeans.config.OWBLogConst;
+import org.apache.webbeans.config.WebBeansContext;
 import org.apache.webbeans.container.BeanManagerImpl;
 import org.apache.webbeans.corespi.ServiceLoader;
 import org.apache.webbeans.exception.WebBeansException;
@@ -69,7 +70,7 @@ public final class NotificationManager
 
     public static NotificationManager getInstance()
     {
-        BeanManagerImpl manager = BeanManagerImpl.getManager();
+        BeanManagerImpl manager = WebBeansContext.getInstance().getBeanManagerImpl();
 
         return manager.getNotificationManager();
     }

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=1042099&r1=1042098&r2=1042099&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 Sat Dec  4 04:27:19 2010
@@ -47,6 +47,7 @@ import org.apache.webbeans.component.Abs
 import org.apache.webbeans.component.InjectionPointBean;
 import org.apache.webbeans.component.InjectionTargetBean;
 import org.apache.webbeans.config.OWBLogConst;
+import org.apache.webbeans.config.WebBeansContext;
 import org.apache.webbeans.container.BeanManagerImpl;
 import org.apache.webbeans.container.InjectionResolver;
 import org.apache.webbeans.exception.WebBeansException;
@@ -226,7 +227,7 @@ public class ObserverMethodImpl<T> imple
             }
             else
             {
-                BeanManagerImpl manager = BeanManagerImpl.getManager();
+                BeanManagerImpl manager = WebBeansContext.getInstance().getBeanManagerImpl();
                 specializedComponent = (AbstractOwbBean<Object>)WebBeansUtil.getMostSpecializedBean(manager, baseComponent);        
                 Context context = null;
                 try
@@ -313,7 +314,7 @@ public class ObserverMethodImpl<T> imple
     @SuppressWarnings("unchecked")
     protected List<ObserverParams> getMethodArguments(Object event)
     {
-        AnnotatedElementFactory annotatedElementFactory = AnnotatedElementFactory.getInstance();
+        AnnotatedElementFactory annotatedElementFactory = WebBeansContext.getInstance().getAnnotatedElementFactory();
 
         //Define annotated parameter
         AnnotatedType<T> annotatedType = (AnnotatedType<T>) annotatedElementFactory.newAnnotatedType(this.bean.getReturnType());
@@ -323,7 +324,7 @@ public class ObserverMethodImpl<T> imple
         Annotation[][] annots = this.observerMethod.getParameterAnnotations();
         List<ObserverParams> list = new ArrayList<ObserverParams>();
 
-        BeanManagerImpl manager = BeanManagerImpl.getManager();
+        BeanManagerImpl manager = WebBeansContext.getInstance().getBeanManagerImpl();
         ObserverParams param = null;
         if (types.length > 0)
         {
@@ -402,7 +403,7 @@ public class ObserverMethodImpl<T> imple
      */
     protected List<ObserverParams> getAnnotatedMethodArguments(Object event)
     {
-        BeanManagerImpl manager = BeanManagerImpl.getManager();
+        BeanManagerImpl manager = WebBeansContext.getInstance().getBeanManagerImpl();
         List<ObserverParams> list = new ArrayList<ObserverParams>();
         List<AnnotatedParameter<T>> parameters = this.annotatedMethod.getParameters();
         ObserverParams param = null;

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/event/xml/BeanObserverXMLImpl.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/event/xml/BeanObserverXMLImpl.java?rev=1042099&r1=1042098&r2=1042099&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/event/xml/BeanObserverXMLImpl.java (original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/event/xml/BeanObserverXMLImpl.java Sat Dec  4 04:27:19 2010
@@ -26,6 +26,7 @@ import java.util.List;
 import java.util.Set;
 
 import org.apache.webbeans.component.InjectionTargetBean;
+import org.apache.webbeans.config.WebBeansContext;
 import org.apache.webbeans.container.BeanManagerImpl;
 import org.apache.webbeans.container.InjectionResolver;
 import org.apache.webbeans.event.ObserverMethodImpl;
@@ -52,7 +53,7 @@ public class BeanObserverXMLImpl<T> exte
     protected List getMethodArguments(Object event)
     {
         List<Object> params = new ArrayList<Object>();
-        BeanManagerImpl manager = BeanManagerImpl.getManager();
+        BeanManagerImpl manager = WebBeansContext.getInstance().getBeanManagerImpl();
         for (XMLInjectionPointModel model : observersParameters)
         {
             Set<Annotation> setBindingTypes = model.getBindingTypes();

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=1042099&r1=1042098&r2=1042099&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 Sat Dec  4 04:27:19 2010
@@ -36,7 +36,7 @@ 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.container.BeanManagerImpl;
+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 +131,7 @@ public abstract class AbstractInjectable
         }        
         
         //Gets injectable reference for injected bean
-        injected = BeanManagerImpl.getManager().getInjectableReference(injectionPoint, this.injectionOwnerCreationalContext);
+        injected = WebBeansContext.getInstance().getBeanManagerImpl().getInjectableReference(injectionPoint, this.injectionOwnerCreationalContext);
         
         if(dependentProducer)
         {

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/inject/AlternativesManager.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/inject/AlternativesManager.java?rev=1042099&r1=1042098&r2=1042099&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/inject/AlternativesManager.java (original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/inject/AlternativesManager.java Sat Dec  4 04:27:19 2010
@@ -40,12 +40,13 @@ public class AlternativesManager
     {
         
     }
-    
+
+    @Deprecated
     public static AlternativesManager getInstance()
     {
         return WebBeansContext.getInstance().getAlternativesManager();
     }
-    
+
     @SuppressWarnings("unchecked")
     public void addStereoTypeAlternative(Class<?> alternative,String fileName,ScannerService scanner)
     {                

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=1042099&r1=1042098&r2=1042099&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 Sat Dec  4 04:27:19 2010
@@ -35,7 +35,7 @@ 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.container.BeanManagerImpl;
+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 +94,7 @@ public class InjectableMethods<T> extend
                     {
                         if(parameter.getBaseType().equals(InjectionPoint.class))
                         {
-                            BeanManager manager = BeanManagerImpl.getManager();
+                            BeanManager manager = WebBeansContext.getInstance().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/OWBInjector.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/inject/OWBInjector.java?rev=1042099&r1=1042098&r2=1042099&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/inject/OWBInjector.java (original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/inject/OWBInjector.java Sat Dec  4 04:27:19 2010
@@ -42,6 +42,7 @@ import org.apache.webbeans.component.Eve
 import org.apache.webbeans.component.InjectionPointBean;
 import org.apache.webbeans.component.InjectionTargetWrapper;
 import org.apache.webbeans.component.InstanceBean;
+import org.apache.webbeans.config.WebBeansContext;
 import org.apache.webbeans.container.BeanManagerImpl;
 import org.apache.webbeans.container.InjectionResolver;
 import org.apache.webbeans.context.creational.CreationalContextImpl;
@@ -100,7 +101,7 @@ public final class OWBInjector implement
     @SuppressWarnings("unchecked")
     public  OWBInjector inject(Object javaEeComponentInstance, CreationalContext<?> creationalContext) throws Exception
     {
-        BeanManagerImpl beanManager = BeanManagerImpl.getManager();
+        BeanManagerImpl beanManager = WebBeansContext.getInstance().getBeanManagerImpl();
         try
         {
             this.javaEEInstance = javaEeComponentInstance;
@@ -166,7 +167,7 @@ public final class OWBInjector implement
     @SuppressWarnings("unchecked")
     public void destroy()
     {
-        BeanManagerImpl beanManager = BeanManagerImpl.getManager();
+        BeanManagerImpl beanManager = WebBeansContext.getInstance().getBeanManagerImpl();
         
         //Look for custom InjectionTarget
         InjectionTargetWrapper<Object> wrapper = beanManager.getInjectionTargetWrapper((Class<Object>)javaEEInstance.getClass());

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=1042099&r1=1042098&r2=1042099&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 Sat Dec  4 04:27:19 2010
@@ -42,9 +42,9 @@ import javax.enterprise.inject.spi.Injec
 import javax.inject.Named;
 
 import org.apache.webbeans.annotation.NamedLiteral;
+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 +103,9 @@ public class InjectionPointFactory
         
         if(!checkFieldApplicable(annots))
         {
-            AnnotatedType<?> annotated = AnnotatedElementFactory.getInstance().newAnnotatedType(member.getDeclaringClass());
-            return getGenericInjectionPoint(owner, annots, member.getGenericType(), member, 
-                    AnnotatedElementFactory.getInstance().newAnnotatedField(member, annotated));   
+            AnnotatedType<?> annotated = WebBeansContext.getInstance().getAnnotatedElementFactory().newAnnotatedType(member.getDeclaringClass());
+            return getGenericInjectionPoint(owner, annots, member.getGenericType(), member,
+                    WebBeansContext.getInstance().getAnnotatedElementFactory().newAnnotatedField(member, annotated));
         }        
         else
         {
@@ -207,9 +207,9 @@ public class InjectionPointFactory
         Asserts.assertNotNull(member, "member parameter can not be null");
 
         List<InjectionPoint> lists = new ArrayList<InjectionPoint>();
-        
-        AnnotatedType<?> annotated = AnnotatedElementFactory.getInstance().newAnnotatedType(member.getDeclaringClass());
-        AnnotatedMethod method = AnnotatedElementFactory.getInstance().newAnnotatedMethod(member, annotated);
+
+        AnnotatedType<?> annotated = WebBeansContext.getInstance().getAnnotatedElementFactory().newAnnotatedType(member.getDeclaringClass());
+        AnnotatedMethod method = WebBeansContext.getInstance().getAnnotatedElementFactory().newAnnotatedMethod(member, annotated);
         List<AnnotatedParameter<?>> parameters = method.getParameters();
         
         InjectionPoint point = null;
@@ -313,8 +313,8 @@ public class InjectionPointFactory
 
         List<InjectionPoint> lists = new ArrayList<InjectionPoint>();
 
-        AnnotatedType<Object> annotated = (AnnotatedType<Object>)AnnotatedElementFactory.getInstance().newAnnotatedType(member.getDeclaringClass());
-        AnnotatedConstructor constructor = AnnotatedElementFactory.getInstance().newAnnotatedConstructor((Constructor<Object>)member,annotated);
+        AnnotatedType<Object> annotated = (AnnotatedType<Object>) WebBeansContext.getInstance().getAnnotatedElementFactory().newAnnotatedType(member.getDeclaringClass());
+        AnnotatedConstructor constructor = WebBeansContext.getInstance().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=1042099&r1=1042098&r2=1042099&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 Sat Dec  4 04:27:19 2010
@@ -42,7 +42,7 @@ import javax.enterprise.inject.spi.Annot
 import javax.enterprise.inject.spi.Bean;
 import javax.enterprise.inject.spi.InjectionPoint;
 
-import org.apache.webbeans.container.BeanManagerImpl;
+import org.apache.webbeans.config.WebBeansContext;
 import org.apache.webbeans.portable.AnnotatedElementFactory;
 import org.apache.webbeans.util.ClassUtil;
 import org.apache.webbeans.util.WebBeansUtil;
@@ -208,7 +208,7 @@ class InjectionPointImpl implements Inje
 
         Class<?> beanClass = (Class<?>)in.readObject();
         Set<Annotation> anns = new HashSet<Annotation>();
-        AnnotatedElementFactory annotatedElementFactory = AnnotatedElementFactory.getInstance();
+        AnnotatedElementFactory annotatedElementFactory = WebBeansContext.getInstance().getAnnotatedElementFactory();
 
         while(!in.readObject().equals(new Character('~')))   // read throw-away '-' or '~' terminal delimiter.
         {
@@ -217,7 +217,7 @@ class InjectionPointImpl implements Inje
         }
         
         //process annotations
-        this.ownerBean = BeanManagerImpl.getManager().getBeans(beanClass, anns.toArray(new Annotation[anns.size()])).iterator().next();
+        this.ownerBean = WebBeansContext.getInstance().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/inject/instance/InstanceImpl.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/inject/instance/InstanceImpl.java?rev=1042099&r1=1042098&r2=1042099&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/inject/instance/InstanceImpl.java (original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/inject/instance/InstanceImpl.java Sat Dec  4 04:27:19 2010
@@ -32,7 +32,7 @@ import javax.enterprise.inject.Instance;
 import javax.enterprise.inject.spi.Bean;
 import javax.enterprise.util.TypeLiteral;
 
-import org.apache.webbeans.container.BeanManagerImpl;
+import org.apache.webbeans.config.WebBeansContext;
 import org.apache.webbeans.container.InjectionResolver;
 import org.apache.webbeans.container.ResolutionUtil;
 import org.apache.webbeans.util.AnnotationUtil;
@@ -97,7 +97,7 @@ class InstanceImpl<T> implements Instanc
         ResolutionUtil.checkResolvedBeans(beans, ClassUtil.getClazz(this.injectionClazz),anns);
 
         Bean<?> bean = beans.iterator().next();
-        instance = (T)BeanManagerImpl.getManager().getInstance(bean,null);
+        instance = (T) WebBeansContext.getInstance().getBeanManagerImpl().getInstance(bean,null);
 
         return instance;
     }
@@ -224,7 +224,7 @@ class InstanceImpl<T> implements Instanc
         Set<T> instances = new HashSet<T>();
         for(Bean<?> bean : beans)
         {
-            T instance = (T)BeanManagerImpl.getManager().getInstance(bean,null);
+            T instance = (T) WebBeansContext.getInstance().getBeanManagerImpl().getInstance(bean,null);
             instances.add(instance);
         }
         

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/intercept/InterceptorComparator.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/intercept/InterceptorComparator.java?rev=1042099&r1=1042098&r2=1042099&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/intercept/InterceptorComparator.java (original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/intercept/InterceptorComparator.java Sat Dec  4 04:27:19 2010
@@ -22,6 +22,7 @@ import java.util.Comparator;
 
 import javax.enterprise.inject.spi.Interceptor;
 
+import org.apache.webbeans.config.WebBeansContext;
 import org.apache.webbeans.intercept.webbeans.WebBeansInterceptor;
 
 public class InterceptorComparator<T> implements Comparator<Interceptor<T>>
@@ -41,7 +42,7 @@ public class InterceptorComparator<T> im
             Class<?> o1Clazz = src.getClazz();
             Class<?> o2Clazz = target.getClazz();
 
-            return InterceptorsManager.getInstance().compare(o1Clazz, o2Clazz);
+            return WebBeansContext.getInstance().getInterceptorsManager().compare(o1Clazz, o2Clazz);
 
         }
     }

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/intercept/InterceptorDataComparator.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/intercept/InterceptorDataComparator.java?rev=1042099&r1=1042098&r2=1042099&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/intercept/InterceptorDataComparator.java (original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/intercept/InterceptorDataComparator.java Sat Dec  4 04:27:19 2010
@@ -21,6 +21,7 @@ package org.apache.webbeans.intercept;
 import java.io.Serializable;
 import java.util.Comparator;
 
+import org.apache.webbeans.config.WebBeansContext;
 import org.apache.webbeans.intercept.webbeans.WebBeansInterceptor;
 
 public class InterceptorDataComparator implements Comparator<InterceptorData>, Serializable
@@ -63,7 +64,7 @@ public class InterceptorDataComparator i
                 Class<?> o1Clazz = interceptorFirst.getClazz();
                 Class<?> o2Clazz = interceptorSecond.getClazz();
 
-                return InterceptorsManager.getInstance().compare(o1Clazz, o2Clazz);
+                return WebBeansContext.getInstance().getInterceptorsManager().compare(o1Clazz, o2Clazz);
             }
 
         }

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/intercept/InterceptorDataImpl.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/intercept/InterceptorDataImpl.java?rev=1042099&r1=1042098&r2=1042099&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/intercept/InterceptorDataImpl.java (original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/intercept/InterceptorDataImpl.java Sat Dec  4 04:27:19 2010
@@ -28,6 +28,7 @@ import javax.enterprise.inject.spi.Inter
 import javax.interceptor.AroundInvoke;
 
 import org.apache.webbeans.config.OWBLogConst;
+import org.apache.webbeans.config.WebBeansContext;
 import org.apache.webbeans.container.BeanManagerImpl;
 import org.apache.webbeans.context.creational.CreationalContextImpl;
 import org.apache.webbeans.context.creational.EjbInterceptorContext;
@@ -36,7 +37,6 @@ import org.apache.webbeans.inject.OWBInj
 import org.apache.webbeans.intercept.webbeans.WebBeansInterceptor;
 import org.apache.webbeans.logger.WebBeansLogger;
 import org.apache.webbeans.plugins.OpenWebBeansEjbLCAPlugin;
-import org.apache.webbeans.plugins.PluginLoader;
 import org.apache.webbeans.util.WebBeansUtil;
 
 /**
@@ -117,7 +117,7 @@ public class InterceptorDataImpl impleme
      */
     public void setInterceptorMethod(Method m, Class<? extends Annotation> annotation)
     {
-        OpenWebBeansEjbLCAPlugin ejbPlugin = PluginLoader.getInstance().getEjbLCAPlugin();
+        OpenWebBeansEjbLCAPlugin ejbPlugin = WebBeansContext.getInstance().getPluginLoader().getEjbLCAPlugin();
         Class <? extends Annotation> prePassivateClass = null;
         Class <? extends Annotation> postActivateClass = null;
         Class <? extends Annotation> aroundTimeoutClass = null;
@@ -433,7 +433,7 @@ public class InterceptorDataImpl impleme
             // There is no define interceptor, define and add it into dependent
             if (interceptor == null)
             {
-                BeanManagerImpl manager = BeanManagerImpl.getManager();
+                BeanManagerImpl manager = WebBeansContext.getInstance().getBeanManagerImpl();
 
                 WebBeansInterceptor<Object> actualInterceptor = (WebBeansInterceptor<Object>) this.webBeansInterceptor;
                 CreationalContext<Object> creationalContext = manager.createCreationalContext(actualInterceptor);

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/intercept/InterceptorHandler.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/intercept/InterceptorHandler.java?rev=1042099&r1=1042098&r2=1042099&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/intercept/InterceptorHandler.java (original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/intercept/InterceptorHandler.java Sat Dec  4 04:27:19 2010
@@ -36,13 +36,13 @@ import javassist.util.proxy.ProxyObject;
 import org.apache.webbeans.component.InjectionTargetBean;
 import org.apache.webbeans.component.OwbBean;
 import org.apache.webbeans.config.OWBLogConst;
+import org.apache.webbeans.config.WebBeansContext;
 import org.apache.webbeans.container.BeanManagerImpl;
 import org.apache.webbeans.context.creational.CreationalContextImpl;
 import org.apache.webbeans.decorator.DelegateHandler;
 import org.apache.webbeans.decorator.WebBeansDecoratorConfig;
 import org.apache.webbeans.decorator.WebBeansDecoratorInterceptor;
 import org.apache.webbeans.logger.WebBeansLogger;
-import org.apache.webbeans.proxy.JavassistProxyFactory;
 import org.apache.webbeans.util.ClassUtil;
 import org.apache.webbeans.util.SecurityUtil;
 import org.apache.webbeans.util.WebBeansUtil;
@@ -207,12 +207,12 @@ public abstract class InterceptorHandler
                     List<Object> decorators = null;
                     if (injectionTarget.getDecoratorStack().size() > 0)
                     {
-                        Class<?> proxyClass = JavassistProxyFactory.getInstance().getInterceptorProxyClasses().get(bean);
+                        Class<?> proxyClass = WebBeansContext.getInstance().getJavassistProxyFactory().getInterceptorProxyClasses().get(bean);
                         if (proxyClass == null)
                         {
-                            ProxyFactory delegateFactory = JavassistProxyFactory.getInstance().createProxyFactory(bean);
-                            proxyClass = JavassistProxyFactory.getInstance().getProxyClass(delegateFactory);
-                            JavassistProxyFactory.getInstance().getInterceptorProxyClasses().put(bean, proxyClass);
+                            ProxyFactory delegateFactory = WebBeansContext.getInstance().getJavassistProxyFactory().createProxyFactory(bean);
+                            proxyClass = WebBeansContext.getInstance().getJavassistProxyFactory().getProxyClass(delegateFactory);
+                            WebBeansContext.getInstance().getJavassistProxyFactory().getInterceptorProxyClasses().put(bean, proxyClass);
                         }
                         Object delegate = proxyClass.newInstance();
                         delegateHandler = new DelegateHandler(this.bean);
@@ -328,7 +328,7 @@ public abstract class InterceptorHandler
      */
     protected BeanManagerImpl getBeanManager()
     {
-        return BeanManagerImpl.getManager();
+        return WebBeansContext.getInstance().getBeanManagerImpl();
     }
                 
     /**
@@ -366,7 +366,7 @@ public abstract class InterceptorHandler
             String passivationId = (String) s.readObject();
             if (passivationId != null)
             {
-                this.bean = (OwbBean<?>)BeanManagerImpl.getManager().getPassivationCapableBean(passivationId);
+                this.bean = (OwbBean<?>) WebBeansContext.getInstance().getBeanManagerImpl().getPassivationCapableBean(passivationId);
             }
         }
         else

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/intercept/InterceptorUtil.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/intercept/InterceptorUtil.java?rev=1042099&r1=1042098&r2=1042099&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/intercept/InterceptorUtil.java (original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/intercept/InterceptorUtil.java Sat Dec  4 04:27:19 2010
@@ -43,12 +43,12 @@ import javax.interceptor.Interceptors;
 import javax.interceptor.InvocationContext;
 
 import org.apache.webbeans.component.InjectionTargetBean;
+import org.apache.webbeans.config.WebBeansContext;
 import org.apache.webbeans.context.creational.CreationalContextImpl;
 import org.apache.webbeans.exception.WebBeansConfigurationException;
 import org.apache.webbeans.exception.WebBeansException;
 import org.apache.webbeans.logger.WebBeansLogger;
 import org.apache.webbeans.plugins.OpenWebBeansEjbLCAPlugin;
-import org.apache.webbeans.plugins.PluginLoader;
 import org.apache.webbeans.util.AnnotationUtil;
 import org.apache.webbeans.util.Asserts;
 import org.apache.webbeans.util.ClassUtil;
@@ -65,7 +65,7 @@ public final class InterceptorUtil
 
     private InterceptorUtil()
     {
-        ejbPlugin = PluginLoader.getInstance().getEjbLCAPlugin();
+        ejbPlugin = WebBeansContext.getInstance().getPluginLoader().getEjbLCAPlugin();
         if(ejbPlugin != null)
         {
             prePassivateClass  = ejbPlugin.getPrePassivateClass();

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/intercept/InterceptorsManager.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/intercept/InterceptorsManager.java?rev=1042099&r1=1042098&r2=1042099&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/intercept/InterceptorsManager.java (original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/intercept/InterceptorsManager.java Sat Dec  4 04:27:19 2010
@@ -39,6 +39,7 @@ public class InterceptorsManager
         manager = webBeansContext.getBeanManagerImpl();
     }
 
+    @Deprecated
     public static InterceptorsManager getInstance()
     {
         return WebBeansContext.getInstance().getInterceptorsManager();

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=1042099&r1=1042098&r2=1042099&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 Sat Dec  4 04:27:19 2010
@@ -31,7 +31,7 @@ import javax.interceptor.InvocationConte
 
 import org.apache.webbeans.component.EnterpriseBeanMarker;
 import org.apache.webbeans.component.OwbBean;
-import org.apache.webbeans.container.BeanManagerImpl;
+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 +125,7 @@ public class InvocationContextImpl imple
     @SuppressWarnings("unchecked")
     private void configureTarget(OwbBean<?> bean)
     {
-        Context webbeansContext = BeanManagerImpl.getManager().getContext(bean.getScope());
+        Context webbeansContext = WebBeansContext.getInstance().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=1042099&r1=1042098&r2=1042099&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 Sat Dec  4 04:27:19 2010
@@ -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;
 
 
@@ -160,7 +160,7 @@ public class NormalScopedBeanInterceptor
             //contained in @ApplicationScopedBean
             if(creationalContext == null)
             {
-                creationalContext = CreationalContextFactory.getInstance().getCreationalContext(contextual);
+                creationalContext = WebBeansContext.getInstance().getCreationalContextFactory().getCreationalContext(contextual);
                 owbContext.initContextualBag((OwbBean<Object>)this.bean, creationalContext);
             }
         }
@@ -172,7 +172,7 @@ public class NormalScopedBeanInterceptor
         // preceding call to Context.get(Contextual) (without any CreationalContext)
         if(creationalContext == null)
         {
-            creationalContext = CreationalContextFactory.getInstance().getCreationalContext(contextual);
+            creationalContext = WebBeansContext.getInstance().getCreationalContextFactory().getCreationalContext(contextual);
         }
 
         return creationalContext;

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/intercept/WebBeansInterceptorConfig.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/intercept/WebBeansInterceptorConfig.java?rev=1042099&r1=1042098&r2=1042099&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/intercept/WebBeansInterceptorConfig.java (original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/intercept/WebBeansInterceptorConfig.java Sat Dec  4 04:27:19 2010
@@ -21,14 +21,13 @@ package org.apache.webbeans.intercept;
 import org.apache.webbeans.component.AbstractInjectionTargetBean;
 import org.apache.webbeans.component.AbstractOwbBean;
 import org.apache.webbeans.config.OWBLogConst;
+import org.apache.webbeans.config.WebBeansContext;
 import org.apache.webbeans.config.inheritance.IBeanInheritedMetaData;
-import org.apache.webbeans.container.BeanManagerImpl;
 import org.apache.webbeans.corespi.ServiceLoader;
 import org.apache.webbeans.exception.WebBeansConfigurationException;
 import org.apache.webbeans.intercept.webbeans.WebBeansInterceptor;
 import org.apache.webbeans.logger.WebBeansLogger;
 import org.apache.webbeans.plugins.OpenWebBeansEjbLCAPlugin;
-import org.apache.webbeans.plugins.PluginLoader;
 import org.apache.webbeans.spi.BDABeansXmlScanner;
 import org.apache.webbeans.spi.ScannerService;
 import org.apache.webbeans.util.AnnotationUtil;
@@ -114,9 +113,9 @@ public final class WebBeansInterceptorCo
             checkAnns(anns, ann, delegate);
             interceptor.addInterceptorBinding(ann.annotationType(), ann);
         }
-                
 
-        BeanManagerImpl.getManager().addInterceptor(interceptor);
+
+        WebBeansContext.getInstance().getBeanManagerImpl().addInterceptor(interceptor);
 
     }
     
@@ -300,8 +299,8 @@ public final class WebBeansInterceptorCo
         {
             WebBeansInterceptor<?> interceptor = (WebBeansInterceptor<?>) it.next();
             AnnotatedType<?> annotatedType = interceptor.getAnnotatedType();
-            
-            OpenWebBeansEjbLCAPlugin ejbPlugin = PluginLoader.getInstance().getEjbLCAPlugin();
+
+            OpenWebBeansEjbLCAPlugin ejbPlugin = WebBeansContext.getInstance().getPluginLoader().getEjbLCAPlugin();
             Class <? extends Annotation> prePassivateClass = null;
             Class <? extends Annotation> postActivateClass = null;
             Class <? extends Annotation> aroundTimeoutClass = null;
@@ -410,8 +409,8 @@ public final class WebBeansInterceptorCo
                     WebBeansUtil.configureInterceptorMethods(interceptor, interceptor.getClazz(), AroundInvoke.class, true, true, stack, method, true);
                     WebBeansUtil.configureInterceptorMethods(interceptor, interceptor.getClazz(), PostConstruct.class, true, true, stack, method, true);
                     WebBeansUtil.configureInterceptorMethods(interceptor, interceptor.getClazz(), PreDestroy.class, true, true, stack, method, true);
-                    
-                    OpenWebBeansEjbLCAPlugin ejbPlugin = PluginLoader.getInstance().getEjbLCAPlugin();
+
+                    OpenWebBeansEjbLCAPlugin ejbPlugin = WebBeansContext.getInstance().getPluginLoader().getEjbLCAPlugin();
                     if (null != ejbPlugin)
                     {
                         WebBeansUtil.configureInterceptorMethods(interceptor, interceptor.getClazz(), ejbPlugin.getPrePassivateClass(), true, true, stack, method, true);
@@ -512,7 +511,7 @@ public final class WebBeansInterceptorCo
      */
     private static Set<Interceptor<?>> getWebBeansInterceptors()
     {
-        return Collections.unmodifiableSet(BeanManagerImpl.getManager().getInterceptors());
+        return Collections.unmodifiableSet(WebBeansContext.getInstance().getBeanManagerImpl().getInterceptors());
     }
 
     /*

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/intercept/webbeans/WebBeansInterceptor.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/intercept/webbeans/WebBeansInterceptor.java?rev=1042099&r1=1042098&r2=1042099&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/intercept/webbeans/WebBeansInterceptor.java (original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/intercept/webbeans/WebBeansInterceptor.java Sat Dec  4 04:27:19 2010
@@ -22,7 +22,7 @@ import org.apache.webbeans.component.Abs
 import org.apache.webbeans.component.AbstractOwbBean;
 import org.apache.webbeans.component.ManagedBean;
 import org.apache.webbeans.component.WebBeansType;
-import org.apache.webbeans.container.BeanManagerImpl;
+import org.apache.webbeans.config.WebBeansContext;
 import org.apache.webbeans.exception.WebBeansConfigurationException;
 import org.apache.webbeans.exception.WebBeansException;
 import org.apache.webbeans.inject.InjectableField;
@@ -30,11 +30,9 @@ import org.apache.webbeans.inject.Inject
 import org.apache.webbeans.intercept.InterceptorUtil;
 import org.apache.webbeans.intercept.OwbInterceptor;
 import org.apache.webbeans.intercept.WebBeansInterceptorConfig;
-import org.apache.webbeans.proxy.JavassistProxyFactory;
 import org.apache.webbeans.util.AnnotationUtil;
 import org.apache.webbeans.util.SecurityUtil;
 import org.apache.webbeans.util.WebBeansUtil;
-import org.apache.webbeans.xml.XMLAnnotationTypeManager;
 
 import javax.enterprise.context.spi.Context;
 import javax.enterprise.context.spi.CreationalContext;
@@ -193,9 +191,9 @@ public class WebBeansInterceptor<T> exte
             Set<Annotation> declared = null;
             Annotation[] anns = null;
 
-            if (XMLAnnotationTypeManager.getInstance().hasInterceptorBindingType(clazzAnnot))
+            if (WebBeansContext.getInstance().getxMLAnnotationTypeManager().hasInterceptorBindingType(clazzAnnot))
             {
-                declared = XMLAnnotationTypeManager.getInstance().getInterceptorBindingTypeInherites(clazzAnnot);
+                declared = WebBeansContext.getInstance().getxMLAnnotationTypeManager().getInterceptorBindingTypeInherites(clazzAnnot);
                 anns = new Annotation[declared.size()];
                 anns = declared.toArray(anns);
             }
@@ -285,9 +283,9 @@ public class WebBeansInterceptor<T> exte
     @SuppressWarnings("unchecked")
     protected T createInstance(CreationalContext<T> creationalContext)
     {
-        Context context = BeanManagerImpl.getManager().getContext(getScope());
+        Context context = WebBeansContext.getInstance().getBeanManagerImpl().getContext(getScope());
         Object actualInstance = context.get((Bean<Object>)this.delegateBean, (CreationalContext<Object>)creationalContext);
-        T proxy = (T)JavassistProxyFactory.getInstance().createDependentScopedBeanProxy(this.delegateBean, actualInstance, creationalContext);
+        T proxy = (T) WebBeansContext.getInstance().getJavassistProxyFactory().createDependentScopedBeanProxy(this.delegateBean, actualInstance, creationalContext);
         
         return proxy;
     }

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/jms/JMSManager.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/jms/JMSManager.java?rev=1042099&r1=1042098&r2=1042099&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/jms/JMSManager.java (original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/jms/JMSManager.java Sat Dec  4 04:27:19 2010
@@ -41,12 +41,13 @@ public class JMSManager
     {
         this.jmsModels.clear();
     }
-    
+
+    @Deprecated
     public static JMSManager getInstance()
     {
         return WebBeansContext.getInstance().getjMSManager();
     }
-    
+
     public void addJmsModel(JMSModel model)
     {
         Asserts.assertNotNull(model,"model parameter can not be null");

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/lifecycle/AbstractLifeCycle.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/lifecycle/AbstractLifeCycle.java?rev=1042099&r1=1042098&r2=1042099&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/lifecycle/AbstractLifeCycle.java (original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/lifecycle/AbstractLifeCycle.java Sat Dec  4 04:27:19 2010
@@ -26,17 +26,13 @@ import javax.enterprise.inject.spi.BeanM
 
 import org.apache.webbeans.config.BeansDeployer;
 import org.apache.webbeans.config.OWBLogConst;
+import org.apache.webbeans.config.WebBeansContext;
 import org.apache.webbeans.config.WebBeansFinder;
 import org.apache.webbeans.container.BeanManagerImpl;
 import org.apache.webbeans.container.InjectionResolver;
 import org.apache.webbeans.corespi.ServiceLoader;
-import org.apache.webbeans.jms.JMSManager;
 import org.apache.webbeans.logger.WebBeansLogger;
-import org.apache.webbeans.plugins.PluginLoader;
-import org.apache.webbeans.portable.AnnotatedElementFactory;
-import org.apache.webbeans.portable.events.ExtensionLoader;
 import org.apache.webbeans.portable.events.discovery.BeforeShutdownImpl;
-import org.apache.webbeans.proxy.JavassistProxyFactory;
 import org.apache.webbeans.spi.ContainerLifecycle;
 import org.apache.webbeans.spi.ContextsService;
 import org.apache.webbeans.spi.JNDIService;
@@ -76,8 +72,8 @@ public abstract class AbstractLifeCycle 
     protected AbstractLifeCycle(Properties properties)
     {
         beforeInitApplication(properties);
-        
-        this.beanManager = (BeanManagerImpl) WebBeansFinder.getSingletonInstance(BeanManagerImpl.class.getName());
+
+        this.beanManager = WebBeansContext.getInstance().getBeanManagerImpl();
         this.xmlDeployer = new WebBeansXMLConfigurator();
         this.deployer = new BeansDeployer(xmlDeployer);
         this.jndiService = ServiceLoader.getService(JNDIService.class);    
@@ -106,7 +102,7 @@ public abstract class AbstractLifeCycle 
         beforeStartApplication(startupObject);
         
         //Load all plugins
-        PluginLoader.getInstance().startUp();
+        WebBeansContext.getInstance().getPluginLoader().startUp();
         
         //Initialize contexts
         this.contextsService.init(startupObject);
@@ -152,22 +148,22 @@ public abstract class AbstractLifeCycle 
             jndiService.unbind(WebBeansConstants.WEB_BEANS_MANAGER_JNDI_NAME);
 
             //Free all plugin resources
-            PluginLoader.getInstance().shutDown();
+            WebBeansContext.getInstance().getPluginLoader().shutDown();
             
             //Clear extensions
-            ExtensionLoader.getInstance().clear();
+            WebBeansContext.getInstance().getExtensionLoader().clear();
             
             //Delete Resolutions Cache
             InjectionResolver.getInstance().clearCaches();
             
             //Delte proxies
-            JavassistProxyFactory.getInstance().clear();
+            WebBeansContext.getInstance().getJavassistProxyFactory().clear();
             
             //Delete AnnotateTypeCache
-            AnnotatedElementFactory.getInstance().clear();
+            WebBeansContext.getInstance().getAnnotatedElementFactory().clear();
             
             //Delete JMS Model Cache
-            JMSManager.getInstance().clear();
+            WebBeansContext.getInstance().getjMSManager().clear();
             
             //After Stop
             afterStopApplication(endObject);

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/plugins/PluginLoader.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/plugins/PluginLoader.java?rev=1042099&r1=1042098&r2=1042099&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/plugins/PluginLoader.java (original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/plugins/PluginLoader.java Sat Dec  4 04:27:19 2010
@@ -57,15 +57,16 @@ public class PluginLoader
     private List<OpenWebBeansPlugin> plugins = null;
 
     private AtomicBoolean started = new AtomicBoolean(false);
-    
+
     /**
-     * @return singleton PluginLoader 
+     * @return singleton PluginLoader
      */
+    @Deprecated
     public static PluginLoader getInstance()
     {
         return WebBeansContext.getInstance().getPluginLoader();
     }
-    
+
     public PluginLoader()
     {
     }    

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/portable/AbstractAnnotatedMember.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/portable/AbstractAnnotatedMember.java?rev=1042099&r1=1042098&r2=1042099&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/portable/AbstractAnnotatedMember.java (original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/portable/AbstractAnnotatedMember.java Sat Dec  4 04:27:19 2010
@@ -30,6 +30,7 @@ import javax.enterprise.inject.spi.Annot
 import javax.enterprise.inject.spi.AnnotatedMethod;
 import javax.enterprise.inject.spi.AnnotatedType;
 
+import org.apache.webbeans.config.WebBeansContext;
 import org.apache.webbeans.util.ClassUtil;
 
 /**
@@ -67,7 +68,7 @@ abstract class AbstractAnnotatedMember<X
         
         if(declaringType == null)
         {
-            this.declaringType = (AnnotatedType<X>)AnnotatedElementFactory.getInstance().newAnnotatedType(this.javaMember.getDeclaringClass());
+            this.declaringType = (AnnotatedType<X>) WebBeansContext.getInstance().getAnnotatedElementFactory().newAnnotatedType(this.javaMember.getDeclaringClass());
             
             AnnotatedTypeImpl<X> impl = (AnnotatedTypeImpl<X>)this.declaringType;
             

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/portable/AnnotatedElementFactory.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/portable/AnnotatedElementFactory.java?rev=1042099&r1=1042098&r2=1042099&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/portable/AnnotatedElementFactory.java (original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/portable/AnnotatedElementFactory.java Sat Dec  4 04:27:19 2010
@@ -46,6 +46,7 @@ public final class AnnotatedElementFacto
     // Logger instance
     private final WebBeansLogger logger = WebBeansLogger.getLogger(AnnotatedElementFactory.class);
 
+    @Deprecated
     public static AnnotatedElementFactory getInstance()
     {
         return WebBeansContext.getInstance().getAnnotatedElementFactory();

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/portable/creation/AbstractProducer.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/portable/creation/AbstractProducer.java?rev=1042099&r1=1042098&r2=1042099&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/portable/creation/AbstractProducer.java (original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/portable/creation/AbstractProducer.java Sat Dec  4 04:27:19 2010
@@ -25,7 +25,7 @@ import javax.enterprise.inject.spi.Injec
 import javax.enterprise.inject.spi.Producer;
 
 import org.apache.webbeans.component.OwbBean;
-import org.apache.webbeans.context.creational.CreationalContextFactory;
+import org.apache.webbeans.config.WebBeansContext;
 import org.apache.webbeans.context.creational.CreationalContextImpl;
 
 /**
@@ -72,7 +72,7 @@ public abstract class AbstractProducer<T
         T instance = null;
         if(!(creationalContext instanceof CreationalContextImpl))
         {
-            creationalContext = CreationalContextFactory.getInstance().wrappedCreationalContext(creationalContext, this.bean);
+            creationalContext = WebBeansContext.getInstance().getCreationalContextFactory().wrappedCreationalContext(creationalContext, this.bean);
         }
         
         //Save it

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/portable/creation/InjectionTargetProducer.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/portable/creation/InjectionTargetProducer.java?rev=1042099&r1=1042098&r2=1042099&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/portable/creation/InjectionTargetProducer.java (original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/portable/creation/InjectionTargetProducer.java Sat Dec  4 04:27:19 2010
@@ -25,7 +25,7 @@ import javax.enterprise.inject.spi.Injec
 
 import org.apache.webbeans.component.EnterpriseBeanMarker;
 import org.apache.webbeans.component.InjectionTargetBean;
-import org.apache.webbeans.context.creational.CreationalContextFactory;
+import org.apache.webbeans.config.WebBeansContext;
 import org.apache.webbeans.context.creational.CreationalContextImpl;
 import org.apache.webbeans.inject.AbstractInjectable;
 import org.apache.webbeans.proxy.JavassistProxyFactory;
@@ -57,7 +57,7 @@ public class InjectionTargetProducer<T> 
     {
         if(!(ctx instanceof CreationalContextImpl))
         {
-            ctx = CreationalContextFactory.getInstance().wrappedCreationalContext(ctx, this.bean);
+            ctx = WebBeansContext.getInstance().getCreationalContextFactory().wrappedCreationalContext(ctx, this.bean);
         }
         
         Object oldInstanceUnderInjection = AbstractInjectable.instanceUnderInjection.get();

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/portable/events/ExtensionLoader.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/portable/events/ExtensionLoader.java?rev=1042099&r1=1042098&r2=1042099&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/portable/events/ExtensionLoader.java (original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/portable/events/ExtensionLoader.java Sat Dec  4 04:27:19 2010
@@ -60,14 +60,15 @@ public class ExtensionLoader
 
     /**
      * Returns singleton <code>ExtensionLoader</code> instance.
-     * 
+     *
      * @return singleton instance
      */
+    @Deprecated
     public static ExtensionLoader getInstance()
     {
         return WebBeansContext.getInstance().getExtensionLoader();
     }
-    
+
     /**
      * Load extension services.
      */

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/portable/events/ProcessBeanImpl.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/portable/events/ProcessBeanImpl.java?rev=1042099&r1=1042098&r2=1042099&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/portable/events/ProcessBeanImpl.java (original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/portable/events/ProcessBeanImpl.java Sat Dec  4 04:27:19 2010
@@ -22,7 +22,7 @@ import javax.enterprise.inject.spi.Annot
 import javax.enterprise.inject.spi.Bean;
 import javax.enterprise.inject.spi.ProcessBean;
 
-import org.apache.webbeans.container.BeanManagerImpl;
+import org.apache.webbeans.config.WebBeansContext;
 
 /**
  * Implementation of the {@link ProcessBean}.
@@ -51,7 +51,7 @@ public  class ProcessBeanImpl<X> impleme
     @Override
     public void addDefinitionError(Throwable t)
     {
-        BeanManagerImpl.getManager().getErrorStack().pushError(t);
+        WebBeansContext.getInstance().getBeanManagerImpl().getErrorStack().pushError(t);
     }
 
     /**

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/portable/events/ProcessInjectionTargetImpl.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/portable/events/ProcessInjectionTargetImpl.java?rev=1042099&r1=1042098&r2=1042099&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/portable/events/ProcessInjectionTargetImpl.java (original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/portable/events/ProcessInjectionTargetImpl.java Sat Dec  4 04:27:19 2010
@@ -22,7 +22,7 @@ import javax.enterprise.inject.spi.Annot
 import javax.enterprise.inject.spi.InjectionTarget;
 import javax.enterprise.inject.spi.ProcessInjectionTarget;
 
-import org.apache.webbeans.container.BeanManagerImpl;
+import org.apache.webbeans.config.WebBeansContext;
 
 /**
  * Implementation of the {@link ProcessInjectionTarget}.
@@ -59,7 +59,7 @@ public class ProcessInjectionTargetImpl<
     @Override
     public void addDefinitionError(Throwable t)
     {
-        BeanManagerImpl.getManager().getErrorStack().pushError(t);
+        WebBeansContext.getInstance().getBeanManagerImpl().getErrorStack().pushError(t);
     }
 
     @Override

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/portable/events/ProcessObserverMethodImpl.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/portable/events/ProcessObserverMethodImpl.java?rev=1042099&r1=1042098&r2=1042099&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/portable/events/ProcessObserverMethodImpl.java (original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/portable/events/ProcessObserverMethodImpl.java Sat Dec  4 04:27:19 2010
@@ -22,7 +22,7 @@ import javax.enterprise.inject.spi.Annot
 import javax.enterprise.inject.spi.ObserverMethod;
 import javax.enterprise.inject.spi.ProcessObserverMethod;
 
-import org.apache.webbeans.container.BeanManagerImpl;
+import org.apache.webbeans.config.WebBeansContext;
 
 /**
  * Implementation of  {@link ProcessObserverMethod}.
@@ -52,7 +52,7 @@ public class ProcessObserverMethodImpl<T
     @Override
     public void addDefinitionError(Throwable t)
     {
-        BeanManagerImpl.getManager().getErrorStack().pushError(t);
+        WebBeansContext.getInstance().getBeanManagerImpl().getErrorStack().pushError(t);
     }
 
     /**

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/portable/events/ProcessProducerImpl.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/portable/events/ProcessProducerImpl.java?rev=1042099&r1=1042098&r2=1042099&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/portable/events/ProcessProducerImpl.java (original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/portable/events/ProcessProducerImpl.java Sat Dec  4 04:27:19 2010
@@ -22,7 +22,7 @@ import javax.enterprise.inject.spi.Annot
 import javax.enterprise.inject.spi.ProcessProducer;
 import javax.enterprise.inject.spi.Producer;
 
-import org.apache.webbeans.container.BeanManagerImpl;
+import org.apache.webbeans.config.WebBeansContext;
 
 /**
  * Implementation of {@link ProcessProducer}.
@@ -55,7 +55,7 @@ public class ProcessProducerImpl<X,T> im
     @Override
     public void addDefinitionError(Throwable t)
     {
-        BeanManagerImpl.getManager().getErrorStack().pushError(t);
+        WebBeansContext.getInstance().getBeanManagerImpl().getErrorStack().pushError(t);
     }
 
     /**



Mime
View raw message