geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From djen...@apache.org
Subject svn commit: r950397 [1/4] - in /geronimo/server/trunk/plugins: activemq/ bval/geronimo-bval-builder/src/main/java/org/apache/geronimo/bval/deployment/ client/client/src/main/history/ client/geronimo-client-builder/src/main/java/org/apache/geronimo/clie...
Date Wed, 02 Jun 2010 07:35:26 GMT
Author: djencks
Date: Wed Jun  2 07:35:24 2010
New Revision: 950397

URL: http://svn.apache.org/viewvc?rev=950397&view=rev
Log:
GERONIMO-5025, GERONIMO-5117. Make jndi supported directly by Modules and straighten out which contexts are shared when.

Modified:
    geronimo/server/trunk/plugins/activemq/pom.xml
    geronimo/server/trunk/plugins/bval/geronimo-bval-builder/src/main/java/org/apache/geronimo/bval/deployment/BValNamingBuilder.java
    geronimo/server/trunk/plugins/client/client/src/main/history/dependencies.xml
    geronimo/server/trunk/plugins/client/geronimo-client-builder/src/main/java/org/apache/geronimo/client/builder/AppClientModuleBuilder.java
    geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-builder-1_6/src/main/java/org/apache/geronimo/connector/deployment/AdminObjectRefBuilder.java
    geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-builder-1_6/src/main/java/org/apache/geronimo/connector/deployment/ConnectorModuleBuilder.java
    geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-builder-1_6/src/main/java/org/apache/geronimo/connector/deployment/ResourceRefBuilder.java
    geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-builder-1_6/src/main/java/org/apache/geronimo/datasource/deployment/DataSourceBuilder.java
    geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-builder-1_6/src/test/java/org/apache/geronimo/connector/deployment/ConnectorModuleBuilderTest.java
    geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-builder-1_6/src/test/java/org/apache/geronimo/connector/deployment/MessageDestinationTest.java
    geronimo/server/trunk/plugins/connector-1_6/transaction-1_6/src/main/history/dependencies.xml
    geronimo/server/trunk/plugins/corba/geronimo-corba-builder/src/main/java/org/apache/geronimo/corba/deployment/CorbaRefBuilder.java
    geronimo/server/trunk/plugins/corba/geronimo-corba-builder/src/main/java/org/apache/geronimo/corba/deployment/OpenEjbCorbaRefBuilder.java
    geronimo/server/trunk/plugins/j2ee/geronimo-j2ee-builder/src/main/java/org/apache/geronimo/j2ee/deployment/AppClientModule.java
    geronimo/server/trunk/plugins/j2ee/geronimo-j2ee-builder/src/main/java/org/apache/geronimo/j2ee/deployment/ApplicationInfo.java
    geronimo/server/trunk/plugins/j2ee/geronimo-j2ee-builder/src/main/java/org/apache/geronimo/j2ee/deployment/ConnectorModule.java
    geronimo/server/trunk/plugins/j2ee/geronimo-j2ee-builder/src/main/java/org/apache/geronimo/j2ee/deployment/EARConfigBuilder.java
    geronimo/server/trunk/plugins/j2ee/geronimo-j2ee-builder/src/main/java/org/apache/geronimo/j2ee/deployment/EJBModule.java
    geronimo/server/trunk/plugins/j2ee/geronimo-j2ee-builder/src/main/java/org/apache/geronimo/j2ee/deployment/Module.java
    geronimo/server/trunk/plugins/j2ee/geronimo-j2ee-builder/src/main/java/org/apache/geronimo/j2ee/deployment/ModuleBuilder.java
    geronimo/server/trunk/plugins/j2ee/geronimo-j2ee-builder/src/main/java/org/apache/geronimo/j2ee/deployment/NamingBuilder.java
    geronimo/server/trunk/plugins/j2ee/geronimo-j2ee-builder/src/main/java/org/apache/geronimo/j2ee/deployment/SwitchingModuleBuilder.java
    geronimo/server/trunk/plugins/j2ee/geronimo-j2ee-builder/src/main/java/org/apache/geronimo/j2ee/deployment/UnavailableModuleBuilder.java
    geronimo/server/trunk/plugins/j2ee/geronimo-j2ee-builder/src/main/java/org/apache/geronimo/j2ee/deployment/WebModule.java
    geronimo/server/trunk/plugins/j2ee/geronimo-j2ee-builder/src/main/java/org/apache/geronimo/j2ee/deployment/annotation/AnnotatedEjbJar.java
    geronimo/server/trunk/plugins/j2ee/geronimo-j2ee-builder/src/main/java/org/apache/geronimo/j2ee/deployment/annotation/EJBAnnotationHelper.java
    geronimo/server/trunk/plugins/j2ee/geronimo-j2ee-builder/src/main/java/org/apache/geronimo/j2ee/deployment/annotation/HandlerChainAnnotationHelper.java
    geronimo/server/trunk/plugins/j2ee/geronimo-j2ee-builder/src/main/java/org/apache/geronimo/j2ee/deployment/annotation/PersistenceContextAnnotationHelper.java
    geronimo/server/trunk/plugins/j2ee/geronimo-j2ee-builder/src/main/java/org/apache/geronimo/j2ee/deployment/annotation/PersistenceUnitAnnotationHelper.java
    geronimo/server/trunk/plugins/j2ee/geronimo-j2ee-builder/src/main/java/org/apache/geronimo/j2ee/deployment/annotation/ResourceAnnotationHelper.java
    geronimo/server/trunk/plugins/j2ee/geronimo-j2ee-builder/src/main/java/org/apache/geronimo/j2ee/deployment/annotation/SecurityAnnotationHelper.java
    geronimo/server/trunk/plugins/j2ee/geronimo-j2ee-builder/src/main/java/org/apache/geronimo/j2ee/deployment/annotation/WebServiceRefAnnotationHelper.java
    geronimo/server/trunk/plugins/j2ee/geronimo-j2ee-builder/src/test/java/org/apache/geronimo/j2ee/deployment/EARConfigBuilder13NakedTest.java
    geronimo/server/trunk/plugins/j2ee/geronimo-j2ee-builder/src/test/java/org/apache/geronimo/j2ee/deployment/EARConfigBuilder13Test.java
    geronimo/server/trunk/plugins/j2ee/geronimo-j2ee-builder/src/test/java/org/apache/geronimo/j2ee/deployment/EARConfigBuilder14AltDDTest.java
    geronimo/server/trunk/plugins/j2ee/geronimo-j2ee-builder/src/test/java/org/apache/geronimo/j2ee/deployment/EARConfigBuilder14AltDDUnpackedTest.java
    geronimo/server/trunk/plugins/j2ee/geronimo-j2ee-builder/src/test/java/org/apache/geronimo/j2ee/deployment/EARConfigBuilder14NakedTest.java
    geronimo/server/trunk/plugins/j2ee/geronimo-j2ee-builder/src/test/java/org/apache/geronimo/j2ee/deployment/EARConfigBuilder14NakedUnpackedTest.java
    geronimo/server/trunk/plugins/j2ee/geronimo-j2ee-builder/src/test/java/org/apache/geronimo/j2ee/deployment/EARConfigBuilder14Test.java
    geronimo/server/trunk/plugins/j2ee/geronimo-j2ee-builder/src/test/java/org/apache/geronimo/j2ee/deployment/EARConfigBuilder14UnpackedTest.java
    geronimo/server/trunk/plugins/j2ee/geronimo-j2ee-builder/src/test/java/org/apache/geronimo/j2ee/deployment/EARConfigBuilder5AltDDTest.java
    geronimo/server/trunk/plugins/j2ee/geronimo-j2ee-builder/src/test/java/org/apache/geronimo/j2ee/deployment/EARConfigBuilder5AltDDUnpackedTest.java
    geronimo/server/trunk/plugins/j2ee/geronimo-j2ee-builder/src/test/java/org/apache/geronimo/j2ee/deployment/EARConfigBuilder5NakedTest.java
    geronimo/server/trunk/plugins/j2ee/geronimo-j2ee-builder/src/test/java/org/apache/geronimo/j2ee/deployment/EARConfigBuilder5NakedUnpackedTest.java
    geronimo/server/trunk/plugins/j2ee/geronimo-j2ee-builder/src/test/java/org/apache/geronimo/j2ee/deployment/EARConfigBuilder5Test.java
    geronimo/server/trunk/plugins/j2ee/geronimo-j2ee-builder/src/test/java/org/apache/geronimo/j2ee/deployment/EARConfigBuilder5UnpackedTest.java
    geronimo/server/trunk/plugins/j2ee/geronimo-j2ee-builder/src/test/java/org/apache/geronimo/j2ee/deployment/EARConfigBuilderTestSupport.java
    geronimo/server/trunk/plugins/j2ee/geronimo-j2ee-builder/src/test/java/org/apache/geronimo/j2ee/deployment/MockConnectorConfigBuilder.java
    geronimo/server/trunk/plugins/j2ee/geronimo-j2ee-builder/src/test/java/org/apache/geronimo/j2ee/deployment/MockEJBConfigBuilder.java
    geronimo/server/trunk/plugins/j2ee/geronimo-j2ee-builder/src/test/java/org/apache/geronimo/j2ee/deployment/MockWARConfigBuilder.java
    geronimo/server/trunk/plugins/j2ee/geronimo-j2ee/src/main/java/org/apache/geronimo/j2ee/annotation/Holder.java
    geronimo/server/trunk/plugins/j2ee/geronimo-naming-builder/src/main/java/org/apache/geronimo/naming/deployment/AbstractNamingBuilder.java
    geronimo/server/trunk/plugins/j2ee/geronimo-naming-builder/src/main/java/org/apache/geronimo/naming/deployment/EnvironmentEntryBuilder.java
    geronimo/server/trunk/plugins/j2ee/geronimo-naming-builder/src/main/java/org/apache/geronimo/naming/deployment/GBeanRefBuilder.java
    geronimo/server/trunk/plugins/j2ee/geronimo-naming-builder/src/main/java/org/apache/geronimo/naming/deployment/LifecycleMethodBuilder.java
    geronimo/server/trunk/plugins/j2ee/geronimo-naming-builder/src/test/java/org/apache/geronimo/naming/deployment/EnvironmentEntryBuilderTest.java
    geronimo/server/trunk/plugins/j2ee/geronimo-web-2.5-builder/src/main/java/org/apache/geronimo/web25/deployment/AbstractWebModuleBuilder.java
    geronimo/server/trunk/plugins/j2ee/geronimo-web-2.5-builder/src/test/java/org/apache/geronimo/web25/deployment/SchemaConversionTest.java
    geronimo/server/trunk/plugins/j2ee/j2ee-server/src/main/history/dependencies.xml
    geronimo/server/trunk/plugins/jasper/geronimo-jasper-builder/src/main/java/org/apache/geronimo/jasper/deployment/JspModuleBuilderExtension.java
    geronimo/server/trunk/plugins/jaxws/geronimo-jaxws-builder/src/main/java/org/apache/geronimo/jaxws/builder/JAXWSServiceRefBuilder.java
    geronimo/server/trunk/plugins/jetty8/geronimo-jetty8-builder/src/main/java/org/apache/geronimo/jetty8/deployment/JettyModuleBuilder.java
    geronimo/server/trunk/plugins/jetty8/geronimo-jetty8-builder/src/test/java/org/apache/geronimo/jetty8/deployment/JettyModuleBuilderTest.java
    geronimo/server/trunk/plugins/jetty8/geronimo-jetty8-builder/src/test/java/org/apache/geronimo/jetty8/deployment/PlanParsingTest.java
    geronimo/server/trunk/plugins/myfaces/geronimo-myfaces-builder/src/main/java/org/apache/geronimo/myfaces/deployment/MyFacesModuleBuilderExtension.java
    geronimo/server/trunk/plugins/openejb/geronimo-openejb-builder/src/main/java/org/apache/geronimo/openejb/deployment/EjbDeploymentBuilder.java
    geronimo/server/trunk/plugins/openejb/geronimo-openejb-builder/src/main/java/org/apache/geronimo/openejb/deployment/EjbModule.java
    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-builder/src/main/java/org/apache/geronimo/openejb/deployment/EjbRefBuilder.java
    geronimo/server/trunk/plugins/openejb/openejb/src/main/history/dependencies.xml
    geronimo/server/trunk/plugins/openjpa2/geronimo-persistence-jpa20-builder/src/main/java/org/apache/geronimo/persistence/builder/PersistenceContextRefBuilder.java
    geronimo/server/trunk/plugins/openjpa2/geronimo-persistence-jpa20-builder/src/main/java/org/apache/geronimo/persistence/builder/PersistenceUnitRefBuilder.java
    geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7-builder/src/main/java/org/apache/geronimo/tomcat/deployment/TomcatModuleBuilder.java
    geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7-builder/src/test/java/org/apache/geronimo/tomcat/deployment/PlanParsingTest.java
    geronimo/server/trunk/plugins/wab/geronimo-web-extender/src/main/java/org/apache/geronimo/osgi/web/extender/WebApplication.java

Modified: geronimo/server/trunk/plugins/activemq/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/activemq/pom.xml?rev=950397&r1=950396&r2=950397&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/activemq/pom.xml (original)
+++ geronimo/server/trunk/plugins/activemq/pom.xml Wed Jun  2 07:35:24 2010
@@ -63,7 +63,7 @@
     </profiles>
 
     <properties>
-        <activemqVersion>5.3.2</activemqVersion>
+        <activemqVersion>5.4-SNAPSHOT</activemqVersion>
     </properties>
 
     <dependencyManagement>

Modified: geronimo/server/trunk/plugins/bval/geronimo-bval-builder/src/main/java/org/apache/geronimo/bval/deployment/BValNamingBuilder.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/bval/geronimo-bval-builder/src/main/java/org/apache/geronimo/bval/deployment/BValNamingBuilder.java?rev=950397&r1=950396&r2=950397&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/bval/geronimo-bval-builder/src/main/java/org/apache/geronimo/bval/deployment/BValNamingBuilder.java (original)
+++ geronimo/server/trunk/plugins/bval/geronimo-bval-builder/src/main/java/org/apache/geronimo/bval/deployment/BValNamingBuilder.java Wed Jun  2 07:35:24 2010
@@ -48,9 +48,8 @@ public class BValNamingBuilder extends A
 
     @Override
     public void buildNaming(XmlObject xmlObject, XmlObject xmlObject1, Module module, Map<EARContext.Key, Object> keyObjectMap) throws DeploymentException {
-        Map<JndiKey, Map<String, Object>> jndiContext = JNDI_KEY.get(keyObjectMap);
-        put("java:comp/Validator", new DefaultValidatorReference(), jndiContext);
-        put("java:comp/ValidatorFactory", new DefaultValidatorFactoryReference(), jndiContext);
+        put("java:comp/Validator", new DefaultValidatorReference(), module.getJndiContext());
+        put("java:comp/ValidatorFactory", new DefaultValidatorFactoryReference(), module.getJndiContext());
     }
 
     @Override

Modified: geronimo/server/trunk/plugins/client/client/src/main/history/dependencies.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/client/client/src/main/history/dependencies.xml?rev=950397&r1=950396&r2=950397&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/client/client/src/main/history/dependencies.xml (original)
+++ geronimo/server/trunk/plugins/client/client/src/main/history/dependencies.xml Wed Jun  2 07:35:24 2010
@@ -7,6 +7,11 @@
         <type>car</type>
     </module-id>
     <dependency>
+        <groupId>asm</groupId>
+        <artifactId>asm-all</artifactId>
+        <type>jar</type>
+    </dependency>
+    <dependency>
         <groupId>org.apache.aries</groupId>
         <artifactId>org.apache.aries.util</artifactId>
         <type>jar</type>
@@ -22,6 +27,11 @@
         <type>jar</type>
     </dependency>
     <dependency>
+        <groupId>org.apache.felix</groupId>
+        <artifactId>org.apache.felix.bundlerepository</artifactId>
+        <type>jar</type>
+    </dependency>
+    <dependency>
         <groupId>org.apache.geronimo.bundles</groupId>
         <artifactId>sxc-jaxb</artifactId>
         <type>jar</type>
@@ -53,6 +63,11 @@
     </dependency>
     <dependency>
         <groupId>org.apache.geronimo.framework</groupId>
+        <artifactId>geronimo-cli</artifactId>
+        <type>jar</type>
+    </dependency>
+    <dependency>
+        <groupId>org.apache.geronimo.framework</groupId>
         <artifactId>geronimo-core</artifactId>
         <type>jar</type>
     </dependency>
@@ -63,6 +78,11 @@
     </dependency>
     <dependency>
         <groupId>org.apache.geronimo.framework</groupId>
+        <artifactId>geronimo-main</artifactId>
+        <type>jar</type>
+    </dependency>
+    <dependency>
+        <groupId>org.apache.geronimo.framework</groupId>
         <artifactId>geronimo-management</artifactId>
         <type>jar</type>
     </dependency>
@@ -178,6 +198,11 @@
     </dependency>
     <dependency>
         <groupId>org.apache.geronimo.specs</groupId>
+        <artifactId>geronimo-osgi-registry</artifactId>
+        <type>jar</type>
+    </dependency>
+    <dependency>
+        <groupId>org.apache.geronimo.specs</groupId>
         <artifactId>geronimo-saaj_1.3_spec</artifactId>
         <type>jar</type>
     </dependency>
@@ -238,6 +263,11 @@
     </dependency>
     <dependency>
         <groupId>org.apache.servicemix.bundles</groupId>
+        <artifactId>org.apache.servicemix.bundles.cglib</artifactId>
+        <type>jar</type>
+    </dependency>
+    <dependency>
+        <groupId>org.apache.servicemix.bundles</groupId>
         <artifactId>org.apache.servicemix.bundles.howl</artifactId>
         <type>jar</type>
     </dependency>
@@ -247,6 +277,16 @@
         <type>jar</type>
     </dependency>
     <dependency>
+        <groupId>org.apache.servicemix.bundles</groupId>
+        <artifactId>org.apache.servicemix.bundles.xpp3</artifactId>
+        <type>jar</type>
+    </dependency>
+    <dependency>
+        <groupId>org.apache.servicemix.bundles</groupId>
+        <artifactId>org.apache.servicemix.bundles.xstream</artifactId>
+        <type>jar</type>
+    </dependency>
+    <dependency>
         <groupId>org.apache.xbean</groupId>
         <artifactId>xbean-asm-shaded</artifactId>
         <type>jar</type>

Modified: geronimo/server/trunk/plugins/client/geronimo-client-builder/src/main/java/org/apache/geronimo/client/builder/AppClientModuleBuilder.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/client/geronimo-client-builder/src/main/java/org/apache/geronimo/client/builder/AppClientModuleBuilder.java?rev=950397&r1=950396&r2=950397&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/client/geronimo-client-builder/src/main/java/org/apache/geronimo/client/builder/AppClientModuleBuilder.java (original)
+++ geronimo/server/trunk/plugins/client/geronimo-client-builder/src/main/java/org/apache/geronimo/client/builder/AppClientModuleBuilder.java Wed Jun  2 07:35:24 2010
@@ -209,18 +209,22 @@ public class AppClientModuleBuilder impl
         this.clientArtifactResolver = clientArtifactResolver;
     }
 
+    @Override
     public void doStart() throws Exception {
         XmlBeansUtil.registerNamespaceUpdates(NAMESPACE_UPDATES);
     }
 
+    @Override
     public void doStop() {
         XmlBeansUtil.unregisterNamespaceUpdates(NAMESPACE_UPDATES);
     }
 
+    @Override
     public void doFail() {
         doStop();
     }
 
+    @Override
     public AbstractNameQuery getCorbaGBeanName() {
         return corbaGBeanObjectName;
     }
@@ -229,23 +233,26 @@ public class AppClientModuleBuilder impl
         return (ModuleBuilder) connectorModuleBuilder.getElement();
     }
 
+    @Override
     public Module createModule(Bundle bundle, Naming naming, ModuleIDBuilder idBuilder) throws DeploymentException {
         return null;
     }
 
+    @Override
     public Module createModule(File plan, JarFile moduleFile, Naming naming, ModuleIDBuilder idBuilder) throws DeploymentException {
         return createModule(plan, moduleFile, "app-client.jar", null, null, null, naming, idBuilder);
     }
 
-    public Module createModule(Object plan, JarFile moduleFile, String targetPath, URL specDDUrl, Environment environment, Object moduleContextInfo, AbstractName earName, Naming naming, ModuleIDBuilder idBuilder) throws DeploymentException {
-        return createModule(plan, moduleFile, targetPath, specDDUrl, environment, earName, naming, idBuilder);
+    @Override
+    public Module createModule(Object plan, JarFile moduleFile, String targetPath, URL specDDUrl, Environment environment, Object moduleContextInfo, Module parentModule, Naming naming, ModuleIDBuilder idBuilder) throws DeploymentException {
+        return createModule(plan, moduleFile, targetPath, specDDUrl, environment, parentModule, naming, idBuilder);
     }
 
-    private Module createModule(Object plan, JarFile moduleFile, String targetPath, URL specDDUrl, Environment earEnvironment, AbstractName earName, Naming naming, ModuleIDBuilder idBuilder) throws DeploymentException {
+    private Module createModule(Object plan, JarFile moduleFile, String targetPath, URL specDDUrl, Environment earEnvironment, Module parentModule, Naming naming, ModuleIDBuilder idBuilder) throws DeploymentException {
         assert moduleFile != null : "moduleFile is null";
         assert targetPath != null : "targetPath is null";
         assert !targetPath.endsWith("/") : "targetPath must not end with a '/'";
-        assert (earName == null) == (earEnvironment == null) : "if earName is not null you must supply earEnvironment as well";
+        assert (parentModule == null) == (earEnvironment == null) : "if earName is not null you must supply earEnvironment as well";
 
         boolean standAlone = earEnvironment == null;
 
@@ -325,16 +332,32 @@ public class AppClientModuleBuilder impl
             idBuilder.resolve(serverEnvironment, new File(moduleFile.getName()).getName(), "car");
         }
 
-        if (earName == null) {
+        AbstractName earName;
+        if (parentModule == null) {
             earName = naming.createRootName(serverEnvironment.getConfigId(), NameFactory.NULL, NameFactory.J2EE_APPLICATION);
+        } else {
+            earName = parentModule.getModuleName();
         }
 
         //always use the artifactId of the app client as the name component of the module name (on the server).
         AbstractName moduleName = naming.createChildName(earName, clientEnvironment.getConfigId().toString(), NameFactory.APP_CLIENT_MODULE);
         AbstractName clientBaseName = naming.createRootName(clientEnvironment.getConfigId(), clientEnvironment.getConfigId().toString(), NameFactory.J2EE_APPLICATION);
 
+        // Create the AnnotatedApp interface for the AppClientModule
+        AnnotatedApplicationClient annotatedApplicationClient = new AnnotatedApplicationClient(appClient, mainClass);
+
+        String name = null;
+        if (appClient.isSetModuleName()) {
+            name = appClient.getModuleName().getStringValue().trim();
+        } else if (standAlone) {
+            name = FileUtils.removeExtension(new File(moduleFile.getName()).getName(), ".jar");
+        } else {
+            name = FileUtils.removeExtension(targetPath, ".jar");
+        }
+
+        AppClientModule module = new AppClientModule(standAlone, moduleName, name, clientBaseName, serverEnvironment, clientEnvironment, moduleFile, targetPath, appClient, mainClass, gerAppClient, specDD, annotatedApplicationClient);
+
         //start installing the resource adapters in the client.
-        Collection<ConnectorModule> resourceModules = new ArrayList<ConnectorModule>();
         GerResourceType[] resources = gerAppClient.getResourceArray();
         for (GerResourceType resource : resources) {
             String path;
@@ -376,23 +399,10 @@ public class AppClientModuleBuilder impl
                 }
             }
             XmlObject connectorPlan = resource.getConnector();
-            ConnectorModule connectorModule = (ConnectorModule) getConnectorModuleBuilder().createModule(connectorPlan, connectorFile, path, null, clientEnvironment, null, clientBaseName, naming, idBuilder);
-            resourceModules.add(connectorModule);
+            ConnectorModule connectorModule = (ConnectorModule) getConnectorModuleBuilder().createModule(connectorPlan, connectorFile, path, null, clientEnvironment, null, module, naming, idBuilder);
+            module.getModules().add(connectorModule);
         }
 
-        // Create the AnnotatedApp interface for the AppClientModule
-        AnnotatedApplicationClient annotatedApplicationClient = new AnnotatedApplicationClient(appClient, mainClass);
-
-        String name = null;
-        if (appClient.isSetModuleName()) {
-            name = appClient.getModuleName().getStringValue().trim();
-        } else if (standAlone) {
-            name = FileUtils.removeExtension(new File(moduleFile.getName()).getName(), ".jar");
-        } else {
-            name = FileUtils.removeExtension(targetPath, ".jar");
-        }
-        
-        AppClientModule module = new AppClientModule(standAlone, moduleName, name, clientBaseName, serverEnvironment, clientEnvironment, moduleFile, targetPath, appClient, mainClass, gerAppClient, specDD, resourceModules, annotatedApplicationClient);
         for (ModuleBuilderExtension mbe : moduleBuilderExtensions) {
             mbe.createModule(module, plan, moduleFile, targetPath, specDDUrl, clientEnvironment, null, earName, naming, idBuilder);
         }
@@ -404,10 +414,9 @@ public class AppClientModuleBuilder impl
                     null,
                     null,
                     null,
-                    new LinkedHashSet<Module<?,?>>(Collections.singleton(module)),
-                    new ModuleList(),
                     null,
                     null);
+            appInfo.getModules().add(module);
             return appInfo;
         } else {
             return module;
@@ -593,8 +602,10 @@ public class AppClientModuleBuilder impl
             cleanupAppClientDir(appClientDir);
             throw e;
         }
-        for (ConnectorModule connectorModule : appClientModule.getResourceModules()) {
-            getConnectorModuleBuilder().installModule(connectorModule.getModuleFile(), appClientDeploymentContext, connectorModule, configurationStores, targetConfigurationStore, repositories);
+        for (Module connectorModule : appClientModule.getModules()) {
+            if (connectorModule instanceof ConnectorModule) {
+                getConnectorModuleBuilder().installModule(connectorModule.getModuleFile(), appClientDeploymentContext, connectorModule, configurationStores, targetConfigurationStore, repositories);
+            }
         }
 
         for (ModuleBuilderExtension mbe : moduleBuilderExtensions) {
@@ -606,8 +617,10 @@ public class AppClientModuleBuilder impl
         AppClientModule appClientModule = ((AppClientModule) clientModule);
         namingBuilders.buildEnvironment(appClientModule.getSpecDD(), appClientModule.getVendorDD(), clientModule.getEnvironment());
 
-        for (ConnectorModule connectorModule : appClientModule.getResourceModules()) {
-            getConnectorModuleBuilder().initContext(appClientModule.getEarContext(), connectorModule, bundle);
+        for (Module connectorModule : appClientModule.getModules()) {
+            if (connectorModule instanceof ConnectorModule) {
+                getConnectorModuleBuilder().initContext(appClientModule.getEarContext(), connectorModule, bundle);
+            }
         }
         for (ModuleBuilderExtension mbe : moduleBuilderExtensions) {
             mbe.initContext(earContext, clientModule, bundle);
@@ -684,8 +697,10 @@ public class AppClientModuleBuilder impl
                     serviceBuilder.build(geronimoAppClient, appClientDeploymentContext, appClientDeploymentContext);
                     //deploy the resource adapters specified in the geronimo-application.xml
 
-                    for (ConnectorModule connectorModule : appClientModule.getResourceModules()) {
-                        getConnectorModuleBuilder().addGBeans(appClientDeploymentContext, connectorModule, appClientClassBundle, repositories);
+                    for (Module connectorModule : appClientModule.getModules()) {
+                        if (connectorModule instanceof ConnectorModule) {
+                            getConnectorModuleBuilder().addGBeans(appClientDeploymentContext, connectorModule, appClientClassBundle, repositories);
+                        }
                     }
                 }
 
@@ -708,10 +723,7 @@ public class AppClientModuleBuilder impl
                         // (or not)
                         appClientModule.setClassFinder(createAppClientClassFinder(appClient, appClientModule));
                     }
-                    Map<JndiKey, Map<String, Object>> contexts = NamingBuilder.JNDI_KEY.get(earContext.getGeneralData());
-                    Map<JndiKey, Map<String, Object>> clientContexts = new HashMap<JndiKey, Map<String, Object>>(contexts);
-                    getJndiContext(clientContexts, JndiScope.module).put("module/ModuleName", module.getName());
-                    buildingContext.put(NamingBuilder.JNDI_KEY, clientContexts);
+                    appClientModule.getJndiScope(JndiScope.module).put("module/ModuleName", module.getName());
                     namingBuilders.buildNaming(appClient, geronimoAppClient, appClientModule, buildingContext);
 
                     if (!appClient.getMetadataComplete()) {
@@ -722,7 +734,7 @@ public class AppClientModuleBuilder impl
                     appClientModuleGBeanData.setAttribute("deploymentDescriptor", appClientModule.getOriginalSpecDD());
                     //in the app client
                     holder = NamingBuilder.INJECTION_KEY.get(buildingContext);
-                    jndiContextGBeanData.setAttribute("context", NamingBuilder.JNDI_KEY.get(buildingContext));
+                    jndiContextGBeanData.setAttribute("context", appClientModule.getJndiContext());
                 } catch (DeploymentException e) {
                     throw e;
                 } catch (Exception e) {

Modified: geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-builder-1_6/src/main/java/org/apache/geronimo/connector/deployment/AdminObjectRefBuilder.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-builder-1_6/src/main/java/org/apache/geronimo/connector/deployment/AdminObjectRefBuilder.java?rev=950397&r1=950396&r2=950397&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-builder-1_6/src/main/java/org/apache/geronimo/connector/deployment/AdminObjectRefBuilder.java (original)
+++ geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-builder-1_6/src/main/java/org/apache/geronimo/connector/deployment/AdminObjectRefBuilder.java Wed Jun  2 07:35:24 2010
@@ -140,7 +140,7 @@ public class AdminObjectRefBuilder exten
         Bundle bundle = module.getEarContext().getDeploymentBundle();
         for (ResourceEnvRefType resourceEnvRef : resourceEnvRefsUntyped) {
             String name = getStringValue(resourceEnvRef.getResourceEnvRefName());
-            if (lookupJndiContextMap(componentContext, name) != null) {
+            if (lookupJndiContextMap(module, name) != null) {
                 // some other builder handled this entry already
                 continue;
             }
@@ -167,7 +167,7 @@ public class AdminObjectRefBuilder exten
             if (value == null) {
                 unresolvedRefs.add(name);
             } else {
-                put(name, value, getJndiContextMap(componentContext));
+                put(name, value, module.getJndiContext());
             }
         }
 
@@ -180,7 +180,7 @@ public class AdminObjectRefBuilder exten
 
         for (MessageDestinationRefType messageDestinationRef : messageDestinationRefsUntyped) {
             String name = getStringValue(messageDestinationRef.getMessageDestinationRefName());
-            if (lookupJndiContextMap(componentContext, name) != null) {
+            if (lookupJndiContextMap(module, name) != null) {
                 // some other builder handled this entry already
                 continue;
             }
@@ -211,7 +211,7 @@ public class AdminObjectRefBuilder exten
             }
 
             if (value != null) {
-                put(name, value, getJndiContextMap(componentContext));
+                put(name, value, module.getJndiContext());
             }
         }
 
@@ -231,7 +231,8 @@ public class AdminObjectRefBuilder exten
         if (type.equals("javax.transaction.UserTransaction")) {
             return new UserTransactionReference();
         }
-        if ("javax.ejb.EntityContext".equals(type) ||
+        if ("javax.ejb.EJBContext".equals(type) ||
+                "javax.ejb.EntityContext".equals(type) ||
                 "javax.ejb.MessageDrivenContext".equals(type) ||
                 "javax.ejb.SessionContext".equals(type)) {
             return new JndiReference("java:comp/EJBContext");
@@ -433,6 +434,7 @@ public class AdminObjectRefBuilder exten
                     resourceEnvRefType = refMap.get(resourceName);
                 }
                 if (resourceEnvRefType != null ||
+                        resourceType.equals("javax.ejb.EJBContext") ||
                         resourceType.equals("javax.ejb.SessionContext") ||
                         resourceType.equals("javax.ejb.MessageDrivenContext") ||
                         resourceType.equals("javax.ejb.EntityContext") ||

Modified: geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-builder-1_6/src/main/java/org/apache/geronimo/connector/deployment/ConnectorModuleBuilder.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-builder-1_6/src/main/java/org/apache/geronimo/connector/deployment/ConnectorModuleBuilder.java?rev=950397&r1=950396&r2=950397&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-builder-1_6/src/main/java/org/apache/geronimo/connector/deployment/ConnectorModuleBuilder.java (original)
+++ geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-builder-1_6/src/main/java/org/apache/geronimo/connector/deployment/ConnectorModuleBuilder.java Wed Jun  2 07:35:24 2010
@@ -100,6 +100,7 @@ import org.apache.geronimo.j2ee.deployme
 import org.apache.geronimo.j2ee.deployment.ModuleBuilder;
 import org.apache.geronimo.j2ee.deployment.annotation.AnnotatedApp;
 import org.apache.geronimo.j2ee.j2eeobjectnames.NameFactory;
+import org.apache.geronimo.j2ee.jndi.JndiKey;
 import org.apache.geronimo.kernel.GBeanAlreadyExistsException;
 import org.apache.geronimo.kernel.GBeanNotFoundException;
 import org.apache.geronimo.kernel.Naming;
@@ -231,31 +232,37 @@ public class ConnectorModuleBuilder impl
         packageAdmin = (PackageAdmin) bundleContext.getService(sr);
     }
 
+    @Override
     public void doStart() throws Exception {
         XmlBeansUtil.registerNamespaceUpdates(NAMESPACE_UPDATES);
     }
 
+    @Override
     public void doStop() {
         XmlBeansUtil.unregisterNamespaceUpdates(NAMESPACE_UPDATES);
     }
 
+    @Override
     public void doFail() {
         doStop();
     }
 
+    @Override
     public Module createModule(Bundle bundle, Naming naming, ModuleIDBuilder idBuilder) throws DeploymentException {
         return null;
     }
 
+    @Override
     public Module createModule(File plan, JarFile moduleFile, Naming naming, ModuleIDBuilder idBuilder) throws DeploymentException {
         return createModule(plan, moduleFile, "rar", null, null, null, naming, idBuilder);
     }
 
-    public Module createModule(Object plan, JarFile moduleFile, String targetPath, URL specDDUrl, Environment environment, Object moduleContextInfo, AbstractName earName, Naming naming, ModuleIDBuilder idBuilder) throws DeploymentException {
-        return createModule(plan, moduleFile, targetPath, specDDUrl, environment, earName, naming, idBuilder);
+    @Override
+    public Module createModule(Object plan, JarFile moduleFile, String targetPath, URL specDDUrl, Environment environment, Object o1, Module module, Naming naming, ModuleIDBuilder moduleIDBuilder) throws DeploymentException {
+        return createModule(plan, moduleFile, targetPath, specDDUrl, environment, module, naming, moduleIDBuilder);
     }
 
-    private Module createModule(Object plan, JarFile moduleFile, String targetPath, URL specDDUrl, Environment earEnvironment, AbstractName earName, Naming naming, ModuleIDBuilder idBuilder) throws DeploymentException {
+    private Module createModule(Object plan, JarFile moduleFile, String targetPath, URL specDDUrl, Environment earEnvironment, Module parentModule, Naming naming, ModuleIDBuilder idBuilder) throws DeploymentException {
         assert moduleFile != null : "moduleFile is null";
         assert targetPath != null : "targetPath is null";
         assert !targetPath.endsWith("/") : "targetPath must not end with a '/'";
@@ -367,11 +374,11 @@ public class ConnectorModuleBuilder impl
         }
 
         AbstractName moduleName;
-        if (earName == null) {
-            earName = naming.createRootName(environment.getConfigId(), NameFactory.NULL, NameFactory.J2EE_APPLICATION);
+        if (parentModule == null) {
+            AbstractName earName = naming.createRootName(environment.getConfigId(), NameFactory.NULL, NameFactory.J2EE_APPLICATION);
             moduleName = naming.createChildName(earName, environment.getConfigId().toString(), NameFactory.RESOURCE_ADAPTER_MODULE);
         } else {
-            moduleName = naming.createChildName(earName, targetPath, NameFactory.RESOURCE_ADAPTER_MODULE);
+            moduleName = naming.createChildName(parentModule.getModuleName(), targetPath, NameFactory.RESOURCE_ADAPTER_MODULE);
         }
 
         boolean standAlone = earEnvironment == null;
@@ -385,8 +392,7 @@ public class ConnectorModuleBuilder impl
         } else {
             name = FileUtils.removeExtension(targetPath, ".rar");
         }
-
-        return new ConnectorModule<ConnectorBase, XmlObject>(standAlone, moduleName, name, environment, moduleFile, targetPath, connector, gerConnector, specDD, annotatedApp);
+        return new ConnectorModule<ConnectorBase, XmlObject>(standAlone, moduleName, name, environment, moduleFile, targetPath, connector, gerConnector, specDD, annotatedApp, parentModule == null? null: parentModule.getJndiContext(), parentModule);
     }
 
 //    static XmlObject convertToConnectorSchema(XmlObject xmlObject) throws XmlException {

Modified: geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-builder-1_6/src/main/java/org/apache/geronimo/connector/deployment/ResourceRefBuilder.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-builder-1_6/src/main/java/org/apache/geronimo/connector/deployment/ResourceRefBuilder.java?rev=950397&r1=950396&r2=950397&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-builder-1_6/src/main/java/org/apache/geronimo/connector/deployment/ResourceRefBuilder.java (original)
+++ geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-builder-1_6/src/main/java/org/apache/geronimo/connector/deployment/ResourceRefBuilder.java Wed Jun  2 07:35:24 2010
@@ -133,7 +133,7 @@ public class ResourceRefBuilder extends 
         Bundle bundle = module.getEarContext().getDeploymentBundle();
         for (ResourceRefType resourceRef : resourceRefsUntyped) {
             String name = getStringValue(resourceRef.getResRefName());
-            if (lookupJndiContextMap(componentContext, name) != null) {
+            if (lookupJndiContextMap(module, name) != null) {
                 // some other builder handled this entry already
                 continue;
             }
@@ -161,7 +161,7 @@ public class ResourceRefBuilder extends 
             if (value == null) {
                 unresolvedRefs.add(name);
             } else {
-                put(name, value, getJndiContextMap(componentContext));
+                put(name, value, module.getJndiContext());
             }
 
         }

Modified: geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-builder-1_6/src/main/java/org/apache/geronimo/datasource/deployment/DataSourceBuilder.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-builder-1_6/src/main/java/org/apache/geronimo/datasource/deployment/DataSourceBuilder.java?rev=950397&r1=950396&r2=950397&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-builder-1_6/src/main/java/org/apache/geronimo/datasource/deployment/DataSourceBuilder.java (original)
+++ geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-builder-1_6/src/main/java/org/apache/geronimo/datasource/deployment/DataSourceBuilder.java Wed Jun  2 07:35:24 2010
@@ -26,7 +26,6 @@ import javax.annotation.sql.DataSourceDe
 import javax.annotation.sql.DataSourceDefinitions;
 import javax.resource.ResourceException;
 import javax.sql.DataSource;
-
 import org.apache.geronimo.common.DeploymentException;
 import org.apache.geronimo.datasource.DataSourceDescription;
 import org.apache.geronimo.datasource.DataSourceGBean;
@@ -42,12 +41,12 @@ import org.apache.geronimo.j2ee.deployme
 import org.apache.geronimo.j2ee.deployment.annotation.AnnotatedApp;
 import org.apache.geronimo.j2ee.j2eeobjectnames.NameFactory;
 import org.apache.geronimo.kernel.GBeanAlreadyExistsException;
-import org.apache.xbean.finder.BundleAnnotationFinder;
 import org.apache.geronimo.naming.deployment.AbstractNamingBuilder;
 import org.apache.geronimo.naming.reference.ResourceReferenceFactory;
 import org.apache.geronimo.xbeans.javaee6.DataSourceType;
 import org.apache.geronimo.xbeans.javaee6.IsolationLevelType;
 import org.apache.geronimo.xbeans.javaee6.PropertyType;
+import org.apache.xbean.finder.BundleAnnotationFinder;
 import org.apache.xmlbeans.QNameSet;
 import org.apache.xmlbeans.XmlObject;
 import org.osgi.framework.Bundle;
@@ -146,7 +145,7 @@ public class DataSourceBuilder extends A
                         
         String jndiName = ds.getName().getStringValue();
         
-        if (lookupJndiContextMap(componentContext, jndiName) != null) {
+        if (lookupJndiContextMap(module, jndiName) != null) {
             return;
         }
         
@@ -173,7 +172,7 @@ public class DataSourceBuilder extends A
         earContext.addGBean(dataSourceGBean);
                 
         Object ref = new ResourceReferenceFactory<ResourceException>(module.getConfigId(), new AbstractNameQuery(dataSourceAbstractName), DataSource.class);
-        put(jndiName, ref, getJndiContextMap(componentContext));
+        put(jndiName, ref, module.getJndiContext());
     }
     
     private DataSourceType processDefinition(DataSourceDefinition dsDefinition, AnnotatedApp annotatedApp) {

Modified: geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-builder-1_6/src/test/java/org/apache/geronimo/connector/deployment/ConnectorModuleBuilderTest.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-builder-1_6/src/test/java/org/apache/geronimo/connector/deployment/ConnectorModuleBuilderTest.java?rev=950397&r1=950396&r2=950397&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-builder-1_6/src/test/java/org/apache/geronimo/connector/deployment/ConnectorModuleBuilderTest.java (original)
+++ geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-builder-1_6/src/test/java/org/apache/geronimo/connector/deployment/ConnectorModuleBuilderTest.java Wed Jun  2 07:35:24 2010
@@ -31,7 +31,6 @@ import java.util.jar.JarFile;
 
 import javax.naming.Reference;
 import javax.sql.DataSource;
-
 import org.apache.geronimo.common.DeploymentException;
 import org.apache.geronimo.deployment.DeploymentContext;
 import org.apache.geronimo.deployment.ModuleIDBuilder;
@@ -350,9 +349,8 @@ public class ConnectorModuleBuilderTest 
             ClassLoader oldCl = Thread.currentThread().getContextClassLoader();
 
             JarFile rarJarFile = JarUtils.createJarFile(rarFile);
-            AbstractName earName = null;
             String moduleName = "geronimo/test-ear/1.0/car";
-            Module module = moduleBuilder.createModule(action.getVendorDD(), rarJarFile, moduleName, action.getSpecDD(), null, null, earName, naming, new ModuleIDBuilder());
+            Module module = moduleBuilder.createModule(action.getVendorDD(), rarJarFile, moduleName, action.getSpecDD(), null, null, null, naming, new ModuleIDBuilder());
             if (module == null) {
                 throw new DeploymentException("Was not a connector module");
             }

Modified: geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-builder-1_6/src/test/java/org/apache/geronimo/connector/deployment/MessageDestinationTest.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-builder-1_6/src/test/java/org/apache/geronimo/connector/deployment/MessageDestinationTest.java?rev=950397&r1=950396&r2=950397&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-builder-1_6/src/test/java/org/apache/geronimo/connector/deployment/MessageDestinationTest.java (original)
+++ geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-builder-1_6/src/test/java/org/apache/geronimo/connector/deployment/MessageDestinationTest.java Wed Jun  2 07:35:24 2010
@@ -20,7 +20,6 @@ import java.io.File;
 import java.util.Collections;
 import java.util.HashMap;
 import java.util.Map;
-import java.util.HashSet;
 
 import junit.framework.TestCase;
 import org.apache.geronimo.common.DeploymentException;
@@ -35,22 +34,16 @@ import org.apache.geronimo.j2ee.j2eeobje
 import org.apache.geronimo.j2ee.jndi.JndiScope;
 import org.apache.geronimo.kernel.Jsr77Naming;
 import org.apache.geronimo.kernel.Naming;
-import org.apache.geronimo.kernel.Kernel;
-import org.apache.geronimo.kernel.basic.BasicKernel;
 import org.apache.geronimo.kernel.config.Configuration;
 import org.apache.geronimo.kernel.config.ConfigurationManager;
 import org.apache.geronimo.kernel.config.ConfigurationModuleType;
-import org.apache.geronimo.kernel.config.KernelConfigurationManager;
-import org.apache.geronimo.kernel.config.ConfigurationStore;
-import org.apache.geronimo.kernel.mock.MockConfigurationManager;
 import org.apache.geronimo.kernel.mock.MockConfigStore;
+import org.apache.geronimo.kernel.mock.MockConfigurationManager;
 import org.apache.geronimo.kernel.osgi.MockBundleContext;
 import org.apache.geronimo.kernel.repository.Artifact;
-import org.apache.geronimo.kernel.repository.Environment;
 import org.apache.geronimo.kernel.repository.ArtifactManager;
 import org.apache.geronimo.kernel.repository.DefaultArtifactManager;
-import org.apache.geronimo.kernel.repository.DefaultArtifactResolver;
-import org.apache.geronimo.kernel.repository.ListableRepository;
+import org.apache.geronimo.kernel.repository.Environment;
 import org.apache.geronimo.schema.SchemaConversionUtils;
 import org.apache.xmlbeans.XmlCursor;
 import org.apache.xmlbeans.XmlException;
@@ -81,7 +74,7 @@ public class MessageDestinationTest exte
         locations.put(null, artifact);
         BundleContext bundleContext = new MockBundleContext(getClass().getClassLoader(), "", null, locations);
         Artifact id = new Artifact("test", "test", "", "car");
-        module  = new ConnectorModule(false, new AbstractName(id, Collections.singletonMap("name", "test")), null, null, null, "foo", null, null, null, null);
+        module  = new ConnectorModule(false, new AbstractName(id, Collections.singletonMap("name", "test")), null, null, null, "foo", null, null, null, null, null, null);
         ConfigurationManager configurationManager = new MockConfigurationManager();
         EARContext earContext = new EARContext(new File("foo"),
             null,
@@ -139,7 +132,7 @@ public class MessageDestinationTest exte
         configuration.addGBean(new GBeanData(n1, AdminObjectWrapperGBean.GBEAN_INFO));
         configuration.addGBean(new GBeanData(n2, AdminObjectWrapperGBean.GBEAN_INFO));
         adminObjectRefBuilder.buildNaming(specDD, plan, module, componentContext);
-        assertEquals(2, NamingBuilder.JNDI_KEY.get(componentContext).get(JndiScope.comp).size());
+        assertEquals(2, module.getJndiScope(JndiScope.comp).size());
     }
 
     private static final String PLAN2 = "<tmp xmlns=\"http://geronimo.apache.org/xml/ns/naming-1.2\">" +
@@ -163,7 +156,7 @@ public class MessageDestinationTest exte
         configuration.addGBean(new GBeanData(n1, AdminObjectWrapperGBean.GBEAN_INFO));
         configuration.addGBean(new GBeanData(n2, AdminObjectWrapperGBean.GBEAN_INFO));
         adminObjectRefBuilder.buildNaming(specDD, plan, module, componentContext);
-        assertEquals(2, NamingBuilder.JNDI_KEY.get(componentContext).get(JndiScope.comp).size());
+        assertEquals(2, module.getJndiScope(JndiScope.comp).size());
     }
 
     private static final String SPECDD2 = "<tmp xmlns=\"http://java.sun.com/xml/ns/j2ee\">" +

Modified: geronimo/server/trunk/plugins/connector-1_6/transaction-1_6/src/main/history/dependencies.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/connector-1_6/transaction-1_6/src/main/history/dependencies.xml?rev=950397&r1=950396&r2=950397&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/connector-1_6/transaction-1_6/src/main/history/dependencies.xml (original)
+++ geronimo/server/trunk/plugins/connector-1_6/transaction-1_6/src/main/history/dependencies.xml Wed Jun  2 07:35:24 2010
@@ -23,6 +23,16 @@
     </dependency>
     <dependency>
         <groupId>org.apache.geronimo.framework</groupId>
+        <artifactId>geronimo-cli</artifactId>
+        <type>jar</type>
+    </dependency>
+    <dependency>
+        <groupId>org.apache.geronimo.framework</groupId>
+        <artifactId>geronimo-main</artifactId>
+        <type>jar</type>
+    </dependency>
+    <dependency>
+        <groupId>org.apache.geronimo.framework</groupId>
         <artifactId>j2ee-security</artifactId>
         <type>car</type>
     </dependency>
@@ -38,15 +48,50 @@
     </dependency>
     <dependency>
         <groupId>org.apache.geronimo.specs</groupId>
+        <artifactId>geronimo-ejb_3.1_spec</artifactId>
+        <type>jar</type>
+    </dependency>
+    <dependency>
+        <groupId>org.apache.geronimo.specs</groupId>
         <artifactId>geronimo-j2ee-connector_1.6_spec</artifactId>
         <type>jar</type>
     </dependency>
     <dependency>
         <groupId>org.apache.geronimo.specs</groupId>
+        <artifactId>geronimo-j2ee-management_1.1_spec</artifactId>
+        <type>jar</type>
+    </dependency>
+    <dependency>
+        <groupId>org.apache.geronimo.specs</groupId>
+        <artifactId>geronimo-jaxrpc_1.1_spec</artifactId>
+        <type>jar</type>
+    </dependency>
+    <dependency>
+        <groupId>org.apache.geronimo.specs</groupId>
         <artifactId>geronimo-jpa_2.0_spec</artifactId>
         <type>jar</type>
     </dependency>
     <dependency>
+        <groupId>org.apache.geronimo.specs</groupId>
+        <artifactId>geronimo-osgi-registry</artifactId>
+        <type>jar</type>
+    </dependency>
+    <dependency>
+        <groupId>org.apache.servicemix.bundles</groupId>
+        <artifactId>org.apache.servicemix.bundles.xpp3</artifactId>
+        <type>jar</type>
+    </dependency>
+    <dependency>
+        <groupId>org.apache.xbean</groupId>
+        <artifactId>xbean-bundleutils</artifactId>
+        <type>jar</type>
+    </dependency>
+    <dependency>
+        <groupId>org.apache.xbean</groupId>
+        <artifactId>xbean-finder</artifactId>
+        <type>jar</type>
+    </dependency>
+    <dependency>
         <groupId>org.tranql</groupId>
         <artifactId>tranql-connector</artifactId>
         <type>jar</type>

Modified: geronimo/server/trunk/plugins/corba/geronimo-corba-builder/src/main/java/org/apache/geronimo/corba/deployment/CorbaRefBuilder.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/corba/geronimo-corba-builder/src/main/java/org/apache/geronimo/corba/deployment/CorbaRefBuilder.java?rev=950397&r1=950396&r2=950397&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/corba/geronimo-corba-builder/src/main/java/org/apache/geronimo/corba/deployment/CorbaRefBuilder.java (original)
+++ geronimo/server/trunk/plugins/corba/geronimo-corba-builder/src/main/java/org/apache/geronimo/corba/deployment/CorbaRefBuilder.java Wed Jun  2 07:35:24 2010
@@ -68,8 +68,8 @@ public class CorbaRefBuilder extends Abs
                 AbstractNameQuery corbaName = corbaGBeanNameSource.getCorbaGBeanName();
                 if (corbaName != null) {
                     Artifact[] moduleId = module.getConfigId();
-                    put("env/ORB", new ORBReference(moduleId, corbaName), JNDI_KEY.get(sharedContext));
-                    put("env/HandleDelegate", new HandleDelegateReference(moduleId, corbaName), JNDI_KEY.get(sharedContext));
+                    put("env/ORB", new ORBReference(moduleId, corbaName), module.getJndiContext());
+                    put("env/HandleDelegate", new HandleDelegateReference(moduleId, corbaName), module.getJndiContext());
                 }
             }
         }

Modified: geronimo/server/trunk/plugins/corba/geronimo-corba-builder/src/main/java/org/apache/geronimo/corba/deployment/OpenEjbCorbaRefBuilder.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/corba/geronimo-corba-builder/src/main/java/org/apache/geronimo/corba/deployment/OpenEjbCorbaRefBuilder.java?rev=950397&r1=950396&r2=950397&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/corba/geronimo-corba-builder/src/main/java/org/apache/geronimo/corba/deployment/OpenEjbCorbaRefBuilder.java (original)
+++ geronimo/server/trunk/plugins/corba/geronimo-corba-builder/src/main/java/org/apache/geronimo/corba/deployment/OpenEjbCorbaRefBuilder.java Wed Jun  2 07:35:24 2010
@@ -114,7 +114,7 @@ public class OpenEjbCorbaRefBuilder exte
 
             Reference ejbReference = addEJBRef(module, ejbRef, remoteRef, bundle);
             if (ejbReference != null) {
-                put(ejbRefName, ejbReference, JNDI_KEY.get(sharedContext));
+                put(ejbRefName, ejbReference, module.getJndiContext());
             }
         }
     }

Modified: geronimo/server/trunk/plugins/j2ee/geronimo-j2ee-builder/src/main/java/org/apache/geronimo/j2ee/deployment/AppClientModule.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/j2ee/geronimo-j2ee-builder/src/main/java/org/apache/geronimo/j2ee/deployment/AppClientModule.java?rev=950397&r1=950396&r2=950397&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/j2ee/geronimo-j2ee-builder/src/main/java/org/apache/geronimo/j2ee/deployment/AppClientModule.java (original)
+++ geronimo/server/trunk/plugins/j2ee/geronimo-j2ee-builder/src/main/java/org/apache/geronimo/j2ee/deployment/AppClientModule.java Wed Jun  2 07:35:24 2010
@@ -35,7 +35,6 @@ public class AppClientModule extends Mod
     private JarFile earFile;
     private final AbstractName appClientName;
     private final String mainClassName;
-    private final Collection<ConnectorModule> resourceModules;
 
     public AppClientModule(boolean standAlone, 
                            AbstractName moduleName, 
@@ -49,14 +48,12 @@ public class AppClientModule extends Mod
                            String mainClassName, 
                            XmlObject vendorDD, 
                            String originalSpecDD, 
-                           Collection<ConnectorModule> resourceModules, 
                            AnnotatedApplicationClient annotatedAppClient ) {
         super(standAlone, moduleName, name, clientEnvironment, moduleFile, targetPath, 
-              specDD, vendorDD, originalSpecDD, null, annotatedAppClient, null, null );
+              specDD, vendorDD, originalSpecDD, null, annotatedAppClient, null, null);
         this.serverEnvironment = serverEnvironment;
         this.appClientName = appClientName;
         this.mainClassName = mainClassName;
-        this.resourceModules = resourceModules;
     }
 
     public ConfigurationModuleType getType() {
@@ -83,19 +80,6 @@ public class AppClientModule extends Mod
         return mainClassName;
     }
 
-    public Collection<ConnectorModule> getResourceModules() {
-        return resourceModules;
-    }
-
-    public void close() {
-        if (resourceModules != null) {
-            for (ConnectorModule resourceModule : resourceModules) {
-                resourceModule.close();
-            }
-        }
-        super.close();
-    }
-
 }
 
 

Modified: geronimo/server/trunk/plugins/j2ee/geronimo-j2ee-builder/src/main/java/org/apache/geronimo/j2ee/deployment/ApplicationInfo.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/j2ee/geronimo-j2ee-builder/src/main/java/org/apache/geronimo/j2ee/deployment/ApplicationInfo.java?rev=950397&r1=950396&r2=950397&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/j2ee/geronimo-j2ee-builder/src/main/java/org/apache/geronimo/j2ee/deployment/ApplicationInfo.java (original)
+++ geronimo/server/trunk/plugins/j2ee/geronimo-j2ee-builder/src/main/java/org/apache/geronimo/j2ee/deployment/ApplicationInfo.java Wed Jun  2 07:35:24 2010
@@ -23,7 +23,6 @@ import org.apache.geronimo.j2ee.deployme
 import org.apache.geronimo.kernel.config.ConfigurationModuleType;
 import org.apache.geronimo.kernel.repository.Environment;
 import org.apache.geronimo.gbean.AbstractName;
-import org.apache.geronimo.j2ee.deployment.Module;
 import org.apache.geronimo.deployment.ModuleList;
 import org.apache.xmlbeans.XmlObject;
 
@@ -41,11 +40,9 @@ public class ApplicationInfo extends Mod
                            JarFile earFile,
                            XmlObject specDD,
                            XmlObject vendorDD,
-                           LinkedHashSet<Module<?,?>> modules,
-                           ModuleList moduleLocations,
                            String originalSpecDD,
                            AnnotatedApp annotatedApp) {
-        super(true, baseName, name, environment, earFile, "", specDD, vendorDD, originalSpecDD, null, annotatedApp, moduleLocations, modules);
+        super(true, baseName, name, environment, earFile, "", specDD, vendorDD, originalSpecDD, null, annotatedApp, null, null);
         assert type != null;
         assert environment != null;
         assert modules != null;

Modified: geronimo/server/trunk/plugins/j2ee/geronimo-j2ee-builder/src/main/java/org/apache/geronimo/j2ee/deployment/ConnectorModule.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/j2ee/geronimo-j2ee-builder/src/main/java/org/apache/geronimo/j2ee/deployment/ConnectorModule.java?rev=950397&r1=950396&r2=950397&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/j2ee/geronimo-j2ee-builder/src/main/java/org/apache/geronimo/j2ee/deployment/ConnectorModule.java (original)
+++ geronimo/server/trunk/plugins/j2ee/geronimo-j2ee-builder/src/main/java/org/apache/geronimo/j2ee/deployment/ConnectorModule.java Wed Jun  2 07:35:24 2010
@@ -16,10 +16,12 @@
  */
 package org.apache.geronimo.j2ee.deployment;
 
+import java.util.Map;
 import java.util.jar.JarFile;
 
 import org.apache.geronimo.gbean.AbstractName;
 import org.apache.geronimo.j2ee.deployment.annotation.AnnotatedApp;
+import org.apache.geronimo.j2ee.jndi.JndiKey;
 import org.apache.geronimo.kernel.config.ConfigurationModuleType;
 import org.apache.geronimo.kernel.repository.Environment;
 
@@ -28,18 +30,20 @@ import org.apache.geronimo.kernel.reposi
  */
 public class ConnectorModule<T, U> extends Module<T, U> {
     
-    public ConnectorModule(boolean standAlone, 
-                           AbstractName moduleName, 
-                           String name, 
-                           Environment environment, 
-                           JarFile moduleFile, 
-                           String targetPath, 
-                           T specDD, 
-                           U vendorDD, 
-                           String originalSpecDD, 
-                           AnnotatedApp annotatedApp) {
+    public ConnectorModule(boolean standAlone,
+                           AbstractName moduleName,
+                           String name,
+                           Environment environment,
+                           JarFile moduleFile,
+                           String targetPath,
+                           T specDD,
+                           U vendorDD,
+                           String originalSpecDD,
+                           AnnotatedApp annotatedApp,
+                           Map<JndiKey, Map<String, Object>> jndiContext,
+                           Module parentModule) {
         super(standAlone, moduleName, name, environment, moduleFile, 
-              targetPath, specDD, vendorDD, originalSpecDD, null, annotatedApp, null, null );
+              targetPath, specDD, vendorDD, originalSpecDD, null, annotatedApp, jndiContext, parentModule);
     }
 
     public ConfigurationModuleType getType() {

Modified: geronimo/server/trunk/plugins/j2ee/geronimo-j2ee-builder/src/main/java/org/apache/geronimo/j2ee/deployment/EARConfigBuilder.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/j2ee/geronimo-j2ee-builder/src/main/java/org/apache/geronimo/j2ee/deployment/EARConfigBuilder.java?rev=950397&r1=950396&r2=950397&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/j2ee/geronimo-j2ee-builder/src/main/java/org/apache/geronimo/j2ee/deployment/EARConfigBuilder.java (original)
+++ geronimo/server/trunk/plugins/j2ee/geronimo-j2ee-builder/src/main/java/org/apache/geronimo/j2ee/deployment/EARConfigBuilder.java Wed Jun  2 07:35:24 2010
@@ -40,7 +40,6 @@ import java.util.jar.Manifest;
 import java.util.zip.ZipEntry;
 
 import javax.xml.namespace.QName;
-
 import org.apache.geronimo.common.DeploymentException;
 import org.apache.geronimo.deployment.ClassPathList;
 import org.apache.geronimo.deployment.ConfigurationBuilder;
@@ -69,7 +68,6 @@ import org.apache.geronimo.j2ee.deployme
 import org.apache.geronimo.j2ee.deployment.annotation.AnnotatedEAR;
 import org.apache.geronimo.j2ee.j2eeobjectnames.NameFactory;
 import org.apache.geronimo.j2ee.jndi.ApplicationJndi;
-import org.apache.geronimo.j2ee.jndi.JndiKey;
 import org.apache.geronimo.j2ee.jndi.JndiScope;
 import org.apache.geronimo.j2ee.management.impl.J2EEApplicationImpl;
 import org.apache.geronimo.kernel.GBeanAlreadyExistsException;
@@ -98,10 +96,10 @@ import org.apache.geronimo.xbeans.geroni
 import org.apache.geronimo.xbeans.geronimo.j2ee.GerApplicationType;
 import org.apache.geronimo.xbeans.geronimo.j2ee.GerExtModuleType;
 import org.apache.geronimo.xbeans.geronimo.j2ee.GerModuleType;
-import org.apache.geronimo.xbeans.javaee6.WebType;
 import org.apache.geronimo.xbeans.javaee6.ApplicationDocument;
 import org.apache.geronimo.xbeans.javaee6.ApplicationType;
 import org.apache.geronimo.xbeans.javaee6.ModuleType;
+import org.apache.geronimo.xbeans.javaee6.WebType;
 import org.apache.xmlbeans.XmlCursor;
 import org.apache.xmlbeans.XmlException;
 import org.apache.xmlbeans.XmlObject;
@@ -349,17 +347,17 @@ public class EARConfigBuilder implements
             return module;
         }
 
-        return new ApplicationInfo(module.getType(),
+        ApplicationInfo applicationInfo = new ApplicationInfo(module.getType(),
                 module.getEnvironment(),
                 module.getModuleName(),
                 module.getName(),
                 jarFile,
                 null,
                 null,
-                new LinkedHashSet<Module<?,?>>(Collections.<Module<?,?>>singleton(module)),
-                new ModuleList(),
                 null,
                 null);
+        applicationInfo.getModules().add(module);
+        return applicationInfo;
     }
 
     private ApplicationInfo getEarPlan(File planFile, JarFile earFile, ModuleIDBuilder idBuilder) throws DeploymentException {
@@ -379,7 +377,7 @@ public class EARConfigBuilder implements
                 if (!earFile.getName().endsWith(".ear")) {
                     return null;
                 }
-                //TODO return application.xml that we can make metadata complete?
+                application = ApplicationType.Factory.newInstance();
             }
         }
 
@@ -425,33 +423,6 @@ public class EARConfigBuilder implements
         // get the modules either the application plan or for a stand alone module from the specific deployer
         // todo change module so you can extract the real module path back out.. then we can eliminate
         // the moduleLocations and have addModules return the modules
-        ModuleList moduleLocations = new ModuleList();
-        LinkedHashSet<Module<?,?>> modules = new LinkedHashSet<Module<?,?>>();
-        try {
-            addModules(earFile, application, gerApplication, moduleLocations, modules, environment, earName, idBuilder);
-            if (application == null) {
-                if (modules.isEmpty()) {
-                    //if no application.xml and no modules detected, return null for stand-alone module processing
-                    return null;
-                } else {
-                    application = createDefaultSpecPlan(modules);
-                }
-            }
-        } catch (Throwable e) {
-            // close all the modules
-            for (Module module : modules) {
-                module.close();
-            }
-            if (e instanceof DeploymentException) {
-                throw (DeploymentException) e;
-            } else if (e instanceof RuntimeException) {
-                throw (RuntimeException) e;
-            } else if (e instanceof Error) {
-                throw (Error) e;
-            }
-            throw new DeploymentException(e);
-        }
-
         String applicationName = null;
         if (application.isSetApplicationName()) {
             applicationName = application.getApplicationName().getStringValue().trim();
@@ -461,21 +432,42 @@ public class EARConfigBuilder implements
             applicationName = artifact.toString();
         }
         AnnotatedApp annotatedApp = new AnnotatedEAR(application);
-        return new ApplicationInfo(ConfigurationModuleType.EAR,
+        ApplicationInfo applicationInfo = new ApplicationInfo(ConfigurationModuleType.EAR,
                 environment,
                 earName,
                 applicationName,
                 earFile,
                 application,
                 gerApplication,
-                modules,
-                moduleLocations,
-                application == null ? null : application.toString(),
+                application.toString(),
                 annotatedApp);
+        try {
+            addModules(earFile, application, gerApplication, environment, applicationInfo, idBuilder);
+            if (applicationInfo.getModules().isEmpty()) {
+                //if no application.xml and no modules detected, return null for stand-alone module processing
+                return null;
+            } else {
+                addModulesToDefaultPlan(application, applicationInfo.getModules());
+            }
+        } catch (Throwable e) {
+            // close all the modules
+            for (Module module : applicationInfo.getModules()) {
+                module.close();
+            }
+            if (e instanceof DeploymentException) {
+                throw (DeploymentException) e;
+            } else if (e instanceof RuntimeException) {
+                throw (RuntimeException) e;
+            } else if (e instanceof Error) {
+                throw (Error) e;
+            }
+            throw new DeploymentException(e);
+        }
+
+        return applicationInfo;
     }
 
-    private ApplicationType createDefaultSpecPlan(Set<Module<?,?>> modules) {
-        ApplicationType application = ApplicationType.Factory.newInstance();
+    private void addModulesToDefaultPlan(ApplicationType application, Set<Module<?, ?>> modules) {
         for (Module module : modules) {
             ConfigurationModuleType configurationModuleType = module.getType();
             ModuleType moduleType = application.addNewModule();
@@ -492,7 +484,6 @@ public class EARConfigBuilder implements
                 moduleType.addNewJava().setStringValue(module.getTargetPath());
             }
         }
-        return application;
     }
 
     private GerApplicationType createDefaultPlan(ApplicationType application, JarFile module) {
@@ -649,10 +640,7 @@ public class EARConfigBuilder implements
                 }
             }
 
-            Map<JndiKey, Map<String, Object>> contexts = NamingBuilder.JNDI_KEY.get(earContext.getGeneralData());
-            Map<String, Object> app = new HashMap<String, Object>();
-            app.put("app/AppName", applicationInfo.getName());
-            contexts.put(JndiScope.app, app);
+            applicationInfo.getJndiContext().get(JndiScope.app).put("app/AppName", applicationInfo.getName());
 
             // give each module a chance to populate the earContext now that a classloader is available
             Bundle bundle = earContext.getDeploymentBundle();
@@ -740,8 +728,8 @@ public class EARConfigBuilder implements
             }
 
             GBeanData appContexts = new GBeanData(appJndiName, ApplicationJndi.class);
-            appContexts.setAttribute("globalContextSegment", contexts.get(JndiScope.global));
-            appContexts.setAttribute("applicationContextMap", contexts.get(JndiScope.app));
+            appContexts.setAttribute("globalContextSegment", applicationInfo.getJndiContext().get(JndiScope.global));
+            appContexts.setAttribute("applicationContextMap", applicationInfo.getJndiContext().get(JndiScope.app));
             appContexts.setReferencePattern("GlobalContext", globalContextAbstractName);
             earContext.addGBean(appContexts);
 
@@ -833,12 +821,12 @@ public class EARConfigBuilder implements
         return filter;
     }
 
-    private void addModules(JarFile earFile, ApplicationType application, GerApplicationType gerApplication, ModuleList moduleLocations, LinkedHashSet<Module<?,?>> modules, Environment environment, AbstractName earName, ModuleIDBuilder idBuilder) throws DeploymentException {
+    private void addModules(JarFile earFile, ApplicationType application, GerApplicationType gerApplication, Environment environment, Module applicationInfo, ModuleIDBuilder idBuilder) throws DeploymentException {
         Map<String, Object> altVendorDDs = new HashMap<String, Object>();
         try {
             mapVendorPlans(gerApplication, altVendorDDs, earFile);
             if (earFile != null) {
-                if (application != null) {
+                if (application.getModuleArray().length != 0) {
                     ModuleType[] moduleTypes = application.getModuleArray();
 
                     //get a set containing all of the files in the ear that are actually modules
@@ -881,7 +869,7 @@ public class EARConfigBuilder implements
                             throw new DeploymentException("Could not find a module builder for module: " + moduleXml);
                         }
 
-                        moduleLocations.add(modulePath);
+                        applicationInfo.getModuleLocations().add(modulePath);
 
                         NestedJarFile moduleFile;
                         try {
@@ -896,14 +884,14 @@ public class EARConfigBuilder implements
                                 getAltSpecDDURL(earFile, moduleXml),
                                 environment,
                                 moduleContextInfo,
-                                earName,
+                                applicationInfo,
                                 naming, idBuilder);
 
                         if (module == null) {
                             throw new DeploymentException("Module was not " + moduleTypeName + ": " + modulePath);
                         }
 
-                        modules.add(module);
+                        applicationInfo.getModules().add(module);
                     }
                 } else {
                     //no application.xml available, must inspect ear to locate and process modules
@@ -951,12 +939,12 @@ public class EARConfigBuilder implements
                                             null,
                                             environment,
                                             moduleContextInfo,
-                                            earName,
+                                            applicationInfo,
                                             naming, idBuilder);
 
                                     if (module != null) {
-                                        moduleLocations.add(entry.getName());
-                                        modules.add(module);
+                                        applicationInfo.getModuleLocations().add(entry.getName());
+                                        applicationInfo.getModules().add(module);
                                     }
                                     continue;
                                 }
@@ -968,7 +956,7 @@ public class EARConfigBuilder implements
                             continue;
                         }
 
-                        moduleLocations.add(entry.getName());
+                        applicationInfo.getModuleLocations().add(entry.getName());
 
                         NestedJarFile moduleFile;
                         try {
@@ -983,22 +971,22 @@ public class EARConfigBuilder implements
                                 null,
                                 environment,
                                 moduleContextInfo,
-                                earName,
+                                applicationInfo,
                                 naming, idBuilder);
 
                         if (module == null) {
                             throw new DeploymentException("Module was not " + moduleTypeName + ": " + entry.getName());
                         }
 
-                        modules.add(module);
+                        applicationInfo.getModules().add(module);
                     }
                 }
             }
 
             //all the modules in the geronimo plan should have been found by now.
-            if (!moduleLocations.containsAll(altVendorDDs.keySet())) {
+            if (!applicationInfo.getModuleLocations().containsAll(altVendorDDs.keySet())) {
                 HashSet<String> missingModules = new HashSet<String>(altVendorDDs.keySet());
-                missingModules.removeAll(moduleLocations);
+                missingModules.removeAll(applicationInfo.getModuleLocations());
                 throw new DeploymentException("Geronimo ear plan contains modules that are not in the ear: " + missingModules);
             }
             //deploy the extension modules
@@ -1050,7 +1038,7 @@ public class EARConfigBuilder implements
                 JarFile moduleFile;
                 if (gerExtModule.isSetInternalPath()) {
                     String modulePath = gerExtModule.getInternalPath().trim();
-                    moduleLocations.add(modulePath);
+                    applicationInfo.getModuleLocations().add(modulePath);
                     try {
                         moduleFile = new NestedJarFile(earFile, modulePath);
                     } catch (IOException e) {
@@ -1092,14 +1080,14 @@ public class EARConfigBuilder implements
                         null, //TODO implement an alt-spec-dd element
                         environment,
                         moduleContextInfo,
-                        earName,
+                        applicationInfo,
                         naming, idBuilder);
 
                 if (module == null) {
                     throw new DeploymentException("Module was not " + moduleTypeName + ": " + moduleName);
                 }
 
-                modules.add(module);
+                applicationInfo.getModules().add(module);
             }
         } finally {
             // delete all the temp files created for alt vendor dds

Modified: geronimo/server/trunk/plugins/j2ee/geronimo-j2ee-builder/src/main/java/org/apache/geronimo/j2ee/deployment/EJBModule.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/j2ee/geronimo-j2ee-builder/src/main/java/org/apache/geronimo/j2ee/deployment/EJBModule.java?rev=950397&r1=950396&r2=950397&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/j2ee/geronimo-j2ee-builder/src/main/java/org/apache/geronimo/j2ee/deployment/EJBModule.java (original)
+++ geronimo/server/trunk/plugins/j2ee/geronimo-j2ee-builder/src/main/java/org/apache/geronimo/j2ee/deployment/EJBModule.java Wed Jun  2 07:35:24 2010
@@ -16,10 +16,12 @@
  */
 package org.apache.geronimo.j2ee.deployment;
 
+import java.util.Map;
 import java.util.jar.JarFile;
 
 import org.apache.geronimo.gbean.AbstractName;
 import org.apache.geronimo.j2ee.deployment.annotation.AnnotatedApp;
+import org.apache.geronimo.j2ee.jndi.JndiKey;
 import org.apache.geronimo.kernel.config.ConfigurationModuleType;
 import org.apache.geronimo.kernel.repository.Environment;
 import org.apache.xmlbeans.XmlObject;
@@ -30,18 +32,20 @@ import org.apache.xmlbeans.XmlObject;
 public class EJBModule extends Module<XmlObject, XmlObject> {
     private AbstractName moduleCmpEngineName;
 
-    public EJBModule(boolean standAlone, 
-                     AbstractName moduleName, 
+    public EJBModule(boolean standAlone,
+                     AbstractName moduleName,
                      String name,
-                     Environment environment, 
-                     JarFile moduleFile, 
-                     String targetPath, 
-                     XmlObject specDD, 
-                     XmlObject vendorDD, 
-                     String originalSpecDD, 
-                     AnnotatedApp annotatedApp) {
+                     Environment environment,
+                     JarFile moduleFile,
+                     String targetPath,
+                     XmlObject specDD,
+                     XmlObject vendorDD,
+                     String originalSpecDD,
+                     AnnotatedApp annotatedApp,
+                     Map<JndiKey, Map<String, Object>> jndiContext,
+                     Module parentModule) {
         super(standAlone, moduleName, name, environment, moduleFile, 
-              targetPath, specDD, vendorDD, originalSpecDD, null, annotatedApp, null, null);
+              targetPath, specDD, vendorDD, originalSpecDD, null, annotatedApp, jndiContext, parentModule);
     }
 
     public ConfigurationModuleType getType() {

Modified: geronimo/server/trunk/plugins/j2ee/geronimo-j2ee-builder/src/main/java/org/apache/geronimo/j2ee/deployment/Module.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/j2ee/geronimo-j2ee-builder/src/main/java/org/apache/geronimo/j2ee/deployment/Module.java?rev=950397&r1=950396&r2=950397&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/j2ee/geronimo-j2ee-builder/src/main/java/org/apache/geronimo/j2ee/deployment/Module.java (original)
+++ geronimo/server/trunk/plugins/j2ee/geronimo-j2ee-builder/src/main/java/org/apache/geronimo/j2ee/deployment/Module.java Wed Jun  2 07:35:24 2010
@@ -17,6 +17,7 @@
 package org.apache.geronimo.j2ee.deployment;
 
 import java.net.URI;
+import java.util.EnumSet;
 import java.util.HashMap;
 import java.util.LinkedHashSet;
 import java.util.Map;
@@ -28,10 +29,13 @@ import org.apache.geronimo.deployment.De
 import org.apache.geronimo.deployment.ModuleList;
 import org.apache.geronimo.gbean.AbstractName;
 import org.apache.geronimo.j2ee.deployment.annotation.AnnotatedApp;
+import org.apache.geronimo.j2ee.jndi.JndiKey;
+import org.apache.geronimo.j2ee.jndi.JndiScope;
 import org.apache.geronimo.kernel.config.ConfigurationData;
 import org.apache.geronimo.kernel.config.ConfigurationModuleType;
 import org.apache.geronimo.kernel.repository.Artifact;
 import org.apache.geronimo.kernel.repository.Environment;
+import org.apache.xbean.finder.AbstractFinder;
 import org.apache.xbean.finder.ClassFinder;
 
 /**
@@ -55,11 +59,14 @@ public abstract class Module<T, U> {
     private T specDD;
     private String originalSpecDD;
     private AnnotatedApp annotatedApp;
-    private ClassFinder classFinder;
+    private AbstractFinder classFinder;
 
     protected final Map sharedContext = new HashMap();
-    protected LinkedHashSet<Module<?,?>> modules = new LinkedHashSet<Module<?,?>>();
-    protected ModuleList moduleLocations = new ModuleList();
+    protected final LinkedHashSet<Module<?, ?>> modules;
+    protected final ModuleList moduleLocations;
+
+    private final Map<JndiKey, Map<String, Object>> jndiContext;
+    private final Module<?, ?> parentModule;
 
     protected Module(boolean standAlone,
                      AbstractName moduleName,
@@ -72,31 +79,26 @@ public abstract class Module<T, U> {
                      String originalSpecDD,
                      String namespace,
                      AnnotatedApp annotatedApp,
-                     ModuleList moduleLocations,
-                     LinkedHashSet<Module<?,?>> modules) {
-        this(standAlone, moduleName, name, environment, new DeployableJarFile(moduleFile), 
-             targetPath, specDD, vendorDD, originalSpecDD, namespace, annotatedApp);
-        if (moduleLocations != null) {
-            this.moduleLocations = moduleLocations;
-        }
-        if (modules != null) {
-            this.modules = modules;
-        }
+                     Map<JndiKey, Map<String, Object>> jndiContext,
+                     Module<?, ?> parentModule) {
+        this(standAlone, moduleName, name, environment, new DeployableJarFile(moduleFile),
+                targetPath, specDD, vendorDD, originalSpecDD, namespace, annotatedApp, jndiContext, parentModule);
     }
 
-    protected Module(boolean standAlone, 
+    protected Module(boolean standAlone,
                      AbstractName moduleName,
-                     String name, 
-                     Environment environment, 
-                     Deployable deployable, 
-                     String targetPath, 
-                     T specDD, 
-                     U vendorDD, 
-                     String originalSpecDD, 
-                     String namespace, 
-                     AnnotatedApp annotatedApp) {
-        assert targetPath != null: "targetPath is null";
-        assert moduleName != null: "moduleName is null";
+                     String name,
+                     Environment environment,
+                     Deployable deployable,
+                     String targetPath,
+                     T specDD,
+                     U vendorDD,
+                     String originalSpecDD,
+                     String namespace,
+                     AnnotatedApp annotatedApp,
+                     Map<JndiKey, Map<String, Object>> jndiContext, Module<?, ?> parentModule) {
+        assert targetPath != null : "targetPath is null";
+        assert moduleName != null : "moduleName is null";
 
         this.standAlone = standAlone;
         this.moduleName = moduleName;
@@ -107,7 +109,7 @@ public abstract class Module<T, U> {
         this.vendorDD = vendorDD;
         this.originalSpecDD = originalSpecDD;
         this.namespace = namespace;
-        
+
         if (standAlone) {
             this.name = (name == null) ? environment.getConfigId().toString() : name;
             this.moduleURI = URI.create("");
@@ -118,6 +120,14 @@ public abstract class Module<T, U> {
 
         targetPathURI = URI.create(targetPath + "/");
         this.annotatedApp = annotatedApp;
+        this.moduleLocations = new ModuleList();
+        this.modules = new LinkedHashSet<Module<?, ?>>();
+        if (jndiContext != null) {
+            this.jndiContext = jndiContext;
+        } else {
+            this.jndiContext = assure(new HashMap<JndiKey, Map<String, Object>>());
+        }
+        this.parentModule = parentModule;
     }
 
     public abstract ConfigurationModuleType getType();
@@ -241,11 +251,11 @@ public abstract class Module<T, U> {
         this.annotatedApp = annotatedApp;
     }
 
-    public ClassFinder getClassFinder() {
+    public AbstractFinder getClassFinder() {
         return classFinder;
     }
 
-    public void setClassFinder(ClassFinder classFinder) {
+    public void setClassFinder(AbstractFinder classFinder) {
         this.classFinder = classFinder;
     }
 
@@ -254,16 +264,16 @@ public abstract class Module<T, U> {
             throw new NullPointerException("No ear context set");
         }
         if (rootEarContext == null || rootEarContext == earContext || rootEarContext.getConfigID().equals(earContext.getConfigID())) {
-            return new Artifact[] {earContext.getConfigID()};
+            return new Artifact[]{earContext.getConfigID()};
         }
-        return new Artifact[] {rootEarContext.getConfigID(), earContext.getConfigID()};
+        return new Artifact[]{rootEarContext.getConfigID(), earContext.getConfigID()};
     }
 
     /**
      * Given a path in the ear module, return something that will resolve to that location against the eventual configuration
      * base uri.  Currently for all modules except wars that is the original path.  If we create separate configurations for
      * ejb or rar modules, those Module subclasses will need to reimplement this method.
-     *
+     * <p/>
      * Example:  if a war is myweb.war, and you pass in myweb.war/WEB-INF/lib/foo.jar, you get WEB-INF/lib/foo.jar
      * if you pass in myFoo.jar, you get ../myFoo.jar
      *
@@ -281,19 +291,48 @@ public abstract class Module<T, U> {
         }
     }
 
-    public LinkedHashSet<Module<?,?>> getModules() {
+    public LinkedHashSet<Module<?, ?>> getModules() {
         return modules;
     }
 
-    public void setModules(LinkedHashSet<Module<?,?>> modules) {
-        this.modules = modules;
-    }
-
     public ModuleList getModuleLocations() {
         return moduleLocations;
     }
 
-    public void setModuleLocations(ModuleList moduleLocations) {
-        this.moduleLocations = moduleLocations;
+    public Map<JndiKey, Map<String, Object>> getJndiContext() {
+        return jndiContext;
+    }
+
+    public Map<String, Object> getJndiScope(JndiKey scope) {
+        return jndiContext.get(scope);
+    }
+
+    public final static EnumSet<JndiScope> APP = EnumSet.of(JndiScope.global, JndiScope.app);
+    public final static EnumSet<JndiScope> MODULE = EnumSet.of(JndiScope.global, JndiScope.app, JndiScope.module);
+
+    public Module<?, ?> getParentModule() {
+        return parentModule;
+    }
+
+    public static Map<JndiKey, Map<String, Object>> share(EnumSet<JndiScope> scopes, Map<JndiKey, Map<String, Object>> jndiContext) {
+        Map<JndiKey, Map<String, Object>> newContext = new HashMap<JndiKey, Map<String, Object>>();
+        if (jndiContext != null) {
+            for (JndiScope scope : scopes) {
+                Map<String, Object> scopedContext = jndiContext.get(scope);
+                if (scopedContext != null) {
+                    newContext.put(scope, scopedContext);
+                }
+            }
+        }
+        return assure(newContext);
+    }
+
+    public static Map<JndiKey, Map<String, Object>> assure(Map<JndiKey, Map<String, Object>> jndiContext) {
+        for (JndiScope scope : JndiScope.values()) {
+            if (jndiContext.get(scope) == null) {
+                jndiContext.put(scope, new HashMap<String, Object>());
+            }
+        }
+        return jndiContext;
     }
 }

Modified: geronimo/server/trunk/plugins/j2ee/geronimo-j2ee-builder/src/main/java/org/apache/geronimo/j2ee/deployment/ModuleBuilder.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/j2ee/geronimo-j2ee-builder/src/main/java/org/apache/geronimo/j2ee/deployment/ModuleBuilder.java?rev=950397&r1=950396&r2=950397&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/j2ee/geronimo-j2ee-builder/src/main/java/org/apache/geronimo/j2ee/deployment/ModuleBuilder.java (original)
+++ geronimo/server/trunk/plugins/j2ee/geronimo-j2ee-builder/src/main/java/org/apache/geronimo/j2ee/deployment/ModuleBuilder.java Wed Jun  2 07:35:24 2010
@@ -22,7 +22,6 @@ import java.util.Collection;
 import java.util.jar.JarFile;
 
 import org.apache.geronimo.common.DeploymentException;
-import org.apache.geronimo.gbean.AbstractName;
 import org.apache.geronimo.kernel.Naming;
 import org.apache.geronimo.kernel.config.ConfigurationStore;
 import org.apache.geronimo.kernel.repository.Environment;
@@ -33,12 +32,42 @@ import org.osgi.framework.Bundle;
  * @version $Rev:386276 $ $Date$
  */
 public interface ModuleBuilder {
-    
+
+    /**
+     * Starting with bundle
+     * @param bundle
+     * @param naming
+     * @param idBuilder
+     * @return
+     * @throws DeploymentException
+     */
     Module createModule(Bundle bundle, Naming naming, ModuleIDBuilder idBuilder) throws DeploymentException;
-    
+
+    /**
+     * standalone module
+     * @param plan
+     * @param moduleFile
+     * @param naming
+     * @param idBuilder
+     * @return
+     * @throws DeploymentException
+     */
     Module createModule(File plan, JarFile moduleFile, Naming naming, ModuleIDBuilder idBuilder) throws DeploymentException;
 
-    Module createModule(Object plan, JarFile moduleFile, String targetPath, URL specDDUrl, Environment environment, Object moduleContextInfo, AbstractName earName, Naming naming, ModuleIDBuilder idBuilder) throws DeploymentException;
+    /**
+     * Component of ear
+     * @param plan
+     * @param moduleFile
+     * @param targetPath
+     * @param specDDUrl
+     * @param environment
+     * @param moduleContextInfo
+     * @param parentModule
+     *@param naming
+     * @param idBuilder   @return
+     * @throws DeploymentException
+     */
+    Module createModule(Object plan, JarFile moduleFile, String targetPath, URL specDDUrl, Environment environment, Object moduleContextInfo, Module parentModule, Naming naming, ModuleIDBuilder idBuilder) throws DeploymentException;
 
     void installModule(JarFile earFile, EARContext earContext, Module module, Collection configurationStores, ConfigurationStore targetConfigurationStore, Collection repository) throws DeploymentException;
 



Mime
View raw message