geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From djen...@apache.org
Subject svn commit: r378707 [1/2] - in /geronimo/branches/configid: applications/console-standard/src/java/org/apache/geronimo/console/jmsmanager/handlers/ configs/client-system/src/plan/ configs/geronimo-gbean-deployer/src/plan/ configs/j2ee-system/src/plan/ ...
Date Sat, 18 Feb 2006 08:58:02 GMT
Author: djencks
Date: Sat Feb 18 00:57:59 2006
New Revision: 378707

URL: http://svn.apache.org/viewcvs?rev=378707&view=rev
Log:
Better tracking of output files.  Some configurations build.

Modified:
    geronimo/branches/configid/applications/console-standard/src/java/org/apache/geronimo/console/jmsmanager/handlers/CreateDestinationHandler.java
    geronimo/branches/configid/configs/client-system/src/plan/plan.xml
    geronimo/branches/configid/configs/geronimo-gbean-deployer/src/plan/plan.xml
    geronimo/branches/configid/configs/j2ee-system/src/plan/plan.xml
    geronimo/branches/configid/configs/online-deployer/src/plan/plan.xml
    geronimo/branches/configid/configs/shutdown/src/plan/plan.xml
    geronimo/branches/configid/etc/project.properties
    geronimo/branches/configid/modules/client-builder/src/java/org/apache/geronimo/client/builder/AppClientModuleBuilder.java
    geronimo/branches/configid/modules/client-builder/src/test/org/apache/geronimo/client/builder/PlanParsingTest.java
    geronimo/branches/configid/modules/connector-builder/src/java/org/apache/geronimo/connector/deployment/ConnectorModuleBuilder.java
    geronimo/branches/configid/modules/connector-builder/src/test/org/apache/geronimo/connector/deployment/ConnectorModuleBuilderTest.java
    geronimo/branches/configid/modules/deploy-tool/src/java/org/apache/geronimo/deployment/PluginBootstrap.java
    geronimo/branches/configid/modules/deployment/src/java/org/apache/geronimo/deployment/ConfigurationBuilder.java
    geronimo/branches/configid/modules/deployment/src/java/org/apache/geronimo/deployment/Deployer.java
    geronimo/branches/configid/modules/deployment/src/java/org/apache/geronimo/deployment/DeploymentContext.java
    geronimo/branches/configid/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/EARConfigBuilder.java
    geronimo/branches/configid/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/Module.java
    geronimo/branches/configid/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/ModuleBuilder.java
    geronimo/branches/configid/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/SwitchingModuleBuilder.java
    geronimo/branches/configid/modules/j2ee-builder/src/test/org/apache/geronimo/j2ee/deployment/EARConfigBuilderTest.java
    geronimo/branches/configid/modules/j2ee-builder/src/test/org/apache/geronimo/j2ee/deployment/MockConnectorConfigBuilder.java
    geronimo/branches/configid/modules/j2ee-builder/src/test/org/apache/geronimo/j2ee/deployment/MockEJBConfigBuilder.java
    geronimo/branches/configid/modules/j2ee-builder/src/test/org/apache/geronimo/j2ee/deployment/MockWARConfigBuilder.java
    geronimo/branches/configid/modules/jetty-builder/src/java/org/apache/geronimo/jetty/deployment/JettyModuleBuilder.java
    geronimo/branches/configid/modules/jetty-builder/src/test/org/apache/geronimo/jetty/deployment/JettyModuleBuilderTest.java
    geronimo/branches/configid/modules/kernel/src/java/org/apache/geronimo/kernel/config/ConfigurationData.java
    geronimo/branches/configid/modules/kernel/src/java/org/apache/geronimo/kernel/config/ConfigurationStore.java
    geronimo/branches/configid/modules/service-builder/src/java/org/apache/geronimo/deployment/service/EnvironmentBuilder.java
    geronimo/branches/configid/modules/service-builder/src/java/org/apache/geronimo/deployment/service/ServiceConfigBuilder.java
    geronimo/branches/configid/modules/system/src/java/org/apache/geronimo/system/configuration/ExecutableConfigurationUtil.java
    geronimo/branches/configid/modules/system/src/java/org/apache/geronimo/system/configuration/LocalConfigStore.java
    geronimo/branches/configid/modules/tomcat-builder/src/java/org/apache/geronimo/tomcat/deployment/TomcatModuleBuilder.java
    geronimo/branches/configid/modules/tomcat-builder/src/test/org/apache/geronimo/tomcat/deployment/TomcatModuleBuilderTest.java
    geronimo/branches/configid/plugins/geronimo-packaging-plugin/src/java/org/apache/geronimo/plugin/packaging/MavenConfigStore.java
    geronimo/branches/configid/plugins/geronimo-packaging-plugin/src/java/org/apache/geronimo/plugin/packaging/PlanProcessor.java

Modified: geronimo/branches/configid/applications/console-standard/src/java/org/apache/geronimo/console/jmsmanager/handlers/CreateDestinationHandler.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/configid/applications/console-standard/src/java/org/apache/geronimo/console/jmsmanager/handlers/CreateDestinationHandler.java?rev=378707&r1=378706&r2=378707&view=diff
==============================================================================
--- geronimo/branches/configid/applications/console-standard/src/java/org/apache/geronimo/console/jmsmanager/handlers/CreateDestinationHandler.java (original)
+++ geronimo/branches/configid/applications/console-standard/src/java/org/apache/geronimo/console/jmsmanager/handlers/CreateDestinationHandler.java Sat Feb 18 00:57:59 2006
@@ -145,7 +145,7 @@
                     new LinkedHashSet(),
                     gbeans,
                     Collections.EMPTY_LIST,
-                    environment);
+                    environment, configurationDir);
 
             //saves it.
             //deploymentContext.close();

Modified: geronimo/branches/configid/configs/client-system/src/plan/plan.xml
URL: http://svn.apache.org/viewcvs/geronimo/branches/configid/configs/client-system/src/plan/plan.xml?rev=378707&r1=378706&r2=378707&view=diff
==============================================================================
--- geronimo/branches/configid/configs/client-system/src/plan/plan.xml (original)
+++ geronimo/branches/configid/configs/client-system/src/plan/plan.xml Sat Feb 18 00:57:59 2006
@@ -18,20 +18,18 @@
 
 
 <!--
-Configuration for the innermost ring of a Geronimo server.
-This configuration should only contain critical services needed to
-run other Configurations - for example, the ServerInfo, Logging
-and Repository services used to load them.
-
-This configuration should *NOT* be used to provide server or application
-specific services - those should be provided by children.
+Configuration for root app client
 -->
-<configuration
-    xmlns="http://geronimo.apache.org/xml/ns/deployment-1.1"
+<configuration xmlns="http://geronimo.apache.org/xml/ns/deployment-1.1">
 
-    domain="geronimo.client"
-    server="client"
-    >
+    <environment>
+        <properties>
+            <property>
+                <name>org.apache.geronimo.name.javax.management.j2ee.BaseName</name>
+                <value>geronimo.client:J2EEServer=client</value>
+            </property>
+        </properties>
+    </environment>
 
     <!-- ServerInfo service -->
     <gbean name="ServerInfo" class="org.apache.geronimo.system.serverinfo.BasicServerInfo"/>

Modified: geronimo/branches/configid/configs/geronimo-gbean-deployer/src/plan/plan.xml
URL: http://svn.apache.org/viewcvs/geronimo/branches/configid/configs/geronimo-gbean-deployer/src/plan/plan.xml?rev=378707&r1=378706&r2=378707&view=diff
==============================================================================
--- geronimo/branches/configid/configs/geronimo-gbean-deployer/src/plan/plan.xml (original)
+++ geronimo/branches/configid/configs/geronimo-gbean-deployer/src/plan/plan.xml Sat Feb 18 00:57:59 2006
@@ -19,15 +19,12 @@
 <configuration xmlns="http://geronimo.apache.org/xml/ns/deployment-1.1">
 
     <environment>
-        <name-key>
-            <key>domain</key>
-            <value>geronimo.maven</value>
-        </name-key>
-        <name-key>
-            <key>J2EEServer</key>
-            <value>geronimo</value>
-        </name-key>
-        <classloader></classloader>
+        <properties>
+            <property>
+                <name>org.apache.geronimo.name.javax.management.j2ee.BaseName</name>
+                <value>geronimo.maven:J2EEServer=geronimo</value>
+            </property>
+        </properties>
     </environment>
 
     <!-- Deployer used to process modules and plans -->

Modified: geronimo/branches/configid/configs/j2ee-system/src/plan/plan.xml
URL: http://svn.apache.org/viewcvs/geronimo/branches/configid/configs/j2ee-system/src/plan/plan.xml?rev=378707&r1=378706&r2=378707&view=diff
==============================================================================
--- geronimo/branches/configid/configs/j2ee-system/src/plan/plan.xml (original)
+++ geronimo/branches/configid/configs/j2ee-system/src/plan/plan.xml Sat Feb 18 00:57:59 2006
@@ -26,12 +26,16 @@
 This configuration should *NOT* be used to provide server or application
 specific services - those should be provided by children.
 -->
-<configuration
-    xmlns="http://geronimo.apache.org/xml/ns/deployment-1.1"
+<configuration xmlns="http://geronimo.apache.org/xml/ns/deployment-1.1">
 
-    domain="geronimo.server"
-    server="geronimo"
-    >
+    <environment>
+        <properties>
+            <property>
+                <name>org.apache.geronimo.name.javax.management.j2ee.BaseName</name>
+                <value>geronimo.server:J2EEServer=geronimo</value>
+            </property>
+        </properties>
+    </environment>
 
     <!-- ServerInfo service -->
     <gbean name="ServerInfo" class="org.apache.geronimo.system.serverinfo.BasicServerInfo"/>

Modified: geronimo/branches/configid/configs/online-deployer/src/plan/plan.xml
URL: http://svn.apache.org/viewcvs/geronimo/branches/configid/configs/online-deployer/src/plan/plan.xml?rev=378707&r1=378706&r2=378707&view=diff
==============================================================================
--- geronimo/branches/configid/configs/online-deployer/src/plan/plan.xml (original)
+++ geronimo/branches/configid/configs/online-deployer/src/plan/plan.xml Sat Feb 18 00:57:59 2006
@@ -16,10 +16,14 @@
     limitations under the License.
 -->
 
-<configuration xmlns="http://geronimo.apache.org/xml/ns/deployment-1.1"
-
-               domain="geronimo.online.deployer"
-               server="geronimo"
-        >
+<configuration xmlns="http://geronimo.apache.org/xml/ns/deployment-1.1">
 
+    <environment>
+        <properties>
+            <property>
+                <name>org.apache.geronimo.name.javax.management.j2ee.BaseName</name>
+                <value>geronimo.online.deployer:J2EEServer=geronimo</value>
+            </property>
+        </properties>
+    </environment>
 </configuration>

Modified: geronimo/branches/configid/configs/shutdown/src/plan/plan.xml
URL: http://svn.apache.org/viewcvs/geronimo/branches/configid/configs/shutdown/src/plan/plan.xml?rev=378707&r1=378706&r2=378707&view=diff
==============================================================================
--- geronimo/branches/configid/configs/shutdown/src/plan/plan.xml (original)
+++ geronimo/branches/configid/configs/shutdown/src/plan/plan.xml Sat Feb 18 00:57:59 2006
@@ -16,10 +16,14 @@
     limitations under the License.
 -->
 
-<configuration xmlns="http://geronimo.apache.org/xml/ns/deployment-1.1"
-
-               domain="geronimo.online.deployer"
-               server="geronimo"
-        >
+<configuration xmlns="http://geronimo.apache.org/xml/ns/deployment-1.1">
 
+    <environment>
+        <properties>
+            <property>
+                <name>org.apache.geronimo.name.javax.management.j2ee.BaseName</name>
+                <value>geronimo.shutdown:J2EEServer=geronimo</value>
+            </property>
+        </properties>
+    </environment>
 </configuration>

Modified: geronimo/branches/configid/etc/project.properties
URL: http://svn.apache.org/viewcvs/geronimo/branches/configid/etc/project.properties?rev=378707&r1=378706&r2=378707&view=diff
==============================================================================
--- geronimo/branches/configid/etc/project.properties (original)
+++ geronimo/branches/configid/etc/project.properties Sat Feb 18 00:57:59 2006
@@ -91,24 +91,24 @@
 geronimo_deployment_plugin_version=1.0.1
 geronimo_dependency_plugin_version=1.0.1
 
-geronimo_spec_activation_version=1.1-SNAPSHOT
+geronimo_spec_activation_version=1.0
 geronimo_spec_corba_version=1.1-SNAPSHOT
-geronimo_spec_ejb_version=1.1-SNAPSHOT
+geronimo_spec_ejb_version=1.0
 geronimo_spec_j2ee_version=1.1-SNAPSHOT
-geronimo_spec_j2ee_connector_version=1.1-SNAPSHOT
-geronimo_spec_j2ee_deployment_version=1.1-SNAPSHOT
-geronimo_spec_j2ee_jacc_version=1.1-SNAPSHOT
-geronimo_spec_j2ee_management_version=1.1-SNAPSHOT
+geronimo_spec_j2ee_connector_version=1.0
+geronimo_spec_j2ee_deployment_version=1.0
+geronimo_spec_j2ee_jacc_version=1.0
+geronimo_spec_j2ee_management_version=1.0
 geronimo_spec_javamail_version=1.1-SNAPSHOT
-geronimo_spec_jaxr_version=1.1-SNAPSHOT
-geronimo_spec_jaxrpc_version=1.1-SNAPSHOT
+geronimo_spec_jaxr_version=1.0
+geronimo_spec_jaxrpc_version=1.0
 geronimo_spec_jcache_version=1.1-SNAPSHOT
-geronimo_spec_jms_version=1.1-SNAPSHOT
-geronimo_spec_jsp_version=1.1-SNAPSHOT
-geronimo_spec_jta_version=1.1-SNAPSHOT
-geronimo_spec_qname_version=1.1-SNAPSHOT
-geronimo_spec_saaj_version=1.1-SNAPSHOT
-geronimo_spec_servlet_version=1.1-SNAPSHOT
+geronimo_spec_jms_version=1.0
+geronimo_spec_jsp_version=1.0
+geronimo_spec_jta_version=1.0
+geronimo_spec_qname_version=1.0
+geronimo_spec_saaj_version=1.0
+geronimo_spec_servlet_version=1.0
 
 ant_version=1.6.5
 antlr_version=2.7.2

Modified: geronimo/branches/configid/modules/client-builder/src/java/org/apache/geronimo/client/builder/AppClientModuleBuilder.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/configid/modules/client-builder/src/java/org/apache/geronimo/client/builder/AppClientModuleBuilder.java?rev=378707&r1=378706&r2=378707&view=diff
==============================================================================
--- geronimo/branches/configid/modules/client-builder/src/java/org/apache/geronimo/client/builder/AppClientModuleBuilder.java (original)
+++ geronimo/branches/configid/modules/client-builder/src/java/org/apache/geronimo/client/builder/AppClientModuleBuilder.java Sat Feb 18 00:57:59 2006
@@ -93,7 +93,6 @@
     private final ObjectName corbaGBeanObjectName;
     private final Kernel kernel;
     private final Repository repository;
-    private final ConfigurationStore store;
 
     private final String clientApplicationName = "client-application";
     private final ObjectName transactionContextManagerObjectName;
@@ -113,7 +112,6 @@
                                   ModuleBuilder connectorModuleBuilder,
                                   ResourceReferenceBuilder resourceReferenceBuilder,
                                   ServiceReferenceBuilder serviceReferenceBuilder,
-                                  ConfigurationStore store,
                                   Repository repository,
                                   Kernel kernel) {
         this.defaultClientEnvironment = defaultClientEnvironment;
@@ -121,7 +119,6 @@
         this.corbaGBeanObjectName = corbaGBeanObjectName;
         this.kernel = kernel;
         this.repository = repository;
-        this.store = store;
         this.transactionContextManagerObjectName = transactionContextManagerObjectName;
         this.connectionTrackerObjectName = connectionTrackerObjectName;
         this.ejbReferenceBuilder = ejbReferenceBuilder;
@@ -177,7 +174,6 @@
         Environment serverEnvironment = EnvironmentBuilder.buildEnvironment(serverEnvironmentType, defaultServerEnvironment);
 
 
-
         return new AppClientModule(standAlone, serverEnvironment, clientEnvironment, moduleFile, targetPath, appClient, gerAppClient, specDD);
     }
 
@@ -248,7 +244,7 @@
         return geronimoAppClient;
     }
 
-    public void installModule(JarFile earFile, EARContext earContext, Module module) throws DeploymentException {
+    public void installModule(JarFile earFile, EARContext earContext, Module module, ConfigurationStore configurationStore) throws DeploymentException {
         // extract the app client jar file into a standalone packed jar file and add the contents to the output
         JarFile moduleFile = module.getModuleFile();
         try {
@@ -256,7 +252,32 @@
         } catch (IOException e) {
             throw new DeploymentException("Unable to copy app client module jar into configuration: " + moduleFile.getName());
         }
-        ((AppClientModule) module).setEarFile(earFile);
+        AppClientModule appClientModule = (AppClientModule) module;
+        appClientModule.setEarFile(earFile);
+        //create the ear context for the app client.
+        Environment clientEnvironment = appClientModule.getClientEnvironment();
+        File appClientDir = configurationStore.createNewConfigurationDir(clientEnvironment.getConfigId());
+
+        // construct the app client deployment context... this is the same class used by the ear context
+        try {
+
+            EARContext appClientDeploymentContext = new EARContext(appClientDir,
+                    clientEnvironment,
+                    ConfigurationModuleType.CAR,
+                    kernel,
+                    clientApplicationName,
+                    transactionContextManagerObjectName,
+                    connectionTrackerObjectName,
+                    null,
+                    null,
+                    corbaGBeanObjectName,
+                    RefContext.derivedClientRefContext(earContext.getRefContext(), ejbReferenceBuilder, resourceReferenceBuilder, serviceReferenceBuilder));
+            appClientModule.setEarContext(appClientDeploymentContext);
+        } catch (Exception e) {
+            DeploymentUtil.recursiveDelete(appClientDir);
+            throw new DeploymentException("Could not create a deployment context for the app client", e);
+        }
+
     }
 
     public void initContext(EARContext earContext, Module clientModule, ClassLoader cl) {
@@ -316,30 +337,10 @@
         earContext.addGBean(appClientModuleGBeanData);
 
         // create another child configuration within the config store for the client application
-        EARContext appClientDeploymentContext = null;
-        File appClientDir = null;
+        EARContext appClientDeploymentContext = appClientModule.getEarContext();
         ConfigurationData appClientConfigurationData = null;
         try {
             try {
-                appClientDir = store.createNewConfigurationDir();
-
-                // construct the app client deployment context... this is the same class used by the ear context
-                try {
-
-                    appClientDeploymentContext = new EARContext(appClientDir,
-                            appClientModule.getClientEnvironment(),
-                            ConfigurationModuleType.CAR,
-                            kernel,
-                            clientApplicationName,
-                            transactionContextManagerObjectName,
-                            connectionTrackerObjectName,
-                            null,
-                            null,
-                            corbaGBeanObjectName,
-                            RefContext.derivedClientRefContext(earContext.getRefContext(), ejbReferenceBuilder, resourceReferenceBuilder, serviceReferenceBuilder));
-                } catch (Exception e) {
-                    throw new DeploymentException("Could not create a deployment context for the app client", e);
-                }
 
                 //register the message destinations in the app client ear context.
                 MessageDestinationType[] messageDestinations = appClient.getMessageDestinationArray();
@@ -395,7 +396,8 @@
                             XmlObject connectorPlan = resource.getConnector();
                             Module connectorModule = connectorModuleBuilder.createModule(connectorPlan, connectorFile, path, null, null, null);
                             resourceModules.add(connectorModule);
-                            connectorModuleBuilder.installModule(connectorFile, appClientDeploymentContext, connectorModule);
+                            //TODO configStore == null is fishy, consider moving these stages for connectors into the corresponding stages for this module.
+                            connectorModuleBuilder.installModule(connectorFile, appClientDeploymentContext, connectorModule, null);
                         }
                         //the install step could have added more dependencies... we need a new cl.
                         appClientClassLoader = appClientDeploymentContext.getClassLoader(repository);
@@ -429,7 +431,6 @@
                 }
                 appClientDeploymentContext.addGBean(jndiContextGBeanData);
 
-
                 // finally add the app client container
                 ObjectName appClientContainerName = ObjectName.getInstance("geronimo.client:type=ClientContainer");
                 GBeanData appClientContainerGBeanData = new GBeanData(appClientContainerName, AppClientContainer.GBEAN_INFO);
@@ -475,14 +476,9 @@
                 }
             }
 
-            try {
-                // todo this should be handled in the Deployer class
-                store.install(appClientDeploymentContext.getConfigurationData(), appClientDir);
-            } catch (Exception e) {
-                throw new DeploymentException(e);
-            }
             earContext.addChildConfiguration(appClientConfigurationData);
         } catch (Throwable e) {
+            File appClientDir = appClientDeploymentContext.getBaseDir();
             DeploymentUtil.recursiveDelete(appClientDir);
             if (e instanceof Error) {
                 throw (Error) e;
@@ -559,7 +555,6 @@
                     throw new DeploymentException("Manifest class path entries must be a valid jar file (J2EE 1.4 Section 8.2): jarFile=" + jarFileLocation + ", path=" + path, e);
                 }
 
-
                 // add the client jars of this class path jar
                 addManifestClassPath(deploymentContext, earFile, classPathJarFile, classPathJarLocation);
             }
@@ -596,7 +591,6 @@
         infoBuilder.addReference("ConnectorModuleBuilder", ModuleBuilder.class, NameFactory.MODULE_BUILDER);
         infoBuilder.addReference("ResourceReferenceBuilder", ResourceReferenceBuilder.class, NameFactory.MODULE_BUILDER);
         infoBuilder.addReference("ServiceReferenceBuilder", ServiceReferenceBuilder.class, NameFactory.MODULE_BUILDER);
-        infoBuilder.addReference("Store", ConfigurationStore.class, NameFactory.CONFIGURATION_STORE);
         infoBuilder.addReference("Repository", Repository.class, NameFactory.GERONIMO_SERVICE);
 
         infoBuilder.addAttribute("kernel", Kernel.class, false);
@@ -604,17 +598,16 @@
         infoBuilder.addInterface(ModuleBuilder.class);
 
         infoBuilder.setConstructor(new String[]{"defaultClientEnvironment",
-                                                "defaultServerEnvironment",
-                                                "transactionContextManagerObjectName",
-                                                "connectionTrackerObjectName",
-                                                "corbaGBeanObjectName",
-                                                "EJBReferenceBuilder",
-                                                "ConnectorModuleBuilder",
-                                                "ResourceReferenceBuilder",
-                                                "ServiceReferenceBuilder",
-                                                "Store",
-                                                "Repository",
-                                                "kernel"});
+                "defaultServerEnvironment",
+                "transactionContextManagerObjectName",
+                "connectionTrackerObjectName",
+                "corbaGBeanObjectName",
+                "EJBReferenceBuilder",
+                "ConnectorModuleBuilder",
+                "ResourceReferenceBuilder",
+                "ServiceReferenceBuilder",
+                "Repository",
+                "kernel"});
         GBEAN_INFO = infoBuilder.getBeanInfo();
     }
 

Modified: geronimo/branches/configid/modules/client-builder/src/test/org/apache/geronimo/client/builder/PlanParsingTest.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/configid/modules/client-builder/src/test/org/apache/geronimo/client/builder/PlanParsingTest.java?rev=378707&r1=378706&r2=378707&view=diff
==============================================================================
--- geronimo/branches/configid/modules/client-builder/src/test/org/apache/geronimo/client/builder/PlanParsingTest.java (original)
+++ geronimo/branches/configid/modules/client-builder/src/test/org/apache/geronimo/client/builder/PlanParsingTest.java Sat Feb 18 00:57:59 2006
@@ -19,7 +19,7 @@
     File basedir = new File(System.getProperty("basedir", "."));
 
     protected void setUp() throws Exception {
-        builder = new AppClientModuleBuilder(new Environment(), null, null, null, null, null, null, null, null, null, null, null);
+        builder = new AppClientModuleBuilder(new Environment(), null, null, null, null, null, null, null, null, null, null);
     }
 
     public void testResourceRef() throws Exception {

Modified: geronimo/branches/configid/modules/connector-builder/src/java/org/apache/geronimo/connector/deployment/ConnectorModuleBuilder.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/configid/modules/connector-builder/src/java/org/apache/geronimo/connector/deployment/ConnectorModuleBuilder.java?rev=378707&r1=378706&r2=378707&view=diff
==============================================================================
--- geronimo/branches/configid/modules/connector-builder/src/java/org/apache/geronimo/connector/deployment/ConnectorModuleBuilder.java (original)
+++ geronimo/branches/configid/modules/connector-builder/src/java/org/apache/geronimo/connector/deployment/ConnectorModuleBuilder.java Sat Feb 18 00:57:59 2006
@@ -82,6 +82,7 @@
 import org.apache.geronimo.j2ee.j2eeobjectnames.NameFactory;
 import org.apache.geronimo.kernel.GBeanNotFoundException;
 import org.apache.geronimo.kernel.Kernel;
+import org.apache.geronimo.kernel.config.ConfigurationStore;
 import org.apache.geronimo.kernel.repository.Repository;
 import org.apache.geronimo.naming.deployment.ENCConfigBuilder;
 import org.apache.geronimo.naming.reference.ResourceReference;
@@ -234,7 +235,7 @@
         return new ConnectorModule(standAlone, environment, moduleFile, targetPath, connector, gerConnector, specDD);
     }
 
-    public void installModule(JarFile earFile, EARContext earContext, Module module) throws DeploymentException {
+    public void installModule(JarFile earFile, EARContext earContext, Module module, ConfigurationStore configurationStore) throws DeploymentException {
         GerConnectorType vendorConnector = (GerConnectorType) module.getVendorDD();
         try {
             JarFile moduleFile = module.getModuleFile();

Modified: geronimo/branches/configid/modules/connector-builder/src/test/org/apache/geronimo/connector/deployment/ConnectorModuleBuilderTest.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/configid/modules/connector-builder/src/test/org/apache/geronimo/connector/deployment/ConnectorModuleBuilderTest.java?rev=378707&r1=378706&r2=378707&view=diff
==============================================================================
--- geronimo/branches/configid/modules/connector-builder/src/test/org/apache/geronimo/connector/deployment/ConnectorModuleBuilderTest.java (original)
+++ geronimo/branches/configid/modules/connector-builder/src/test/org/apache/geronimo/connector/deployment/ConnectorModuleBuilderTest.java Sat Feb 18 00:57:59 2006
@@ -72,7 +72,6 @@
 import java.sql.Connection;
 import java.sql.Statement;
 import java.util.Collections;
-import java.util.HashMap;
 import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
@@ -91,6 +90,7 @@
     private int defaultBlockingTimeoutMilliseconds = 5000;
     private int defaultidleTimeoutMinutes = 15;
     private Environment defaultEnvironment;
+    private ConfigurationStore configurationStore = new MockConfigStore(null);
     private Repository repository = new Repository() {
         public boolean contains(Artifact artifact) {
             return false;
@@ -185,14 +185,15 @@
 
             rarFile = DeploymentUtil.createJarFile(new File(basedir, "target/test-ear-noger.ear"));
             EARConfigBuilder configBuilder = new EARConfigBuilder(defaultEnvironment, null, connectionTrackerName, null, null, null, null, null, ejbReferenceBuilder, null, new ConnectorModuleBuilder(defaultEnvironment, defaultMaxSize, defaultMinSize, defaultBlockingTimeoutMilliseconds, defaultidleTimeoutMinutes, defaultXATransactionCaching, defaultXAThreadCaching, repository, kernel), resourceReferenceBuilder, null, serviceReferenceBuilder, kernel);
-            File tempDir = null;
+            ConfigurationData configData = null;
             try {
-                tempDir = DeploymentUtil.createTempDir();
                 File planFile = new File(basedir, "src/test-data/data/external-application-plan.xml");
                 Object plan = configBuilder.getDeploymentPlan(planFile, rarFile);
-                configBuilder.buildConfiguration(plan, rarFile, tempDir);
+                configData = configBuilder.buildConfiguration(plan, rarFile, configurationStore);
             } finally {
-                DeploymentUtil.recursiveDelete(tempDir);
+                if (configData != null) {
+                    DeploymentUtil.recursiveDelete(configData.getConfigurationDir());
+                }
             }
         } finally {
             kernel.shutdown();
@@ -357,7 +358,7 @@
                         moduleBuilder,
                         serviceReferenceBuilder, kernel));
 
-                action.install(moduleBuilder, earContext, module);
+                action.install(moduleBuilder, earContext, module, configurationStore);
                 earContext.getClassLoader(null);
                 moduleBuilder.initContext(earContext, module, cl);
                 moduleBuilder.addGBeans(earContext, module, cl);
@@ -575,8 +576,8 @@
 
         public abstract File getRARFile();
 
-        public void install(ModuleBuilder moduleBuilder, EARContext earContext, Module module) throws Exception {
-            moduleBuilder.installModule(module.getModuleFile(), earContext, module);
+        public void install(ModuleBuilder moduleBuilder, EARContext earContext, Module module, ConfigurationStore configurationStore) throws Exception {
+            moduleBuilder.installModule(module.getModuleFile(), earContext, module, configurationStore);
         }
     }
 
@@ -591,7 +592,7 @@
             return null;
         }
 
-        public void install(ConfigurationData configurationData, File source) throws IOException, InvalidConfigException {
+        public void install(ConfigurationData configurationData) throws IOException, InvalidConfigException {
         }
 
         public void uninstall(Artifact configID) throws NoSuchConfigException, IOException {
@@ -627,8 +628,12 @@
             return null;
         }
 
-        public File createNewConfigurationDir() {
-            return null;
+        public File createNewConfigurationDir(Artifact configId) {
+            try {
+                return DeploymentUtil.createTempDir();
+            } catch (IOException e) {
+                return null;
+            }
         }
 
         public URL resolve(Artifact configId, URI uri) throws NoSuchConfigException, MalformedURLException {

Modified: geronimo/branches/configid/modules/deploy-tool/src/java/org/apache/geronimo/deployment/PluginBootstrap.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/configid/modules/deploy-tool/src/java/org/apache/geronimo/deployment/PluginBootstrap.java?rev=378707&r1=378706&r2=378707&view=diff
==============================================================================
--- geronimo/branches/configid/modules/deploy-tool/src/java/org/apache/geronimo/deployment/PluginBootstrap.java (original)
+++ geronimo/branches/configid/modules/deploy-tool/src/java/org/apache/geronimo/deployment/PluginBootstrap.java Sat Feb 18 00:57:59 2006
@@ -18,15 +18,26 @@
 
 import java.io.File;
 import java.io.FileOutputStream;
+import java.io.IOException;
 import java.util.jar.JarOutputStream;
+import java.util.List;
+import java.net.URL;
+import java.net.URI;
+import java.net.MalformedURLException;
 
 import org.apache.geronimo.deployment.service.ServiceConfigBuilder;
 import org.apache.geronimo.deployment.xbeans.ConfigurationDocument;
 import org.apache.geronimo.deployment.xbeans.ConfigurationType;
 import org.apache.geronimo.kernel.config.ConfigurationData;
+import org.apache.geronimo.kernel.config.ConfigurationStore;
+import org.apache.geronimo.kernel.config.InvalidConfigException;
+import org.apache.geronimo.kernel.config.NoSuchConfigException;
+import org.apache.geronimo.kernel.repository.Artifact;
 import org.apache.geronimo.system.configuration.ExecutableConfigurationUtil;
 import org.apache.geronimo.system.repository.Maven1Repository;
 
+import javax.management.ObjectName;
+
 /**
  * @version $Rev$ $Date$
  */
@@ -57,7 +68,42 @@
 
         Maven1Repository repository = new Maven1Repository(localRepo);
         ServiceConfigBuilder builder = new ServiceConfigBuilder(null, repository);
-        ConfigurationData configurationData = builder.buildConfiguration(config, null, buildDir);
+        ConfigurationData configurationData = builder.buildConfiguration(config, null, new ConfigurationStore() {
+
+            public Artifact install(URL source) throws IOException, InvalidConfigException {
+                return null;
+            }
+
+            public void install(ConfigurationData configurationData) throws IOException, InvalidConfigException {
+            }
+
+            public void uninstall(Artifact configID) throws NoSuchConfigException, IOException {
+            }
+
+            public ObjectName loadConfiguration(Artifact configId) throws NoSuchConfigException, IOException, InvalidConfigException {
+                return null;
+            }
+
+            public boolean containsConfiguration(Artifact configID) {
+                return false;
+            }
+
+            public String getObjectName() {
+                return null;
+            }
+
+            public List listConfigurations() {
+                return null;
+            }
+
+            public File createNewConfigurationDir(Artifact configId) {
+                return buildDir;
+            }
+
+            public URL resolve(Artifact configId, URI uri) throws NoSuchConfigException, MalformedURLException {
+                return null;
+            }
+        });
 
         JarOutputStream out = new JarOutputStream(new FileOutputStream(carFile));
         ExecutableConfigurationUtil.writeConfiguration(configurationData, out);

Modified: geronimo/branches/configid/modules/deployment/src/java/org/apache/geronimo/deployment/ConfigurationBuilder.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/configid/modules/deployment/src/java/org/apache/geronimo/deployment/ConfigurationBuilder.java?rev=378707&r1=378706&r2=378707&view=diff
==============================================================================
--- geronimo/branches/configid/modules/deployment/src/java/org/apache/geronimo/deployment/ConfigurationBuilder.java (original)
+++ geronimo/branches/configid/modules/deployment/src/java/org/apache/geronimo/deployment/ConfigurationBuilder.java Sat Feb 18 00:57:59 2006
@@ -20,10 +20,11 @@
 import java.io.File;
 import java.io.IOException;
 import java.util.jar.JarFile;
-import java.net.URI;
 
 import org.apache.geronimo.common.DeploymentException;
 import org.apache.geronimo.kernel.config.ConfigurationData;
+import org.apache.geronimo.kernel.config.ConfigurationStore;
+import org.apache.geronimo.kernel.repository.Artifact;
 
 /**
  * @version $Rev$ $Date$
@@ -47,17 +48,17 @@
      * @throws IOException if there was a problem reading or writing the files
      * @throws org.apache.geronimo.common.DeploymentException if there was a problem with the configuration
      */
-    URI getConfigurationID(Object plan, JarFile module) throws IOException, DeploymentException;
+    Artifact getConfigurationID(Object plan, JarFile module) throws IOException, DeploymentException;
 
     /**
      * Build a configuration from a local file
      *
      * @param plan the deployment plan
      * @param module the module to build
-     * @param outfile the file in which the configiguration files should be written
+     * @param configurationStore
      * @return the Configuration information
      * @throws IOException if there was a problem reading or writing the files
      * @throws org.apache.geronimo.common.DeploymentException if there was a problem with the configuration
      */
-    ConfigurationData buildConfiguration(Object plan, JarFile module, File outfile) throws IOException, DeploymentException;
+    ConfigurationData buildConfiguration(Object plan, JarFile module, ConfigurationStore configurationStore) throws IOException, DeploymentException;
 }

Modified: geronimo/branches/configid/modules/deployment/src/java/org/apache/geronimo/deployment/Deployer.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/configid/modules/deployment/src/java/org/apache/geronimo/deployment/Deployer.java?rev=378707&r1=378706&r2=378707&view=diff
==============================================================================
--- geronimo/branches/configid/modules/deployment/src/java/org/apache/geronimo/deployment/Deployer.java (original)
+++ geronimo/branches/configid/modules/deployment/src/java/org/apache/geronimo/deployment/Deployer.java Sat Feb 18 00:57:59 2006
@@ -30,13 +30,13 @@
 import org.apache.geronimo.kernel.config.ConfigurationData;
 import org.apache.geronimo.kernel.config.ConfigurationStore;
 import org.apache.geronimo.kernel.config.InvalidConfigException;
+import org.apache.geronimo.kernel.repository.Artifact;
 import org.apache.geronimo.system.configuration.ExecutableConfigurationUtil;
 import org.apache.geronimo.system.main.CommandLineManifest;
 
 import javax.management.ObjectName;
 import java.io.File;
 import java.io.IOException;
-import java.net.URI;
 import java.util.ArrayList;
 import java.util.Collection;
 import java.util.Collections;
@@ -220,7 +220,7 @@
             }
         }
 
-        File configurationDir = null;
+//        File configurationDir = null;
         try {
             Object plan = null;
             ConfigurationBuilder builder = null;
@@ -239,7 +239,7 @@
             }
 
             // Make sure this configuration doesn't already exist
-            URI configID = builder.getConfigurationID(plan, module);
+            Artifact configID = builder.getConfigurationID(plan, module);
             try {
                 kernel.getGBeanState(Configuration.getConfigurationObjectName(configID));
                 throw new DeploymentException("Module "+configID+" already exists in the server.  Try to undeploy it first or use the redeploy command.");
@@ -271,40 +271,40 @@
 
 //TODO this is ludicrous!  give the builder a location factory!
             // create a configuration dir to write the configuration during the building proces
-            configurationDir = store.createNewConfigurationDir();
+//            configurationDir = store.createNewConfigurationDir();
 
             // create te meta-inf dir
-            File metaInf = new File(configurationDir, "META-INF");
-            metaInf.mkdirs();
+//            File metaInf = new File(configurationDir, "META-INF");
+//            metaInf.mkdirs();
 
-            ConfigurationData configurationData = builder.buildConfiguration(plan, module, configurationDir);
+            ConfigurationData configurationData = builder.buildConfiguration(plan, module, store);
             try {
                 if (targetFile != null) {
-                    ExecutableConfigurationUtil.createExecutableConfiguration(configurationData, manifest, configurationDir, targetFile);
+                    ExecutableConfigurationUtil.createExecutableConfiguration(configurationData, manifest, targetFile);
                 }
                 if (install) {
                     List deployedURIs = new ArrayList();
-                    recursiveInstall(configurationData, configurationDir, deployedURIs);
+                    recursiveInstall(configurationData, deployedURIs);
                     return deployedURIs;
                 } else {
-                    if (!DeploymentUtil.recursiveDelete(configurationDir)) {
-                        pendingDeletionIndex.setProperty(configurationDir.getName(), new String("delete"));
-                        log.debug("Queued deployment directory to be reaped " + configurationDir);                        
-                    }
+                    cleanupConfigurationDirs(configurationData);
                     return Collections.EMPTY_LIST;
                 }
             } catch (InvalidConfigException e) {
+                cleanupConfigurationDirs(configurationData);
                 // unlikely as we just built this
                 throw new DeploymentException(e);
             }
         } catch(Throwable e) {
-            if (!DeploymentUtil.recursiveDelete(configurationDir)) {
-                pendingDeletionIndex.setProperty(configurationDir.getName(), new String("delete"));
-                log.debug("Queued deployment directory to be reaped " + configurationDir);                        
-            }
-            if (targetFile != null) {
-                targetFile.delete();
-            }
+            //TODO not clear all errors will result in total cleanup
+//            File configurationDir = configurationData.getConfigurationDir();
+//            if (!DeploymentUtil.recursiveDelete(configurationDir)) {
+//                pendingDeletionIndex.setProperty(configurationDir.getName(), new String("delete"));
+//                log.debug("Queued deployment directory to be reaped " + configurationDir);
+//            }
+//            if (targetFile != null) {
+//                targetFile.delete();
+//            }
 
             if (e instanceof Error) {
                 log.error("Deployment failed due to ", e);
@@ -321,20 +321,24 @@
         }
     }
 
-    private void recursiveInstall(ConfigurationData configurationData, File configurationDir, List deployedURIs) throws IOException, InvalidConfigException {
-        //TODO use 2nd copy, commented out
+    private void cleanupConfigurationDirs(ConfigurationData configurationData) {
+        File configurationDir = configurationData.getConfigurationDir();
+        if (!DeploymentUtil.recursiveDelete(configurationDir)) {
+            pendingDeletionIndex.setProperty(configurationDir.getName(), new String("delete"));
+            log.debug("Queued deployment directory to be reaped " + configurationDir);
+        }
+        for (Iterator iterator = configurationData.getChildConfigurations().iterator(); iterator.hasNext();) {
+            ConfigurationData data = (ConfigurationData) iterator.next();
+            cleanupConfigurationDirs(data);
+        }
+    }
+
+    private void recursiveInstall(ConfigurationData configurationData, List deployedURIs) throws IOException, InvalidConfigException {
+        store.install(configurationData);
         deployedURIs.add(configurationData.getId().toString());
-        //TODO FIXME
-        if (configurationDir == null) {
-            return;
-        }
-        store.install(configurationData, configurationDir);
-        //TODO uncomment
-//        deployedURIs.add(configurationData.getId().toString());
         for (Iterator iterator = configurationData.getChildConfigurations().iterator(); iterator.hasNext();) {
             ConfigurationData childConfiguration = (ConfigurationData) iterator.next();
-            //TODO extremely broken... configDir should NOT BE IN THIS SIG! should be in configurationData.
-            recursiveInstall(childConfiguration, null, deployedURIs);
+            recursiveInstall(childConfiguration, deployedURIs);
         }
     }
 

Modified: geronimo/branches/configid/modules/deployment/src/java/org/apache/geronimo/deployment/DeploymentContext.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/configid/modules/deployment/src/java/org/apache/geronimo/deployment/DeploymentContext.java?rev=378707&r1=378706&r2=378707&view=diff
==============================================================================
--- geronimo/branches/configid/modules/deployment/src/java/org/apache/geronimo/deployment/DeploymentContext.java (original)
+++ geronimo/branches/configid/modules/deployment/src/java/org/apache/geronimo/deployment/DeploymentContext.java Sat Feb 18 00:57:59 2006
@@ -125,7 +125,8 @@
             }
             try {
                 ObjectName parentName = Configuration.getConfigurationObjectName(parent);
-                environment.setProperties((Map) kernel.getAttribute(parentName, "properties"));
+                Environment environment = (Environment) kernel.getAttribute(parentName, "environment");
+                this.environment.setProperties(environment.getProperties());
             } catch (Exception e) {
                 throw new DeploymentException("Unable to copy domain and server from parent configuration", e);
             } finally {
@@ -564,7 +565,7 @@
                             return null;
                         }
 
-                        public void install(ConfigurationData configurationData, File source) {
+                        public void install(ConfigurationData configurationData) {
                         }
 
                         public void uninstall(Artifact configID) {
@@ -586,7 +587,7 @@
                             return null;
                         }
 
-                        public File createNewConfigurationDir() {
+                        public File createNewConfigurationDir(Artifact configId) {
                             return null;
                         }
 
@@ -630,7 +631,7 @@
     }
 
     public ConfigurationData getConfigurationData() {
-        ConfigurationData configurationData = new ConfigurationData(moduleType, classpath, Arrays.asList(gbeans.getGBeans()), childConfigurationDatas, environment);
+        ConfigurationData configurationData = new ConfigurationData(moduleType, classpath, Arrays.asList(gbeans.getGBeans()), childConfigurationDatas, environment, baseDir);
         return configurationData;
     }
 

Modified: geronimo/branches/configid/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/EARConfigBuilder.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/configid/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/EARConfigBuilder.java?rev=378707&r1=378706&r2=378707&view=diff
==============================================================================
--- geronimo/branches/configid/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/EARConfigBuilder.java (original)
+++ geronimo/branches/configid/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/EARConfigBuilder.java Sat Feb 18 00:57:59 2006
@@ -56,6 +56,7 @@
 import org.apache.geronimo.kernel.Kernel;
 import org.apache.geronimo.kernel.config.ConfigurationData;
 import org.apache.geronimo.kernel.config.ConfigurationModuleType;
+import org.apache.geronimo.kernel.config.ConfigurationStore;
 import org.apache.geronimo.kernel.repository.Artifact;
 import org.apache.geronimo.kernel.repository.Repository;
 import org.apache.geronimo.schema.SchemaConversionUtils;
@@ -277,24 +278,23 @@
         return gerApplication;
     }
 
-    public URI getConfigurationID(Object plan, JarFile module) throws IOException, DeploymentException {
+    public Artifact getConfigurationID(Object plan, JarFile module) throws IOException, DeploymentException {
         ApplicationInfo applicationInfo = (ApplicationInfo) plan;
-        try {
-            return applicationInfo.getEnvironment().getConfigId().toURI();
-        } catch (URISyntaxException e) {
-            throw new DeploymentException(e);
-        }
+        return applicationInfo.getEnvironment().getConfigId();
     }
 
-    public ConfigurationData buildConfiguration(Object plan, JarFile earFile, File outfile) throws IOException, DeploymentException {
+    public ConfigurationData buildConfiguration(Object plan, JarFile earFile, ConfigurationStore configurationStore) throws IOException, DeploymentException {
         assert plan != null;
         ApplicationInfo applicationInfo = (ApplicationInfo) plan;
         try {
             // Create the output ear context
             EARContext earContext = null;
             ConfigurationModuleType applicationType = applicationInfo.getType();
+            Environment environment = applicationInfo.getEnvironment();
+            Artifact configId = environment.getConfigId();
+            File configurationDir = configurationStore.createNewConfigurationDir(configId);
             try {
-                earContext = new EARContext(outfile,
+                earContext = new EARContext(configurationDir,
                         applicationInfo.getEnvironment(),
                         applicationType,
                         kernel,
@@ -326,7 +326,7 @@
             Set modules = applicationInfo.getModules();
             for (Iterator iterator = modules.iterator(); iterator.hasNext();) {
                 Module module = (Module) iterator.next();
-                getBuilder(module).installModule(earFile, earContext, module);
+                getBuilder(module).installModule(earFile, earContext, module, configurationStore);
             }
 
             // give each module a chance to populate the earContext now that a classloader is available
@@ -358,7 +358,6 @@
                 earContext.addGBean(gbeanData);
             }
 
-
             //TODO this might need to be constructed only if there is security...
             ObjectName jaccBeanName = null;
             String moduleName;
@@ -457,7 +456,6 @@
                     }
                 }
 
-
                 // get a set containing all of the files in the ear that are actually modules
                 for (int i = 0; i < moduleTypes.length; i++) {
                     ModuleType moduleXml = moduleTypes[i];
@@ -694,21 +692,21 @@
         infoFactory.addInterface(ConfigurationBuilder.class);
 
         infoFactory.setConstructor(new String[]{
-            "defaultEnvironment",
-            "transactionContextManagerObjectName",
-            "connectionTrackerObjectName",
-            "transactionalTimerObjectName",
-            "nonTransactionalTimerObjectName",
-            "corbaGBeanObjectName",
-            "Repository",
-            "EJBConfigBuilder",
-            "EJBReferenceBuilder",
-            "WebConfigBuilder",
-            "ConnectorConfigBuilder",
-            "ResourceReferenceBuilder",
-            "AppClientConfigBuilder",
-            "ServiceReferenceBuilder",
-            "kernel"
+                "defaultEnvironment",
+                "transactionContextManagerObjectName",
+                "connectionTrackerObjectName",
+                "transactionalTimerObjectName",
+                "nonTransactionalTimerObjectName",
+                "corbaGBeanObjectName",
+                "Repository",
+                "EJBConfigBuilder",
+                "EJBReferenceBuilder",
+                "WebConfigBuilder",
+                "ConnectorConfigBuilder",
+                "ResourceReferenceBuilder",
+                "AppClientConfigBuilder",
+                "ServiceReferenceBuilder",
+                "kernel"
         });
 
         GBEAN_INFO = infoFactory.getBeanInfo();

Modified: geronimo/branches/configid/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/Module.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/configid/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/Module.java?rev=378707&r1=378706&r2=378707&view=diff
==============================================================================
--- geronimo/branches/configid/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/Module.java (original)
+++ geronimo/branches/configid/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/Module.java Sat Feb 18 00:57:59 2006
@@ -45,6 +45,8 @@
     private final String originalSpecDD;
     private final String namespace;
 
+    private EARContext earContext;
+
     private URI uniqueModuleLocation;
 
     protected Module(boolean standAlone, Environment environment, JarFile moduleFile, String targetPath, XmlObject specDD, XmlObject vendorDD, String originalSpecDD, String namespace) throws DeploymentException {
@@ -60,12 +62,7 @@
         this.namespace = namespace;
 
         if (standAlone) {
-            //TODO configid
-            try {
-                name = environment.getConfigId().toURI().toString();
-            } catch (URISyntaxException e) {
-                throw new DeploymentException("Could not construct module name from environment configId");
-            }
+            name = environment.getConfigId().toString();
             moduleURI = URI.create("");
         } else {
             name = targetPath;
@@ -160,6 +157,14 @@
             uniqueModuleLocation = candidateURI;
         }
         return uniqueModuleLocation;
+    }
+
+    public EARContext getEarContext() {
+        return earContext;
+    }
+
+    public void setEarContext(EARContext earContext) {
+        this.earContext = earContext;
     }
 
     public abstract void addClass(URI location, String fqcn, byte[] bytes, DeploymentContext context) throws IOException, URISyntaxException;

Modified: geronimo/branches/configid/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/ModuleBuilder.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/configid/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/ModuleBuilder.java?rev=378707&r1=378706&r2=378707&view=diff
==============================================================================
--- geronimo/branches/configid/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/ModuleBuilder.java (original)
+++ geronimo/branches/configid/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/ModuleBuilder.java Sat Feb 18 00:57:59 2006
@@ -22,6 +22,7 @@
 
 import org.apache.geronimo.common.DeploymentException;
 import org.apache.geronimo.kernel.repository.Environment;
+import org.apache.geronimo.kernel.config.ConfigurationStore;
 
 /**
  * @version $Rev$ $Date$
@@ -31,7 +32,7 @@
 
     Module createModule(Object plan, JarFile moduleFile, String targetPath, URL specDDUrl, Environment environment, Object moduleContextInfo) throws DeploymentException;
 
-    void installModule(JarFile earFile, EARContext earContext, Module module) throws DeploymentException;
+    void installModule(JarFile earFile, EARContext earContext, Module module, ConfigurationStore configurationStore) throws DeploymentException;
 
     void initContext(EARContext earContext, Module module, ClassLoader cl) throws DeploymentException;
 

Modified: geronimo/branches/configid/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/SwitchingModuleBuilder.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/configid/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/SwitchingModuleBuilder.java?rev=378707&r1=378706&r2=378707&view=diff
==============================================================================
--- geronimo/branches/configid/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/SwitchingModuleBuilder.java (original)
+++ geronimo/branches/configid/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/SwitchingModuleBuilder.java Sat Feb 18 00:57:59 2006
@@ -28,6 +28,7 @@
 import org.apache.geronimo.common.DeploymentException;
 import org.apache.geronimo.deployment.xmlbeans.XmlBeansUtil;
 import org.apache.geronimo.kernel.repository.Environment;
+import org.apache.geronimo.kernel.config.ConfigurationStore;
 import org.apache.geronimo.gbean.GBeanInfo;
 import org.apache.geronimo.gbean.GBeanInfoBuilder;
 import org.apache.geronimo.gbean.ReferenceCollection;
@@ -142,10 +143,10 @@
         }
     }
 
-    public void installModule(JarFile earFile, EARContext earContext, Module module) throws DeploymentException {
+    public void installModule(JarFile earFile, EARContext earContext, Module module, ConfigurationStore configurationStore) throws DeploymentException {
         String namespace = module.getNamespace();
         ModuleBuilder builder = getBuilderFromNamespace(namespace);
-        builder.installModule(earFile, earContext, module);
+        builder.installModule(earFile, earContext, module, configurationStore);
     }
 
     public void initContext(EARContext earContext, Module module, ClassLoader cl) throws DeploymentException {

Modified: geronimo/branches/configid/modules/j2ee-builder/src/test/org/apache/geronimo/j2ee/deployment/EARConfigBuilderTest.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/configid/modules/j2ee-builder/src/test/org/apache/geronimo/j2ee/deployment/EARConfigBuilderTest.java?rev=378707&r1=378706&r2=378707&view=diff
==============================================================================
--- geronimo/branches/configid/modules/j2ee-builder/src/test/org/apache/geronimo/j2ee/deployment/EARConfigBuilderTest.java (original)
+++ geronimo/branches/configid/modules/j2ee-builder/src/test/org/apache/geronimo/j2ee/deployment/EARConfigBuilderTest.java Sat Feb 18 00:57:59 2006
@@ -52,6 +52,7 @@
 import java.util.Collections;
 import java.util.List;
 import java.util.Map;
+import java.util.HashMap;
 import java.util.jar.JarFile;
 
 /**
@@ -62,6 +63,7 @@
 
     private static String WEB_NAMESPACE="foo";
     private static JarFile earFile;
+    private static MockConfigStore configStore = new MockConfigStore(null);
     private static MockEJBConfigBuilder ejbConfigBuilder = new MockEJBConfigBuilder();
     private static MockWARConfigBuilder webConfigBuilder = new MockWARConfigBuilder();
     private static MockConnectorConfigBuilder connectorConfigBuilder = new MockConnectorConfigBuilder();
@@ -249,13 +251,14 @@
 
         EARConfigBuilder configBuilder = new EARConfigBuilder(defaultParentId, transactionManagerObjectName, connectionTrackerObjectName, transactionalTimerObjectName, nonTransactionalTimerObjectName, null, null, ejbConfigBuilder, ejbConfigBuilder, webConfigBuilder, connectorConfigBuilder, resourceReferenceBuilder, appClientConfigBuilder, serviceReferenceBuilder, kernel);
 
-        File tempDir = null;
+        ConfigurationData configurationData = null;
         try {
-            tempDir = DeploymentUtil.createTempDir();
             Object plan = configBuilder.getDeploymentPlan(null, earFile);
-            configBuilder.buildConfiguration(plan, earFile, tempDir);
+            configurationData = configBuilder.buildConfiguration(plan, earFile, configStore);
         } finally {
-            DeploymentUtil.recursiveDelete(tempDir);
+            if (configurationData != null) {
+                DeploymentUtil.recursiveDelete(configurationData.getConfigurationDir());
+            }
             kernel.shutdown();
         }
     }
@@ -263,120 +266,127 @@
     public void testBadEJBJARConfiguration() throws Exception {
         EARConfigBuilder configBuilder = new EARConfigBuilder(defaultParentId, transactionManagerObjectName, connectionTrackerObjectName, transactionalTimerObjectName, nonTransactionalTimerObjectName, null, null, ejbConfigBuilder, ejbConfigBuilder, webConfigBuilder, connectorConfigBuilder, resourceReferenceBuilder, appClientConfigBuilder, serviceReferenceBuilder, null);
 
-        File tempDir = null;
+        ConfigurationData configurationData = null;
         try {
-            tempDir = DeploymentUtil.createTempDir();
             Object plan = configBuilder.getDeploymentPlan(new File(basedir, "target/plans/test-bad-ejb-jar.xml"), earFile);
-            configBuilder.buildConfiguration(plan, earFile, tempDir);
+            configurationData = configBuilder.buildConfiguration(plan, earFile, configStore);
             fail("Should have thrown a DeploymentException");
         } catch (DeploymentException e) {
             if(e.getCause() instanceof IOException) {
                 fail("Should not be complaining about bad vendor DD for invalid module entry");
             }
         } finally {
-            DeploymentUtil.recursiveDelete(tempDir);
+            if (configurationData != null) {
+                DeploymentUtil.recursiveDelete(configurationData.getConfigurationDir());
+            }
         }
     }
 
     public void testBadWARConfiguration() throws Exception {
         EARConfigBuilder configBuilder = new EARConfigBuilder(defaultParentId, transactionManagerObjectName, connectionTrackerObjectName, transactionalTimerObjectName, nonTransactionalTimerObjectName, null, null, ejbConfigBuilder, ejbConfigBuilder, webConfigBuilder, connectorConfigBuilder, resourceReferenceBuilder, appClientConfigBuilder, serviceReferenceBuilder, null);
 
-        File tempDir = null;
+        ConfigurationData configurationData = null;
         try {
-            tempDir = DeploymentUtil.createTempDir();
             Object plan = configBuilder.getDeploymentPlan(new File(basedir, "target/plans/test-bad-war.xml"), earFile);
-            configBuilder.buildConfiguration(plan, earFile, tempDir);
+            configurationData = configBuilder.buildConfiguration(plan, earFile, configStore);
             fail("Should have thrown a DeploymentException");
         } catch (DeploymentException e) {
             if(e.getCause() instanceof IOException) {
                 fail("Should not be complaining about bad vendor DD for invalid module entry");
             }
         } finally {
-            DeploymentUtil.recursiveDelete(tempDir);
+            if (configurationData != null) {
+                DeploymentUtil.recursiveDelete(configurationData.getConfigurationDir());
+            }
         }
     }
 
     public void testBadRARConfiguration() throws Exception {
         EARConfigBuilder configBuilder = new EARConfigBuilder(defaultParentId, transactionManagerObjectName, connectionTrackerObjectName, transactionalTimerObjectName, nonTransactionalTimerObjectName, null, null, ejbConfigBuilder, ejbConfigBuilder, webConfigBuilder, connectorConfigBuilder, resourceReferenceBuilder, appClientConfigBuilder, serviceReferenceBuilder, null);
 
-        File tempDir = null;
+        ConfigurationData configurationData = null;
         try {
-            tempDir = DeploymentUtil.createTempDir();
             Object plan = configBuilder.getDeploymentPlan(new File(basedir, "target/plans/test-bad-rar.xml"), earFile);
-            configBuilder.buildConfiguration(plan, earFile, tempDir);
+            configurationData = configBuilder.buildConfiguration(plan, earFile, configStore);
             fail("Should have thrown a DeploymentException");
         } catch (DeploymentException e) {
             if(e.getCause() instanceof IOException) {
                 fail("Should not be complaining about bad vendor DD for invalid module entry");
             }
         } finally {
-            DeploymentUtil.recursiveDelete(tempDir);
+            if (configurationData != null) {
+                DeploymentUtil.recursiveDelete(configurationData.getConfigurationDir());
+            }
         }
     }
 
     public void testBadCARConfiguration() throws Exception {
         EARConfigBuilder configBuilder = new EARConfigBuilder(defaultParentId, transactionManagerObjectName, connectionTrackerObjectName, transactionalTimerObjectName, nonTransactionalTimerObjectName, null, null, ejbConfigBuilder, ejbConfigBuilder, webConfigBuilder, connectorConfigBuilder, resourceReferenceBuilder, appClientConfigBuilder, serviceReferenceBuilder, null);
 
-        File tempDir = null;
+        ConfigurationData configurationData = null;
         try {
-            tempDir = DeploymentUtil.createTempDir();
             Object plan = configBuilder.getDeploymentPlan(new File(basedir, "target/plans/test-bad-car.xml"), earFile);
-            configBuilder.buildConfiguration(plan, earFile, tempDir);
+            configurationData = configBuilder.buildConfiguration(plan, earFile, configStore);
             fail("Should have thrown a DeploymentException");
         } catch (DeploymentException e) {
             if(e.getCause() instanceof IOException) {
                 fail("Should not be complaining about bad vendor DD for invalid module entry");
             }
         } finally {
-            DeploymentUtil.recursiveDelete(tempDir);
+            if (configurationData != null) {
+                DeploymentUtil.recursiveDelete(configurationData.getConfigurationDir());
+            }
         }
     }
 
     public void testNoEJBDeployer() throws Exception {
         EARConfigBuilder configBuilder = new EARConfigBuilder(defaultParentId, transactionManagerObjectName, connectionTrackerObjectName, transactionalTimerObjectName, nonTransactionalTimerObjectName, null, null, null, null, webConfigBuilder, connectorConfigBuilder, resourceReferenceBuilder, appClientConfigBuilder, serviceReferenceBuilder, null);
 
-        File tempDir = null;
+        ConfigurationData configurationData = null;
         try {
-            tempDir = DeploymentUtil.createTempDir();
             Object plan = configBuilder.getDeploymentPlan(null, earFile);
-            configBuilder.buildConfiguration(plan, earFile, tempDir);
+            configurationData = configBuilder.buildConfiguration(plan, earFile, configStore);
             fail("Should have thrown a DeploymentException");
         } catch (DeploymentException e) {
             // expected
         } finally {
-            DeploymentUtil.recursiveDelete(tempDir);
+            if (configurationData != null) {
+                DeploymentUtil.recursiveDelete(configurationData.getConfigurationDir());
+            }
         }
     }
 
     public void testNoWARDeployer() throws Exception {
         EARConfigBuilder configBuilder = new EARConfigBuilder(defaultParentId, transactionManagerObjectName, connectionTrackerObjectName, transactionalTimerObjectName, nonTransactionalTimerObjectName, null, null, ejbConfigBuilder, null, null, connectorConfigBuilder, resourceReferenceBuilder, appClientConfigBuilder, serviceReferenceBuilder, null);
 
-        File tempDir = null;
+        ConfigurationData configurationData = null;
         try {
-            tempDir = DeploymentUtil.createTempDir();
             Object plan = configBuilder.getDeploymentPlan(null, earFile);
-            configBuilder.buildConfiguration(plan, earFile, tempDir);
+            configurationData = configBuilder.buildConfiguration(plan, earFile, configStore);
             fail("Should have thrown a DeploymentException");
         } catch (DeploymentException e) {
             // expected
         } finally {
-            DeploymentUtil.recursiveDelete(tempDir);
+            if (configurationData != null) {
+                DeploymentUtil.recursiveDelete(configurationData.getConfigurationDir());
+            }
         }
     }
 
     public void testNoConnectorDeployer() throws Exception {
         EARConfigBuilder configBuilder = new EARConfigBuilder(defaultParentId, transactionManagerObjectName, connectionTrackerObjectName, transactionalTimerObjectName, nonTransactionalTimerObjectName, null, null, ejbConfigBuilder, null, webConfigBuilder, null, resourceReferenceBuilder, appClientConfigBuilder, serviceReferenceBuilder, null);
 
-        File tempDir = null;
+        ConfigurationData configurationData = null;
         try {
-            tempDir = DeploymentUtil.createTempDir();
             Object plan = configBuilder.getDeploymentPlan(null, earFile);
-            configBuilder.buildConfiguration(plan, earFile, tempDir);
+            configurationData = configBuilder.buildConfiguration(plan, earFile, configStore);
             fail("Should have thrown a DeploymentException");
         } catch (DeploymentException e) {
             // expected
         } finally {
-            DeploymentUtil.recursiveDelete(tempDir);
+            if (configurationData != null) {
+                DeploymentUtil.recursiveDelete(configurationData.getConfigurationDir());
+            }
         }
     }
 
@@ -385,9 +395,9 @@
             module.close();
         }
     }
-
     public static class MockConfigStore implements ConfigurationStore {
         private final Kernel kernel;
+        private final Map locations = new HashMap();
 
         public MockConfigStore(Kernel kernel) {
             this.kernel = kernel;
@@ -397,7 +407,7 @@
             return null;
         }
 
-        public void install(ConfigurationData configurationData, File source) throws IOException, InvalidConfigException {
+        public void install(ConfigurationData configurationData) throws IOException, InvalidConfigException {
         }
 
         public void uninstall(Artifact configID) throws NoSuchConfigException, IOException {
@@ -433,12 +443,22 @@
             return null;
         }
 
-        public File createNewConfigurationDir() {
-            return null;
+        public File createNewConfigurationDir(Artifact configId) {
+            try {
+                File file = DeploymentUtil.createTempDir();
+                locations.put(configId, file);
+                return file;
+            } catch (IOException e) {
+                return null;
+            }
         }
 
         public URL resolve(Artifact configId, URI uri) throws NoSuchConfigException, MalformedURLException {
-            return null;
+            File file = (File) locations.get(configId);
+            if (file == null) {
+                throw new NoSuchConfigException("nothing for configid " + configId);
+            }
+            return new URL(file.toURL(), uri.toString());
         }
 
         public final static GBeanInfo GBEAN_INFO;
@@ -462,4 +482,5 @@
             }
         }
     }
+
 }

Modified: geronimo/branches/configid/modules/j2ee-builder/src/test/org/apache/geronimo/j2ee/deployment/MockConnectorConfigBuilder.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/configid/modules/j2ee-builder/src/test/org/apache/geronimo/j2ee/deployment/MockConnectorConfigBuilder.java?rev=378707&r1=378706&r2=378707&view=diff
==============================================================================
--- geronimo/branches/configid/modules/j2ee-builder/src/test/org/apache/geronimo/j2ee/deployment/MockConnectorConfigBuilder.java (original)
+++ geronimo/branches/configid/modules/j2ee-builder/src/test/org/apache/geronimo/j2ee/deployment/MockConnectorConfigBuilder.java Sat Feb 18 00:57:59 2006
@@ -27,6 +27,7 @@
 import org.apache.geronimo.common.DeploymentException;
 import org.apache.geronimo.gbean.GBeanData;
 import org.apache.geronimo.kernel.repository.Environment;
+import org.apache.geronimo.kernel.config.ConfigurationStore;
 
 /**
  * @version $Rev$ $Date$
@@ -44,7 +45,7 @@
         return new ConnectorModule(false, null, moduleFile, targetPath, null, null, null);
     }
 
-    public void installModule(JarFile earFile, EARContext earContext, Module connectorModule) {
+    public void installModule(JarFile earFile, EARContext earContext, Module connectorModule, ConfigurationStore configurationStore) {
         assertNotNull(earFile);
         assertNotNull(earContext);
         this.earContext = earContext;

Modified: geronimo/branches/configid/modules/j2ee-builder/src/test/org/apache/geronimo/j2ee/deployment/MockEJBConfigBuilder.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/configid/modules/j2ee-builder/src/test/org/apache/geronimo/j2ee/deployment/MockEJBConfigBuilder.java?rev=378707&r1=378706&r2=378707&view=diff
==============================================================================
--- geronimo/branches/configid/modules/j2ee-builder/src/test/org/apache/geronimo/j2ee/deployment/MockEJBConfigBuilder.java (original)
+++ geronimo/branches/configid/modules/j2ee-builder/src/test/org/apache/geronimo/j2ee/deployment/MockEJBConfigBuilder.java Sat Feb 18 00:57:59 2006
@@ -28,6 +28,7 @@
 import org.apache.geronimo.common.DeploymentException;
 import org.apache.geronimo.gbean.GBeanData;
 import org.apache.geronimo.kernel.repository.Environment;
+import org.apache.geronimo.kernel.config.ConfigurationStore;
 
 
 /**
@@ -46,7 +47,7 @@
         return new EJBModule(false, null, moduleFile, targetPath, null, null, null);
     }
 
-    public void installModule(JarFile earFile, EARContext earContext, Module ejbModule) {
+    public void installModule(JarFile earFile, EARContext earContext, Module ejbModule, ConfigurationStore configurationStore) {
         assertNotNull(earFile);
         assertNotNull(earContext);
         this.earContext = earContext;

Modified: geronimo/branches/configid/modules/j2ee-builder/src/test/org/apache/geronimo/j2ee/deployment/MockWARConfigBuilder.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/configid/modules/j2ee-builder/src/test/org/apache/geronimo/j2ee/deployment/MockWARConfigBuilder.java?rev=378707&r1=378706&r2=378707&view=diff
==============================================================================
--- geronimo/branches/configid/modules/j2ee-builder/src/test/org/apache/geronimo/j2ee/deployment/MockWARConfigBuilder.java (original)
+++ geronimo/branches/configid/modules/j2ee-builder/src/test/org/apache/geronimo/j2ee/deployment/MockWARConfigBuilder.java Sat Feb 18 00:57:59 2006
@@ -24,6 +24,7 @@
 import junit.framework.Assert;
 import org.apache.geronimo.common.DeploymentException;
 import org.apache.geronimo.kernel.repository.Environment;
+import org.apache.geronimo.kernel.config.ConfigurationStore;
 
 /**
  * @version $Rev$ $Date$
@@ -44,7 +45,7 @@
         return new WebModule(false, null, moduleFile, targetPath, null, null, null, contextRoot, portMap, namespace);
     }
 
-    public void installModule(JarFile earFile, EARContext earContext, Module webModule) throws DeploymentException {
+    public void installModule(JarFile earFile, EARContext earContext, Module webModule, ConfigurationStore configurationStore) throws DeploymentException {
         assertNotNull(earFile);
         assertNotNull(earContext);
         this.earContext = earContext;



Mime
View raw message