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 2015/05/22 17:21:23 UTC

tomee git commit: no more need of ThreadSingletonService#sessionContextClass

Repository: tomee
Updated Branches:
  refs/heads/master 6b862f2d2 -> b6e55f33e


no more need of ThreadSingletonService#sessionContextClass


Project: http://git-wip-us.apache.org/repos/asf/tomee/repo
Commit: http://git-wip-us.apache.org/repos/asf/tomee/commit/b6e55f33
Tree: http://git-wip-us.apache.org/repos/asf/tomee/tree/b6e55f33
Diff: http://git-wip-us.apache.org/repos/asf/tomee/diff/b6e55f33

Branch: refs/heads/master
Commit: b6e55f33ef9c98a4355b7b1af4a9d122240a4a6f
Parents: 6b862f2
Author: Romain Manni-Bucau <rm...@apache.org>
Authored: Fri May 22 17:21:16 2015 +0200
Committer: Romain Manni-Bucau <rm...@apache.org>
Committed: Fri May 22 17:21:16 2015 +0200

----------------------------------------------------------------------
 .../openejb/cdi/ThreadSingletonService.java      |  2 --
 .../openejb/cdi/ThreadSingletonServiceImpl.java  | 19 ++++---------------
 2 files changed, 4 insertions(+), 17 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tomee/blob/b6e55f33/container/openejb-core/src/main/java/org/apache/openejb/cdi/ThreadSingletonService.java
----------------------------------------------------------------------
diff --git a/container/openejb-core/src/main/java/org/apache/openejb/cdi/ThreadSingletonService.java b/container/openejb-core/src/main/java/org/apache/openejb/cdi/ThreadSingletonService.java
index 99d2edb..3d70a39 100644
--- a/container/openejb-core/src/main/java/org/apache/openejb/cdi/ThreadSingletonService.java
+++ b/container/openejb-core/src/main/java/org/apache/openejb/cdi/ThreadSingletonService.java
@@ -30,6 +30,4 @@ public interface ThreadSingletonService extends SingletonService<WebBeansContext
     Object contextEntered(WebBeansContext newOWBContext);
 
     void contextExited(Object oldOWBContext);
-
-    String sessionContextClass();
 }

http://git-wip-us.apache.org/repos/asf/tomee/blob/b6e55f33/container/openejb-core/src/main/java/org/apache/openejb/cdi/ThreadSingletonServiceImpl.java
----------------------------------------------------------------------
diff --git a/container/openejb-core/src/main/java/org/apache/openejb/cdi/ThreadSingletonServiceImpl.java b/container/openejb-core/src/main/java/org/apache/openejb/cdi/ThreadSingletonServiceImpl.java
index cf845c8..e627adf 100644
--- a/container/openejb-core/src/main/java/org/apache/openejb/cdi/ThreadSingletonServiceImpl.java
+++ b/container/openejb-core/src/main/java/org/apache/openejb/cdi/ThreadSingletonServiceImpl.java
@@ -64,7 +64,7 @@ public class ThreadSingletonServiceImpl implements ThreadSingletonService {
 
     public static final Logger logger = Logger.getInstance(LogCategory.OPENEJB_STARTUP, ThreadSingletonServiceImpl.class);
 
-    private String sessionContextClass;
+    private Object lazyInit;
     private volatile boolean cachedApplicationScoped;
     private volatile boolean cachedRequestScoped;
 
@@ -74,10 +74,10 @@ public class ThreadSingletonServiceImpl implements ThreadSingletonService {
 
     @Override
     public void initialize(final StartupObject startupObject) {
-        if (sessionContextClass == null) { // done here cause Cdibuilder trigger this class loading and that's from Warmup so we can't init too early config
+        if (lazyInit == null) { // done here cause Cdibuilder trigger this class loading and that's from Warmup so we can't init too early config
             synchronized (this) {
-                if (sessionContextClass == null) {
-                    sessionContextClass = SystemInstance.get().getProperty("openejb.session-context", "").trim();
+                if (lazyInit == null) {
+                    lazyInit = new Object();
                     cachedApplicationScoped = "true".equalsIgnoreCase(SystemInstance.get().getProperty("openejb.cdi.applicationScope.cached", "true").trim());
                     cachedRequestScoped = "true".equalsIgnoreCase(SystemInstance.get().getProperty("openejb.cdi.requestScope.cached", "true").trim());
                 }
@@ -316,15 +316,4 @@ public class ThreadSingletonServiceImpl implements ThreadSingletonService {
             ctx.clear();
         }
     }
-
-    @Override
-    public String sessionContextClass() {
-        if (!sessionContextClass.isEmpty()) {
-            if ("http".equals(sessionContextClass)) { // easy way to manage this config
-                return "org.apache.tomee.catalina.cdi.SessionContextBackedByHttpSession";
-            }
-            return sessionContextClass;
-        }
-        return null;
-    }
 }