tomee-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dblev...@apache.org
Subject svn commit: r1139975 - /openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/assembler/classic/Assembler.java
Date Mon, 27 Jun 2011 00:12:26 GMT
Author: dblevins
Date: Mon Jun 27 00:12:26 2011
New Revision: 1139975

URL: http://svn.apache.org/viewvc?rev=1139975&view=rev
Log:
Ensure a webbeans context is set on the AppContext

Modified:
    openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/assembler/classic/Assembler.java

Modified: openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/assembler/classic/Assembler.java
URL: http://svn.apache.org/viewvc/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/assembler/classic/Assembler.java?rev=1139975&r1=1139974&r2=1139975&view=diff
==============================================================================
--- openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/assembler/classic/Assembler.java
(original)
+++ openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/assembler/classic/Assembler.java
Mon Jun 27 00:12:26 2011
@@ -106,6 +106,7 @@ import org.apache.openejb.util.Reference
 import org.apache.openejb.util.SafeToolkit;
 import org.apache.openejb.util.proxy.ProxyFactory;
 import org.apache.openejb.util.proxy.ProxyManager;
+import org.apache.webbeans.config.WebBeansContext;
 import org.apache.xbean.finder.ResourceFinder;
 import org.apache.xbean.recipe.ObjectRecipe;
 import org.apache.xbean.recipe.Option;
@@ -689,6 +690,8 @@ public class Assembler extends Assembler
 
             new CdiBuilder().build(appInfo, appContext, allDeployments);
 
+            ensureWebBeansContext(appContext);
+
             // now that everything is configured, deploy to the container
             if (start) {
                 // deploy
@@ -794,6 +797,15 @@ public class Assembler extends Assembler
         }
     }
 
+    private void ensureWebBeansContext(AppContext appContext) {
+        WebBeansContext webBeansContext = appContext.get(WebBeansContext.class);
+        if (webBeansContext == null) webBeansContext = appContext.getWebBeansContext();
+        if (webBeansContext == null) webBeansContext = new WebBeansContext();
+
+        appContext.set(WebBeansContext.class, webBeansContext);
+        appContext.setWebBeansContext(webBeansContext);
+    }
+
     private TransactionPolicyFactory createTransactionPolicyFactory(EjbJarInfo ejbJar, ClassLoader
classLoader) {
         TransactionPolicyFactory factory = null;
 



Mime
View raw message