tomee-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dblev...@apache.org
Subject svn commit: r1049779 - in /openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/cdi: BeansDeployer.java CdiInterceptor.java CdiPlugin.java CdiScanner.java OpenEJBLifecycle.java ThreadSingletonServiceImpl.java
Date Thu, 16 Dec 2010 04:34:09 GMT
Author: dblevins
Date: Thu Dec 16 04:34:09 2010
New Revision: 1049779

URL: http://svn.apache.org/viewvc?rev=1049779&view=rev
Log:
Adjustments for OWB-503: Reduce static synchronized hashmap usage

Modified:
    openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/cdi/BeansDeployer.java
    openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/cdi/CdiInterceptor.java
    openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/cdi/CdiPlugin.java
    openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/cdi/CdiScanner.java
    openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/cdi/OpenEJBLifecycle.java
    openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/cdi/ThreadSingletonServiceImpl.java

Modified: openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/cdi/BeansDeployer.java
URL: http://svn.apache.org/viewvc/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/cdi/BeansDeployer.java?rev=1049779&r1=1049778&r2=1049779&view=diff
==============================================================================
--- openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/cdi/BeansDeployer.java
(original)
+++ openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/cdi/BeansDeployer.java
Thu Dec 16 04:34:09 2010
@@ -26,26 +26,22 @@ import org.apache.webbeans.component.Man
 import org.apache.webbeans.component.NewBean;
 import org.apache.webbeans.component.OwbBean;
 import org.apache.webbeans.component.WebBeansType;
-import org.apache.webbeans.component.creation.BeanCreator;
 import org.apache.webbeans.component.creation.BeanCreator.MetaDataProvider;
 import org.apache.webbeans.component.creation.ManagedBeanCreatorImpl;
 import org.apache.webbeans.config.DefinitionUtil;
 import org.apache.webbeans.config.ManagedBeanConfigurator;
 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.decorator.DecoratorsManager;
 import org.apache.webbeans.decorator.WebBeansDecorator;
-import org.apache.webbeans.deployment.StereoTypeManager;
 import org.apache.webbeans.deployment.StereoTypeModel;
 import org.apache.webbeans.exception.WebBeansConfigurationException;
 import org.apache.webbeans.exception.WebBeansDeploymentException;
 import org.apache.webbeans.exception.inject.InconsistentSpecializationException;
 import org.apache.webbeans.inject.OWBInjector;
-import org.apache.webbeans.intercept.InterceptorsManager;
 import org.apache.webbeans.intercept.webbeans.WebBeansInterceptor;
 import org.apache.webbeans.logger.WebBeansLogger;
-import org.apache.webbeans.plugins.PluginLoader;
 import org.apache.webbeans.portable.events.ProcessAnnotatedTypeImpl;
 import org.apache.webbeans.portable.events.ProcessInjectionTargetImpl;
 import org.apache.webbeans.portable.events.discovery.AfterBeanDiscoveryImpl;
@@ -59,8 +55,6 @@ import org.apache.webbeans.util.ClassUti
 import org.apache.webbeans.util.WebBeansAnnotatedTypeUtil;
 import org.apache.webbeans.util.WebBeansUtil;
 import org.apache.webbeans.xml.WebBeansXMLConfigurator;
-import org.apache.webbeans.xml.XMLAnnotationTypeManager;
-import org.apache.webbeans.xml.XMLSpecializesManager;
 
 import javax.enterprise.inject.Model;
 import javax.enterprise.inject.Specializes;
@@ -107,7 +101,7 @@ public class BeansDeployer {
      */
     void configureDefaultBeans()
     {
-        BeanManagerImpl beanManager = BeanManagerImpl.getManager();
+        BeanManagerImpl beanManager = WebBeansContext.getInstance().getBeanManagerImpl();
 
         // Register Conversation built-in component
         beanManager.addBean(WebBeansUtil.getConversationBean());
@@ -122,8 +116,8 @@ public class BeansDeployer {
         beanManager.addBean(WebBeansUtil.getEventBean());
 
         //REgister Provider Beans
-        OpenWebBeansJavaEEPlugin beanEeProvider = PluginLoader.getInstance().getJavaEEPlugin();
-        OpenWebBeansWebPlugin beanWebProvider = PluginLoader.getInstance().getWebPlugin();
+        OpenWebBeansJavaEEPlugin beanEeProvider = WebBeansContext.getInstance().getPluginLoader().getJavaEEPlugin();
+        OpenWebBeansWebPlugin beanWebProvider = WebBeansContext.getInstance().getPluginLoader().getWebPlugin();
 
         if (beanEeProvider != null) {
             addDefaultBean(beanManager, "org.apache.webbeans.ee.common.beans.PrinicipalBean");
@@ -155,7 +149,7 @@ public class BeansDeployer {
      */
     void fireBeforeBeanDiscoveryEvent()
     {
-        BeanManager manager = BeanManagerImpl.getManager();
+        BeanManager manager = WebBeansContext.getInstance().getBeanManagerImpl();
         manager.fireEvent(new BeforeBeanDiscoveryImpl(),new Annotation[0]);
     }
 
@@ -164,7 +158,7 @@ public class BeansDeployer {
      */
     void fireAfterBeanDiscoveryEvent()
     {
-        BeanManagerImpl manager = BeanManagerImpl.getManager();
+        BeanManagerImpl manager = WebBeansContext.getInstance().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");
@@ -175,7 +169,7 @@ public class BeansDeployer {
      */
     void fireAfterDeploymentValidationEvent()
     {
-        BeanManagerImpl manager = BeanManagerImpl.getManager();
+        BeanManagerImpl manager = WebBeansContext.getInstance().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");
@@ -188,10 +182,10 @@ public class BeansDeployer {
     {
         logger.debug("Validation of injection points has started.");
 
-        DecoratorsManager.getInstance().validateDecoratorClasses();
-        InterceptorsManager.getInstance().validateInterceptorClasses();
+        WebBeansContext.getInstance().getDecoratorsManager().validateDecoratorClasses();
+        WebBeansContext.getInstance().getInterceptorsManager().validateInterceptorClasses();
 
-        BeanManagerImpl manager = BeanManagerImpl.getManager();        
+        BeanManagerImpl manager = WebBeansContext.getInstance().getBeanManagerImpl();
         Set<Bean<?>> beans = new HashSet<Bean<?>>();
 
         //Adding decorators to validate
@@ -238,7 +232,7 @@ public class BeansDeployer {
      */
     private void validate(Set<Bean<?>> beans)
     {
-        BeanManagerImpl manager = BeanManagerImpl.getManager();
+        BeanManagerImpl manager = WebBeansContext.getInstance().getBeanManagerImpl();
 
         if (beans != null && beans.size() > 0) {
             Stack<String> beanNames = new Stack<String>();
@@ -276,7 +270,7 @@ public class BeansDeployer {
                             manager.validate(injectionPoint);
                         } else {
                             if (!bean.getBeanClass().isAnnotationPresent(javax.decorator.Decorator.class)
-                                    && !BeanManagerImpl.getManager().containsCustomDecoratorClass(bean.getBeanClass()))
{
+                                    && !WebBeansContext.getInstance().getBeanManagerImpl().containsCustomDecoratorClass(bean.getBeanClass()))
{
                                 throw new WebBeansConfigurationException(
                                         "Delegate injection points can not defined by beans
that are not decorator. Injection point : "
                                                 + injectionPoint);
@@ -435,7 +429,7 @@ public class BeansDeployer {
     protected void checkXMLSpecializations()
     {
         // Check XML specializations
-        Set<Class<?>> clazzes = XMLSpecializesManager.getInstance().getXMLSpecializationClasses();
+        Set<Class<?>> clazzes = WebBeansContext.getInstance().getxMLSpecializesManager().getXMLSpecializationClasses();
         Iterator<Class<?>> it = clazzes.iterator();
         Class<?> superClass = null;
         Class<?> specialClass = null;
@@ -469,7 +463,7 @@ public class BeansDeployer {
             if (marker.isPassivationCapable()) {
                 validate = true;
             }
-        } else if (BeanManagerImpl.getManager().isPassivatingScope(beanObj.getScope())) {
+        } else if (WebBeansContext.getInstance().getBeanManagerImpl().isPassivatingScope(beanObj.getScope()))
{
             if (WebBeansUtil.isPassivationCapable(beanObj) == null) {
                 if (!(beanObj instanceof AbstractProducerBean)) {
                     throw new WebBeansConfigurationException("Passivation scoped defined
bean must be passivation capable, " +
@@ -504,10 +498,10 @@ public class BeansDeployer {
                 if (beanClass.isAnnotation()) {
                     Class<? extends Annotation> stereoClass = (Class<? extends Annotation>)
beanClass;
                     if (AnnotationUtil.isStereoTypeAnnotation(stereoClass)) {
-                        if (!XMLAnnotationTypeManager.getInstance().hasStereoType(stereoClass))
{
+                        if (!WebBeansContext.getInstance().getxMLAnnotationTypeManager().hasStereoType(stereoClass))
{
                             WebBeansUtil.checkStereoTypeClass(stereoClass);
                             StereoTypeModel model = new StereoTypeModel(stereoClass);
-                            StereoTypeManager.getInstance().addStereoTypeModel(model);
+                            WebBeansContext.getInstance().getStereoTypeManager().addStereoTypeModel(model);
                         }
                     }
                 }
@@ -523,13 +517,13 @@ public class BeansDeployer {
     protected void addDefaultStereoTypes()
     {
         StereoTypeModel model = new StereoTypeModel(Model.class);
-        StereoTypeManager.getInstance().addStereoTypeModel(model);
+        WebBeansContext.getInstance().getStereoTypeManager().addStereoTypeModel(model);
 
         model = new StereoTypeModel(javax.decorator.Decorator.class);
-        StereoTypeManager.getInstance().addStereoTypeModel(model);
+        WebBeansContext.getInstance().getStereoTypeManager().addStereoTypeModel(model);
 
         model = new StereoTypeModel(Interceptor.class);
-        StereoTypeManager.getInstance().addStereoTypeModel(model);
+        WebBeansContext.getInstance().getStereoTypeManager().addStereoTypeModel(model);
     }
 
     /**
@@ -541,7 +535,7 @@ public class BeansDeployer {
     protected <T> boolean defineManagedBean(Class<T> clazz, ProcessAnnotatedTypeImpl<T>
processAnnotatedEvent)
     {   
         //Bean manager
-        BeanManagerImpl manager = BeanManagerImpl.getManager();
+        BeanManagerImpl manager = WebBeansContext.getInstance().getBeanManagerImpl();
 
         //Create an annotated type
         AnnotatedType<T> annotatedType = processAnnotatedEvent.getAnnotatedType();
@@ -609,8 +603,8 @@ public class BeansDeployer {
                     WebBeansUtil.defineInterceptor(managedBeanCreator, processInjectionTargetEvent);
                 }
             } else {
-                if (BeanManagerImpl.getManager().containsCustomDecoratorClass(annotatedType.getJavaClass())
||
-                        BeanManagerImpl.getManager().containsCustomInterceptorClass(annotatedType.getJavaClass()))
{
+                if (WebBeansContext.getInstance().getBeanManagerImpl().containsCustomDecoratorClass(annotatedType.getJavaClass())
||
+                        WebBeansContext.getInstance().getBeanManagerImpl().containsCustomInterceptorClass(annotatedType.getJavaClass()))
{
                     return false;
                 }
 

Modified: openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/cdi/CdiInterceptor.java
URL: http://svn.apache.org/viewvc/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/cdi/CdiInterceptor.java?rev=1049779&r1=1049778&r2=1049779&view=diff
==============================================================================
--- openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/cdi/CdiInterceptor.java
(original)
+++ openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/cdi/CdiInterceptor.java
Thu Dec 16 04:34:09 2010
@@ -22,11 +22,11 @@ import javassist.util.proxy.ProxyFactory
 import javassist.util.proxy.ProxyObject;
 import org.apache.openejb.core.ivm.IntraVmArtifact;
 import org.apache.webbeans.component.InjectionTargetBean;
+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.proxy.JavassistProxyFactory;
 
 import javax.enterprise.context.ApplicationScoped;
 import javax.enterprise.context.RequestScoped;
@@ -112,11 +112,11 @@ public class CdiInterceptor implements S
 
         if (bean.getDecoratorStack().size() > 0) {
 
-            Class<?> proxyClass = JavassistProxyFactory.getInstance().getInterceptorProxyClasses().get((InjectionTargetBean<?>)
bean);
+            Class<?> proxyClass = WebBeansContext.getInstance().getJavassistProxyFactory().getInterceptorProxyClasses().get((InjectionTargetBean<?>)
bean);
             if (proxyClass == null) {
-                ProxyFactory delegateFactory = JavassistProxyFactory.getInstance().createProxyFactory(bean);
-                proxyClass = JavassistProxyFactory.getInstance().getProxyClass(delegateFactory);
-                JavassistProxyFactory.getInstance().getInterceptorProxyClasses().put((InjectionTargetBean<?>)
bean, proxyClass);
+                ProxyFactory delegateFactory = WebBeansContext.getInstance().getJavassistProxyFactory().createProxyFactory(bean);
+                proxyClass = WebBeansContext.getInstance().getJavassistProxyFactory().getProxyClass(delegateFactory);
+                WebBeansContext.getInstance().getJavassistProxyFactory().getInterceptorProxyClasses().put((InjectionTargetBean<?>)
bean, proxyClass);
             }
             Object delegate = proxyClass.newInstance();
             DelegateHandler delegateHandler = new DelegateHandler(bean, ejbContext);

Modified: openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/cdi/CdiPlugin.java
URL: http://svn.apache.org/viewvc/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/cdi/CdiPlugin.java?rev=1049779&r1=1049778&r2=1049779&view=diff
==============================================================================
--- openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/cdi/CdiPlugin.java
(original)
+++ openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/cdi/CdiPlugin.java
Thu Dec 16 04:34:09 2010
@@ -25,16 +25,11 @@ import org.apache.openejb.loader.SystemI
 import org.apache.openejb.spi.ContainerSystem;
 import org.apache.openejb.util.LogCategory;
 import org.apache.openejb.util.Logger;
+import org.apache.webbeans.config.WebBeansContext;
 import org.apache.webbeans.config.WebBeansFinder;
 import org.apache.webbeans.container.InjectionResolver;
-import org.apache.webbeans.context.ContextFactory;
 import org.apache.webbeans.ee.event.TransactionalEventNotifier;
-import org.apache.webbeans.jms.JMSManager;
-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.SecurityService;
 import org.apache.webbeans.spi.TransactionService;
 import org.apache.webbeans.spi.plugins.AbstractOwbPlugin;
@@ -111,22 +106,22 @@ public class CdiPlugin extends AbstractO
             this.contexsServices.destroy(null);
 
             //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();
 
             //JMs Manager clear
-            JMSManager.getInstance().clear();
+            WebBeansContext.getInstance().getjMSManager().clear();
 
             //Clear the resource injection service
             CdiResourceInjectionService injectionServices = (CdiResourceInjectionService)
WebBeansFinder.getSingletonInstance("org.apache.openejb.cdi.CdiResourceInjectionService",
appContext.getClassLoader());

Modified: openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/cdi/CdiScanner.java
URL: http://svn.apache.org/viewvc/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/cdi/CdiScanner.java?rev=1049779&r1=1049778&r2=1049779&view=diff
==============================================================================
--- openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/cdi/CdiScanner.java
(original)
+++ openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/cdi/CdiScanner.java
Thu Dec 16 04:34:09 2010
@@ -26,11 +26,12 @@ import java.util.HashSet;
 import java.util.Set;
 
 import javax.interceptor.Interceptor;
-import org.apache.openejb.OpenEJBException;
+
 import org.apache.openejb.assembler.classic.AppInfo;
 import org.apache.openejb.assembler.classic.BeansInfo;
 import org.apache.openejb.assembler.classic.EjbJarInfo;
 import org.apache.openejb.assembler.classic.EnterpriseBeanInfo;
+import org.apache.webbeans.config.WebBeansContext;
 import org.apache.webbeans.decorator.DecoratorsManager;
 import org.apache.webbeans.exception.WebBeansConfigurationException;
 import org.apache.webbeans.inject.AlternativesManager;
@@ -56,9 +57,9 @@ public class CdiScanner implements Scann
         AppInfo appInfo = startupObject.getAppInfo();
         ClassLoader classLoader = startupObject.getAppContext().getClassLoader();
 
-        final AlternativesManager alternativesManager = AlternativesManager.getInstance();
-        final DecoratorsManager decoratorsManager = DecoratorsManager.getInstance();
-        final InterceptorsManager interceptorsManager = InterceptorsManager.getInstance();
+        final AlternativesManager alternativesManager = WebBeansContext.getInstance().getAlternativesManager();
+        final DecoratorsManager decoratorsManager = WebBeansContext.getInstance().getDecoratorsManager();
+        final InterceptorsManager interceptorsManager = WebBeansContext.getInstance().getInterceptorsManager();
 
         final HashSet<String> ejbClasses = new HashSet<String>();
 

Modified: openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/cdi/OpenEJBLifecycle.java
URL: http://svn.apache.org/viewvc/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/cdi/OpenEJBLifecycle.java?rev=1049779&r1=1049778&r2=1049779&view=diff
==============================================================================
--- openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/cdi/OpenEJBLifecycle.java
(original)
+++ openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/cdi/OpenEJBLifecycle.java
Thu Dec 16 04:34:09 2010
@@ -32,20 +32,16 @@ import javax.enterprise.inject.spi.BeanM
 import org.apache.openejb.BeanContext;
 import org.apache.openejb.assembler.classic.Assembler;
 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.ejb.common.util.EjbUtility;
 import org.apache.webbeans.intercept.InterceptorData;
-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.ProcessAnnotatedTypeImpl;
 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;
@@ -119,10 +115,10 @@ public class OpenEJBLifecycle implements
         beforeStartApplication(startupObject);
 
         //Load all plugins
-        PluginLoader.getInstance().startUp();
+        WebBeansContext.getInstance().getPluginLoader().startUp();
 
         //Get Plugin
-        CdiPlugin cdiPlugin = (CdiPlugin) PluginLoader.getInstance().getEjbPlugin();
+        CdiPlugin cdiPlugin = (CdiPlugin) WebBeansContext.getInstance().getPluginLoader().getEjbPlugin();
 
         cdiPlugin.setAppContext(stuff.getAppContext());
 
@@ -139,7 +135,7 @@ public class OpenEJBLifecycle implements
         //Deploy the beans
         try {
             //Load Extensions
-            ExtensionLoader.getInstance().loadExtensionServices();
+            WebBeansContext.getInstance().getExtensionLoader().loadExtensionServices();
 
             //Initialize contexts
             this.contextsService.init(startupObject);
@@ -179,7 +175,7 @@ public class OpenEJBLifecycle implements
                 final Class implClass = beanContext.getBeanClass();
 
                 //Define annotation type
-                AnnotatedType<?> annotatedType = AnnotatedElementFactory.getInstance().newAnnotatedType(implClass);
+                AnnotatedType<?> annotatedType = WebBeansContext.getInstance().getAnnotatedElementFactory().newAnnotatedType(implClass);
 
                 //Fires ProcessAnnotatedType
                 ProcessAnnotatedTypeImpl<?> processAnnotatedEvent = WebBeansUtil.fireProcessAnnotatedTypeEvent(annotatedType);
@@ -248,7 +244,7 @@ public class OpenEJBLifecycle implements
         // Start from the class
         for (Class<?> implClass : managedBeans) {
             //Define annotation type
-            AnnotatedType<?> annotatedType = AnnotatedElementFactory.getInstance().newAnnotatedType(implClass);
+            AnnotatedType<?> annotatedType = WebBeansContext.getInstance().getAnnotatedElementFactory().newAnnotatedType(implClass);
 
             //Fires ProcessAnnotatedType
             ProcessAnnotatedTypeImpl<?> processAnnotatedEvent = WebBeansUtil.fireProcessAnnotatedTypeEvent(annotatedType);
@@ -282,22 +278,22 @@ public class OpenEJBLifecycle implements
             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: openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/cdi/ThreadSingletonServiceImpl.java
URL: http://svn.apache.org/viewvc/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/cdi/ThreadSingletonServiceImpl.java?rev=1049779&r1=1049778&r2=1049779&view=diff
==============================================================================
--- openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/cdi/ThreadSingletonServiceImpl.java
(original)
+++ openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/cdi/ThreadSingletonServiceImpl.java
Thu Dec 16 04:34:09 2010
@@ -23,8 +23,8 @@ package org.apache.openejb.cdi;
 import org.apache.openejb.util.LogCategory;
 import org.apache.openejb.util.Logger;
 import org.apache.webbeans.config.OpenWebBeansConfiguration;
+import org.apache.webbeans.config.WebBeansContext;
 import org.apache.webbeans.corespi.ServiceLoader;
-import org.apache.webbeans.exception.WebBeansException;
 import org.apache.webbeans.spi.ContainerLifecycle;
 import org.apache.webbeans.spi.ResourceInjectionService;
 
@@ -50,7 +50,7 @@ public class ThreadSingletonServiceImpl 
         startupObject.getAppContext().set(OWBContext.class, owbContext);
         Object old = contextEntered(owbContext);
         try {
-            setConfiguration(OpenWebBeansConfiguration.getInstance());
+            setConfiguration(WebBeansContext.getInstance().getOpenWebBeansConfiguration());
             try {
                 ServiceLoader.getService(ContainerLifecycle.class).startApplication(startupObject);
             } catch (Exception e) {



Mime
View raw message