tomee-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rmannibu...@apache.org
Subject svn commit: r1412082 - in /openejb/trunk/openejb: container/openejb-core/src/main/java/org/apache/openejb/cdi/CdiAppContextsService.java tomee/tomee-catalina/src/main/java/org/apache/tomee/catalina/WebBeansListener.java
Date Wed, 21 Nov 2012 12:58:36 GMT
Author: rmannibucau
Date: Wed Nov 21 12:58:35 2012
New Revision: 1412082

URL: http://svn.apache.org/viewvc?rev=1412082&view=rev
Log:
TOMEE-598 endcontext for @ApplicationScoped and @Singleton

Modified:
    openejb/trunk/openejb/container/openejb-core/src/main/java/org/apache/openejb/cdi/CdiAppContextsService.java
    openejb/trunk/openejb/tomee/tomee-catalina/src/main/java/org/apache/tomee/catalina/WebBeansListener.java

Modified: openejb/trunk/openejb/container/openejb-core/src/main/java/org/apache/openejb/cdi/CdiAppContextsService.java
URL: http://svn.apache.org/viewvc/openejb/trunk/openejb/container/openejb-core/src/main/java/org/apache/openejb/cdi/CdiAppContextsService.java?rev=1412082&r1=1412081&r2=1412082&view=diff
==============================================================================
--- openejb/trunk/openejb/container/openejb-core/src/main/java/org/apache/openejb/cdi/CdiAppContextsService.java
(original)
+++ openejb/trunk/openejb/container/openejb-core/src/main/java/org/apache/openejb/cdi/CdiAppContextsService.java
Wed Nov 21 12:58:35 2012
@@ -20,7 +20,13 @@ import org.apache.openejb.util.LogCatego
 import org.apache.openejb.util.Logger;
 import org.apache.webbeans.config.OWBLogConst;
 import org.apache.webbeans.config.WebBeansContext;
-import org.apache.webbeans.context.*;
+import org.apache.webbeans.context.AbstractContextsService;
+import org.apache.webbeans.context.ApplicationContext;
+import org.apache.webbeans.context.ConversationContext;
+import org.apache.webbeans.context.DependentContext;
+import org.apache.webbeans.context.RequestContext;
+import org.apache.webbeans.context.SessionContext;
+import org.apache.webbeans.context.SingletonContext;
 import org.apache.webbeans.conversation.ConversationImpl;
 import org.apache.webbeans.conversation.ConversationManager;
 import org.apache.webbeans.el.ELContextStore;
@@ -30,7 +36,13 @@ import org.apache.webbeans.web.context.S
 import org.apache.webbeans.web.context.SessionContextManager;
 import org.apache.webbeans.web.intercept.RequestScopedBeanInterceptorHandler;
 
-import javax.enterprise.context.*;
+import javax.enterprise.context.ApplicationScoped;
+import javax.enterprise.context.ContextException;
+import javax.enterprise.context.Conversation;
+import javax.enterprise.context.ConversationScoped;
+import javax.enterprise.context.Dependent;
+import javax.enterprise.context.RequestScoped;
+import javax.enterprise.context.SessionScoped;
 import javax.enterprise.context.spi.Context;
 import javax.inject.Singleton;
 import javax.servlet.ServletRequestEvent;
@@ -87,12 +99,12 @@ public class CdiAppContextsService exten
         startContext(Singleton.class, initializeObject);
     }
 
-    public void destroy(Object destroyObjectUnused) {
-//        //Destroy application context
-//        endContext(ApplicationScoped.class, destroyObject);
+    public void destroy(final Object destroyObject) {
+        //Destroy application context
+        endContext(ApplicationScoped.class, destroyObject);
 //
-//        //Destroy singleton context
-//        endContext(Singleton.class, destroyObject);
+        //Destroy singleton context
+        endContext(Singleton.class, destroyObject);
 
 
         //Remove thread locals
@@ -340,16 +352,14 @@ public class CdiAppContextsService exten
     //we don't have initApplicationContext
 
     private void destroyApplicationContext() {
-        // look for thread local
-        // this can be set by initRequestContext
-//        this.currentApplicationContext.destroy();
+        applicationContext.destroy();
     }
 
     private void initSingletonContext() {
     }
 
     private void destroySingletonContext() {
-//        this.currentSingletonContext.destroy();
+        singletonContext.destroy();
     }
 
     /**

Modified: openejb/trunk/openejb/tomee/tomee-catalina/src/main/java/org/apache/tomee/catalina/WebBeansListener.java
URL: http://svn.apache.org/viewvc/openejb/trunk/openejb/tomee/tomee-catalina/src/main/java/org/apache/tomee/catalina/WebBeansListener.java?rev=1412082&r1=1412081&r2=1412082&view=diff
==============================================================================
--- openejb/trunk/openejb/tomee/tomee-catalina/src/main/java/org/apache/tomee/catalina/WebBeansListener.java
(original)
+++ openejb/trunk/openejb/tomee/tomee-catalina/src/main/java/org/apache/tomee/catalina/WebBeansListener.java
Wed Nov 21 12:58:35 2012
@@ -30,6 +30,7 @@ import org.apache.webbeans.spi.FailOverS
 import org.apache.webbeans.util.WebBeansUtil;
 import org.apache.webbeans.web.context.WebContextsService;
 
+import javax.enterprise.context.ApplicationScoped;
 import javax.enterprise.context.RequestScoped;
 import javax.enterprise.context.SessionScoped;
 import javax.servlet.ServletContextEvent;
@@ -213,5 +214,6 @@ public class WebBeansListener implements
 
     @Override
     public void contextDestroyed(ServletContextEvent servletContextEvent) {
+        // no-op
     }
 }



Mime
View raw message