geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dblev...@apache.org
Subject svn commit: r1135021 - in /geronimo/server/trunk/plugins: openejb/geronimo-openejb-builder/src/main/java/org/apache/geronimo/openejb/deployment/ openejb/geronimo-openejb/src/main/java/org/apache/geronimo/openejb/ tomcat/geronimo-tomcat7-builder/src/mai...
Date Mon, 13 Jun 2011 03:41:00 GMT
Author: dblevins
Date: Mon Jun 13 03:40:59 2011
New Revision: 1135021

URL: http://svn.apache.org/viewvc?rev=1135021&view=rev
Log:
David Jencks' workaround for not re-initializing the OWB context in the servlet side of things
when there is one in the app

Modified:
    geronimo/server/trunk/plugins/openejb/geronimo-openejb-builder/src/main/java/org/apache/geronimo/openejb/deployment/EjbModuleBuilder.java
    geronimo/server/trunk/plugins/openejb/geronimo-openejb/src/main/java/org/apache/geronimo/openejb/ThreadSingletonServiceAdapter.java
    geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7-builder/src/main/java/org/apache/geronimo/tomcat/deployment/TomcatModuleBuilder.java

Modified: geronimo/server/trunk/plugins/openejb/geronimo-openejb-builder/src/main/java/org/apache/geronimo/openejb/deployment/EjbModuleBuilder.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/openejb/geronimo-openejb-builder/src/main/java/org/apache/geronimo/openejb/deployment/EjbModuleBuilder.java?rev=1135021&r1=1135020&r2=1135021&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/openejb/geronimo-openejb-builder/src/main/java/org/apache/geronimo/openejb/deployment/EjbModuleBuilder.java
(original)
+++ geronimo/server/trunk/plugins/openejb/geronimo-openejb-builder/src/main/java/org/apache/geronimo/openejb/deployment/EjbModuleBuilder.java
Mon Jun 13 03:40:59 2011
@@ -805,7 +805,16 @@ public class EjbModuleBuilder implements
         } catch (GBeanAlreadyExistsException e) {
             throw new DeploymentException("Could not add ejb module gbean", e);
         }
-        module.getSharedContext().put(SharedOwbContext.class, ejbModuleGBeanData);
+        //commented out code is for sharing owb context of an ejb module in a war with the
war
+//        module.getSharedContext().put(SharedOwbContext.class, ejbModuleGBeanData);
+        //this shares the OWB context over the whole ear
+        Module<?,?> m = module;
+        while (m.getParentModule() != null) {
+            m = m.getParentModule();
+        }
+        if (m.getSharedContext().get(SharedOwbContext.class) == null) {
+            m.getSharedContext().put(SharedOwbContext.class, ejbModuleGBeanData);
+        }
 
         for (ModuleBuilderExtension builder : moduleBuilderExtensions) {
             try {

Modified: geronimo/server/trunk/plugins/openejb/geronimo-openejb/src/main/java/org/apache/geronimo/openejb/ThreadSingletonServiceAdapter.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/openejb/geronimo-openejb/src/main/java/org/apache/geronimo/openejb/ThreadSingletonServiceAdapter.java?rev=1135021&r1=1135020&r2=1135021&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/openejb/geronimo-openejb/src/main/java/org/apache/geronimo/openejb/ThreadSingletonServiceAdapter.java
(original)
+++ geronimo/server/trunk/plugins/openejb/geronimo-openejb/src/main/java/org/apache/geronimo/openejb/ThreadSingletonServiceAdapter.java
Mon Jun 13 03:40:59 2011
@@ -66,8 +66,9 @@ public class ThreadSingletonServiceAdapt
                 } finally {
                     contextExited(null);
                 }
-                // an existing OWBConfiguration will have already been initialized
+                startupObject.getAppContext().set(WebBeansContext.class, webBeansContext);
             } else {
+                // an existing OWBConfiguration will have already been initialized
                 startupObject.getAppContext().set(WebBeansContext.class, (WebBeansContext)
old);
             }
         } finally {

Modified: geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7-builder/src/main/java/org/apache/geronimo/tomcat/deployment/TomcatModuleBuilder.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7-builder/src/main/java/org/apache/geronimo/tomcat/deployment/TomcatModuleBuilder.java?rev=1135021&r1=1135020&r2=1135021&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7-builder/src/main/java/org/apache/geronimo/tomcat/deployment/TomcatModuleBuilder.java
(original)
+++ geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7-builder/src/main/java/org/apache/geronimo/tomcat/deployment/TomcatModuleBuilder.java
Mon Jun 13 03:40:59 2011
@@ -681,14 +681,26 @@ public class TomcatModuleBuilder extends
             for (ModuleBuilderExtension mbe : moduleBuilderExtensions) {
                 mbe.addGBeans(earContext, module, bundle, repository);
             }
-            LinkedHashSet<Module<?, ?>> submodules = module.getModules();
-            for (Module<?, ?> subModule: submodules) {
-                if (subModule.getSharedContext().get(SharedOwbContext.class) != null) {
-                    GBeanData data = (GBeanData) subModule.getSharedContext().get(SharedOwbContext.class);
-                    AbstractName name = data.getAbstractName();
-                    webModuleData.setReferencePattern("SharedOwbContext", name);
-                }
+            //commented out code shares OWB context between ejb submodules and this web module.
+//            LinkedHashSet<Module<?, ?>> submodules = module.getModules();
+//            for (Module<?, ?> subModule: submodules) {
+//                if (subModule.getSharedContext().get(SharedOwbContext.class) != null) {
+//                    GBeanData data = (GBeanData) subModule.getSharedContext().get(SharedOwbContext.class);
+//                    AbstractName name = data.getAbstractName();
+//                    webModuleData.setReferencePattern("SharedOwbContext", name);
+//                }
+//            }
+            //This shares a single OWB context for the whole ear
+            Module<?,?> m = module;
+            while (m.getParentModule() != null) {
+                m = m.getParentModule();
             }
+            if (m.getSharedContext().get(SharedOwbContext.class) != null) {
+                GBeanData data = (GBeanData) m.getSharedContext().get(SharedOwbContext.class);
+                AbstractName name = data.getAbstractName();
+                webModuleData.setReferencePattern("SharedOwbContext", name);
+            }
+
             if(tomcatWebApp.isSetSecurityRealmName()) {
                 webModuleData.setReferencePattern("applicationPolicyConfigurationManager",
EARContext.JACC_MANAGER_NAME_KEY.get(earContext.getGeneralData()));
             }



Mime
View raw message