openwebbeans-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gerdo...@apache.org
Subject svn commit: r939043 - /openwebbeans/trunk/webbeans-web/src/main/java/org/apache/webbeans/web/context/WebContextsService.java
Date Wed, 28 Apr 2010 18:28:23 GMT
Author: gerdogdu
Date: Wed Apr 28 18:28:23 2010
New Revision: 939043

URL: http://svn.apache.org/viewvc?rev=939043&view=rev
Log:
update threadlocal usage of application and singleton contexts

Modified:
    openwebbeans/trunk/webbeans-web/src/main/java/org/apache/webbeans/web/context/WebContextsService.java

Modified: openwebbeans/trunk/webbeans-web/src/main/java/org/apache/webbeans/web/context/WebContextsService.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-web/src/main/java/org/apache/webbeans/web/context/WebContextsService.java?rev=939043&r1=939042&r2=939043&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-web/src/main/java/org/apache/webbeans/web/context/WebContextsService.java
(original)
+++ openwebbeans/trunk/webbeans-web/src/main/java/org/apache/webbeans/web/context/WebContextsService.java
Wed Apr 28 18:28:23 2010
@@ -429,11 +429,18 @@ public class WebContextsService extends 
         ApplicationContext context = null;
         
         //Looking the context from saved context
+        //This is used in real web applications
         if(servletContext != null)
         {
             context = currentApplicationContexts.get(servletContext);   
         }
         
+        //using in tests
+        if(context == null)
+        {
+            context = getApplicationContext();
+        }
+        
         //Destroy context
         if(context != null)
         {
@@ -494,6 +501,12 @@ public class WebContextsService extends 
             context = currentSingletonContexts.get(servletContext);
         }
         
+        //using in tests
+        if(context == null)
+        {
+            context = getSingletonContext();
+        }        
+        
         //context is not null
         //destroy it
         if(context != null)



Mime
View raw message