You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tomee.apache.org by rm...@apache.org on 2013/02/13 13:24:28 UTC

svn commit: r1445569 - /tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/cdi/CdiAppContextsService.java

Author: rmannibucau
Date: Wed Feb 13 12:24:28 2013
New Revision: 1445569

URL: http://svn.apache.org/r1445569
Log:
TOMEE-772 force app context to be active even after a restart

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

Modified: tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/cdi/CdiAppContextsService.java
URL: http://svn.apache.org/viewvc/tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/cdi/CdiAppContextsService.java?rev=1445569&r1=1445568&r2=1445569&view=diff
==============================================================================
--- tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/cdi/CdiAppContextsService.java (original)
+++ tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/cdi/CdiAppContextsService.java Wed Feb 13 12:24:28 2013
@@ -178,9 +178,9 @@ public class CdiAppContextsService exten
             } else if (scopeType.equals(SessionScoped.class)) {
                 initSessionContext((HttpSession) startParameter);
             } else if (scopeType.equals(ApplicationScoped.class)) {
-                // Do nothing
+                initApplicationContext();
             } else if (scopeType.equals(Dependent.class)) {
-                // Do nothing
+                initSingletonContext();
             } else if (scopeType.equals(Singleton.class)) {
                 // Do nothing
             } else if (supportsConversation() && scopeType.equals(ConversationScoped.class)) {
@@ -195,6 +195,14 @@ public class CdiAppContextsService exten
         }
     }
 
+    private void initSingletonContext() {
+        singletonContext.setActive(true);
+    }
+
+    private void initApplicationContext() { // in case contexts are stop/start
+        applicationContext.setActive(true);
+    }
+
     @Override
     public boolean supportsContext(Class<? extends Annotation> scopeType) {
         return scopeType.equals(RequestScoped.class)