openwebbeans-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From strub...@apache.org
Subject svn commit: r1090721 - in /openwebbeans/trunk/webbeans-impl/src: main/java/org/apache/webbeans/container/ test/java/org/apache/webbeans/newtests/portable/scopeextension/
Date Sun, 10 Apr 2011 00:14:21 GMT
Author: struberg
Date: Sun Apr 10 00:14:20 2011
New Revision: 1090721

URL: http://svn.apache.org/viewvc?rev=1090721&view=rev
Log:
OWB-561 fixed problem when registering multiple Contexts for the same scope

Modified:
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/container/BeanManagerImpl.java
    openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/portable/scopeextension/ExternalTestScopeContext.java
    openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/portable/scopeextension/ExternalTestScopeExtension.java

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=1090721&r1=1090720&r2=1090721&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
Sun Apr 10 00:14:20 2011
@@ -703,6 +703,7 @@ public class BeanManagerImpl implements 
                 contextList.add(context);
 
                 contextMap.put(scopeType, contextList);
+                singleContextMap.remove(scopeType);
             }
         }
         else

Modified: openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/portable/scopeextension/ExternalTestScopeContext.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/portable/scopeextension/ExternalTestScopeContext.java?rev=1090721&r1=1090720&r2=1090721&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/portable/scopeextension/ExternalTestScopeContext.java
(original)
+++ openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/portable/scopeextension/ExternalTestScopeContext.java
Sun Apr 10 00:14:20 2011
@@ -32,6 +32,12 @@ public class ExternalTestScopeContext im
 {
     private static final Map<Contextual<?>, Object> instances = new HashMap<Contextual<?>,
Object>();
     
+    private boolean active;
+    
+    public ExternalTestScopeContext(boolean active)
+    {
+        this.active = active;
+    }
     
     @SuppressWarnings("unchecked")
     @Override
@@ -62,7 +68,7 @@ public class ExternalTestScopeContext im
     @Override
     public boolean isActive()
     {
-        return true;
+        return active;
     }
     
     public void endContext(@Observes BeforeShutdown beforeShutdown)

Modified: openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/portable/scopeextension/ExternalTestScopeExtension.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/portable/scopeextension/ExternalTestScopeExtension.java?rev=1090721&r1=1090720&r2=1090721&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/portable/scopeextension/ExternalTestScopeExtension.java
(original)
+++ openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/portable/scopeextension/ExternalTestScopeExtension.java
Sun Apr 10 00:14:20 2011
@@ -34,6 +34,7 @@ public class ExternalTestScopeExtension 
     
     public void registerViewContext(@Observes AfterBeanDiscovery afterBeanDiscovery)
     {
-        afterBeanDiscovery.addContext(new ExternalTestScopeContext());
+        afterBeanDiscovery.addContext(new ExternalTestScopeContext(true));
+        afterBeanDiscovery.addContext(new ExternalTestScopeContext(false));
     }
 }



Mime
View raw message