openwebbeans-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From strub...@apache.org
Subject svn commit: r1436581 - in /openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans: config/WebBeansContext.java container/BeanManagerImpl.java inject/AbstractInjectable.java lifecycle/StandaloneLifeCycle.java portable/InstanceProducer.java
Date Mon, 21 Jan 2013 19:59:01 GMT
Author: struberg
Date: Mon Jan 21 19:59:00 2013
New Revision: 1436581

URL: http://svn.apache.org/viewvc?rev=1436581&view=rev
Log:
OWB-744 fix deprecated methods usage

Modified:
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/config/WebBeansContext.java
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/container/BeanManagerImpl.java
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/inject/AbstractInjectable.java
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/lifecycle/StandaloneLifeCycle.java
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/portable/InstanceProducer.java

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/config/WebBeansContext.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/config/WebBeansContext.java?rev=1436581&r1=1436580&r2=1436581&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/config/WebBeansContext.java
(original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/config/WebBeansContext.java
Mon Jan 21 19:59:00 2013
@@ -159,7 +159,6 @@ public class WebBeansContext
         managerMap.put(InterceptorResolutionService.class, interceptorResolutionService);
     }
 
-    @Deprecated
     public static WebBeansContext getInstance()
     {
         WebBeansContext webBeansContext = WebBeansFinder.getSingletonInstance();

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/container/BeanManagerImpl.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/container/BeanManagerImpl.java?rev=1436581&r1=1436580&r2=1436581&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/container/BeanManagerImpl.java
(original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/container/BeanManagerImpl.java
Mon Jan 21 19:59:00 2013
@@ -272,7 +272,7 @@ public class BeanManagerImpl implements 
     {
         Asserts.assertNotNull(scopeType, "scopeType paramter can not be null");
 
-        Context standardContext = webBeansContext.getContextFactory().getStandardContext(scopeType);
+        Context standardContext = webBeansContext.getContextsService().getCurrentContext(scopeType);
 
         if(standardContext != null && standardContext.isActive())
         {

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=1436581&r1=1436580&r2=1436581&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
Mon Jan 21 19:59:00 2013
@@ -63,11 +63,6 @@ public abstract class AbstractInjectable
     
     protected final CreationalContextImpl<?> creationalContext;
 
-    /**
-     * @deprecated TODO remove this public ThreadLocal!
-     */
-    public static ThreadLocal<Object> instanceUnderInjection = new ThreadLocal<Object>();
-
     protected AbstractInjectable(Producer<?> owner, CreationalContextImpl<?>
creationalContext)
     {
         this.owner = owner;

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/lifecycle/StandaloneLifeCycle.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/lifecycle/StandaloneLifeCycle.java?rev=1436581&r1=1436580&r2=1436581&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/lifecycle/StandaloneLifeCycle.java
(original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/lifecycle/StandaloneLifeCycle.java
Mon Jan 21 19:59:00 2013
@@ -18,6 +18,11 @@
  */
 package org.apache.webbeans.lifecycle;
 
+import javax.enterprise.context.ApplicationScoped;
+import javax.enterprise.context.ConversationScoped;
+import javax.enterprise.context.RequestScoped;
+import javax.enterprise.context.SessionScoped;
+import javax.inject.Singleton;
 import java.util.Properties;
 import java.util.logging.Logger;
 
@@ -45,21 +50,21 @@ public class StandaloneLifeCycle extends
     @Override
     public void beforeStartApplication(Object object)
     {
-        webBeansContext.getContextFactory().initRequestContext(null);
-        webBeansContext.getContextFactory().initSessionContext(null);
-        webBeansContext.getContextFactory().initConversationContext(null);
-        webBeansContext.getContextFactory().initApplicationContext(null);
-        webBeansContext.getContextFactory().initSingletonContext(null);
+        webBeansContext.getContextsService().startContext(RequestScoped.class, null);
+        webBeansContext.getContextsService().startContext(SessionScoped.class, null);
+        webBeansContext.getContextsService().startContext(ConversationScoped.class, null);
+        webBeansContext.getContextsService().startContext(ApplicationScoped.class, null);
+        webBeansContext.getContextsService().startContext(Singleton.class, null);
     }
 
     @Override
     public void beforeStopApplication(Object endObject)
     {
-        webBeansContext.getContextFactory().destroyRequestContext(null);
-        webBeansContext.getContextFactory().destroySessionContext(null);
-        webBeansContext.getContextFactory().destroyConversationContext();
-        webBeansContext.getContextFactory().destroyApplicationContext(null);
-        webBeansContext.getContextFactory().destroySingletonContext(null);
+        webBeansContext.getContextsService().endContext(RequestScoped.class, null);
+        webBeansContext.getContextsService().endContext(SessionScoped.class, null);
+        webBeansContext.getContextsService().endContext(ConversationScoped.class, null);
+        webBeansContext.getContextsService().endContext(ApplicationScoped.class, null);
+        webBeansContext.getContextsService().endContext(Singleton.class, null);
 
         // clean up the EL caches after each request
         ELContextStore elStore = ELContextStore.getInstance(false);

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/portable/InstanceProducer.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/portable/InstanceProducer.java?rev=1436581&r1=1436580&r2=1436581&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/portable/InstanceProducer.java
(original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/portable/InstanceProducer.java
Mon Jan 21 19:59:00 2013
@@ -28,7 +28,6 @@ import javax.enterprise.inject.Instance;
 import javax.enterprise.inject.spi.InjectionPoint;
 
 import org.apache.webbeans.config.WebBeansContext;
-import org.apache.webbeans.inject.AbstractInjectable;
 import org.apache.webbeans.inject.instance.InstanceImpl;
 
 public class InstanceProducer<T> extends AbstractProducer<Instance<T>>
@@ -67,8 +66,6 @@ public class InstanceProducer<T> extends
                 type = this.returnType;
             }
 
-            Object ownerInstance = AbstractInjectable.instanceUnderInjection.get();
-
             Instance<T> instance = new InstanceImpl<T>(type, injectionPoint,
webBeansContext, creationalContext, qualifiers.toArray(new Annotation[qualifiers.size()]));
             
             return instance;



Mime
View raw message