geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From djen...@apache.org
Subject svn commit: rev 56855 - in geronimo/trunk/modules: assembly/src/plan client-builder/src/java/org/apache/geronimo/client/builder client-builder/src/test/org/apache/geronimo/client/builder connector-builder/src/java/org/apache/geronimo/connector/deployment connector-builder/src/test/org/apache/geronimo/connector/deployment deployment/src/java/org/apache/geronimo/deployment deployment/src/java/org/apache/geronimo/deployment/service j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment j2ee-builder/src/test/org/apache/geronimo/j2ee/deployment jetty-builder/src/java/org/apache/geronimo/jetty/deployment jetty-builder/src/test/org/apache/geronimo/jetty/deployment
Date Sun, 07 Nov 2004 17:26:44 GMT
Author: djencks
Date: Sun Nov  7 09:26:43 2004
New Revision: 56855

Modified:
   geronimo/trunk/modules/assembly/src/plan/deployer-system-plan.xml
   geronimo/trunk/modules/assembly/src/plan/j2ee-deployer-plan.xml
   geronimo/trunk/modules/assembly/src/plan/j2ee-server-plan.xml
   geronimo/trunk/modules/assembly/src/plan/system-plan.xml
   geronimo/trunk/modules/client-builder/src/java/org/apache/geronimo/client/builder/AppClientModuleBuilder.java
   geronimo/trunk/modules/client-builder/src/test/org/apache/geronimo/client/builder/PlanParsingTest.java
   geronimo/trunk/modules/connector-builder/src/java/org/apache/geronimo/connector/deployment/ConnectorModuleBuilder.java
   geronimo/trunk/modules/connector-builder/src/test/org/apache/geronimo/connector/deployment/RAR_1_0ConfigBuilderTest.java
   geronimo/trunk/modules/connector-builder/src/test/org/apache/geronimo/connector/deployment/RAR_1_5ConfigBuilderTest.java
   geronimo/trunk/modules/deployment/src/java/org/apache/geronimo/deployment/Bootstrap.java
   geronimo/trunk/modules/deployment/src/java/org/apache/geronimo/deployment/service/ServiceConfigBuilder.java
   geronimo/trunk/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/EARConfigBuilder.java
   geronimo/trunk/modules/j2ee-builder/src/test/org/apache/geronimo/j2ee/deployment/EARConfigBuilderTest.java
   geronimo/trunk/modules/jetty-builder/src/java/org/apache/geronimo/jetty/deployment/JettyModuleBuilder.java
   geronimo/trunk/modules/jetty-builder/src/test/org/apache/geronimo/jetty/deployment/PlanParsingTest.java
Log:
implement GERONIMO-435. Every builder can specify the default parentId.  For services, a module can specify the empty string parentId="" to get no parent.

Modified: geronimo/trunk/modules/assembly/src/plan/deployer-system-plan.xml
==============================================================================
--- geronimo/trunk/modules/assembly/src/plan/deployer-system-plan.xml	(original)
+++ geronimo/trunk/modules/assembly/src/plan/deployer-system-plan.xml	Sun Nov  7 09:26:43 2004
@@ -24,6 +24,7 @@
 <configuration
     xmlns="http://geronimo.apache.org/xml/ns/deployment"
     configId="org/apache/geronimo/DeployerSystem"
+    parentId=""
     >
 
     <!-- ServerInfo service -->

Modified: geronimo/trunk/modules/assembly/src/plan/j2ee-deployer-plan.xml
==============================================================================
--- geronimo/trunk/modules/assembly/src/plan/j2ee-deployer-plan.xml	(original)
+++ geronimo/trunk/modules/assembly/src/plan/j2ee-deployer-plan.xml	Sun Nov  7 09:26:43 2004
@@ -113,10 +113,12 @@
     </gbean>
 
     <gbean name="geronimo.deployer:role=Builder,type=Service,config=org/apache/geronimo/J2EEDeployer" class="org.apache.geronimo.deployment.service.ServiceConfigBuilder">
+        <attribute name="defaultParentId">org/apache/geronimo/Server</attribute>
         <reference name="Repository">*:role=Repository,*</reference>
     </gbean>
 
     <gbean name="geronimo.deployer:role=Builder,type=EAR,config=org/apache/geronimo/J2EEDeployer" class="org.apache.geronimo.j2ee.deployment.EARConfigBuilder">
+        <attribute name="defaultParentId">org/apache/geronimo/Server</attribute>
         <attribute name="j2eeServer" type="javax.management.ObjectName">geronimo.server:j2eeType=J2EEServer,name=geronimo</attribute>
         <attribute name="transactionContextManagerObjectName" type="javax.management.ObjectName">geronimo.server:type=TransactionContextManager</attribute>
         <attribute name="connectionTrackerObjectName" type="javax.management.ObjectName">geronimo.server:type=ConnectionTracker</attribute>
@@ -131,13 +133,20 @@
         <reference name="AppClientConfigBuilder">geronimo.deployer:role=ModuleBuilder,type=AppClient,config=org/apache/geronimo/J2EEDeployer</reference>
     </gbean>
 
-    <gbean name="geronimo.deployer:role=ModuleBuilder,type=Web,config=org/apache/geronimo/J2EEDeployer" class="org.apache.geronimo.jetty.deployment.JettyModuleBuilder"/>
+    <gbean name="geronimo.deployer:role=ModuleBuilder,type=Web,config=org/apache/geronimo/J2EEDeployer" class="org.apache.geronimo.jetty.deployment.JettyModuleBuilder">
+        <attribute name="defaultParentId">org/apache/geronimo/Server</attribute>
+    </gbean>
 
-    <gbean name="geronimo.deployer:role=ModuleBuilder,type=EJB,config=org/apache/geronimo/J2EEDeployer" class="org.openejb.deployment.OpenEJBModuleBuilder"/>
+    <gbean name="geronimo.deployer:role=ModuleBuilder,type=EJB,config=org/apache/geronimo/J2EEDeployer" class="org.openejb.deployment.OpenEJBModuleBuilder">
+        <attribute name="defaultParentId">org/apache/geronimo/Server</attribute>
+<!--        <reference name="SkeletonGenerator">openejb.CORBA:type=SkeletonGenerator,vendor=OpenORB</reference>-->
+    </gbean>
 
-    <gbean name="geronimo.deployer:role=ClientEJBReferenceBuilder,config=org/apache/geronimo/J2EEDeployer" class="org.openejb.deployment.RemoteEJBReferenceBuilder"/>
+    <gbean name="geronimo.deployer:role=ClientEJBReferenceBuilder,config=org/apache/geronimo/J2EEDeployer" class="org.openejb.deployment.RemoteEJBReferenceBuilder">
+    </gbean>
 
     <gbean name="geronimo.deployer:role=ModuleBuilder,type=Connector,config=org/apache/geronimo/J2EEDeployer" class="org.apache.geronimo.connector.deployment.ConnectorModuleBuilder">
+        <attribute name="defaultParentId">org/apache/geronimo/Server</attribute>
         <attribute name="defaultMaxSize" type="int">10</attribute>
         <attribute name="defaultMinSize" type="int">0</attribute>
         <attribute name="defaultBlockingTimeoutMilliseconds" type="int">5000</attribute>
@@ -147,6 +156,8 @@
     </gbean>
 
     <gbean name="geronimo.deployer:role=ModuleBuilder,type=AppClient,config=org/apache/geronimo/J2EEDeployer" class="org.apache.geronimo.client.builder.AppClientModuleBuilder">
+        <attribute name="defaultClientParentId">org/apache/geronimo/Client</attribute>
+        <attribute name="defaultServerParentId">org/apache/geronimo/Server</attribute>
         <attribute name="transactionContextManagerObjectName" type="javax.management.ObjectName">geronimo.client:type=TransactionContextManager</attribute>
         <attribute name="connectionTrackerObjectName" type="javax.management.ObjectName">geronimo.client:type=ConnectionTracker</attribute>
         <reference name="EJBReferenceBuilder">geronimo.deployer:role=ClientEJBReferenceBuilder,config=org/apache/geronimo/J2EEDeployer</reference>
@@ -155,5 +166,13 @@
         <reference name="Store">geronimo.deployment:role=ConfigurationStore,type=Local</reference>
         <reference name="Repository">*:role=Repository,*</reference>
     </gbean>
+
+<!--    <gbean name="openejb.CORBA:type=Compiler,vendor=Ant" class="org.openejb.corba.compiler.AntCompiler"/>-->
+<!---->
+<!--    <gbean name="openejb.CORBA:type=SkeletonGenerator,vendor=OpenORB" class="org.openejb.corba.compiler.OpenORBSkeletonGenerator">-->
+<!--        <attribute name="props" type="java.util.Properties">-->
+<!--        </attribute>-->
+<!--        <reference name="Compiler">openejb.CORBA:type=Compiler,vendor=Ant</reference>-->
+<!--    </gbean>-->
 
 </configuration>

Modified: geronimo/trunk/modules/assembly/src/plan/j2ee-server-plan.xml
==============================================================================
--- geronimo/trunk/modules/assembly/src/plan/j2ee-server-plan.xml	(original)
+++ geronimo/trunk/modules/assembly/src/plan/j2ee-server-plan.xml	Sun Nov  7 09:26:43 2004
@@ -259,10 +259,12 @@
     </gbean>
 
     <gbean name="geronimo.deployer:role=Builder,type=Service,config=org/apache/geronimo/Server" class="org.apache.geronimo.deployment.service.ServiceConfigBuilder">
+        <attribute name="defaultParentId">org/apache/geronimo/Server</attribute>
         <reference name="Repository">*:role=Repository,*</reference>
     </gbean>
 
     <gbean name="geronimo.deployer:role=Builder,type=EAR,config=org/apache/geronimo/Server" class="org.apache.geronimo.j2ee.deployment.EARConfigBuilder">
+        <attribute name="defaultParentId">org/apache/geronimo/Server</attribute>
         <attribute name="j2eeServer" type="javax.management.ObjectName">geronimo.server:j2eeType=J2EEServer,name=geronimo</attribute>
         <attribute name="transactionContextManagerObjectName" type="javax.management.ObjectName">geronimo.server:type=TransactionContextManager</attribute>
         <attribute name="connectionTrackerObjectName" type="javax.management.ObjectName">geronimo.server:type=ConnectionTracker</attribute>
@@ -277,13 +279,19 @@
         <reference name="AppClientConfigBuilder">geronimo.deployer:role=ModuleBuilder,type=AppClient,config=org/apache/geronimo/Server</reference>
     </gbean>
 
-    <gbean name="geronimo.deployer:role=ModuleBuilder,type=Web,config=org/apache/geronimo/Server" class="org.apache.geronimo.jetty.deployment.JettyModuleBuilder"/>
+    <gbean name="geronimo.deployer:role=ModuleBuilder,type=Web,config=org/apache/geronimo/Server" class="org.apache.geronimo.jetty.deployment.JettyModuleBuilder">
+        <attribute name="defaultParentId">org/apache/geronimo/Server</attribute>
+    </gbean>
 
-    <gbean name="geronimo.deployer:role=ModuleBuilder,type=EJB,config=org/apache/geronimo/Server" class="org.openejb.deployment.OpenEJBModuleBuilder"/>
+    <gbean name="geronimo.deployer:role=ModuleBuilder,type=EJB,config=org/apache/geronimo/Server" class="org.openejb.deployment.OpenEJBModuleBuilder">
+        <attribute name="defaultParentId">org/apache/geronimo/Server</attribute>
+<!--        <reference name="SkeletonGenerator">openejb.CORBA:type=SkeletonGenerator,vendor=OpenORB</reference>-->
+    </gbean>
 
     <gbean name="geronimo.deployer:role=ClientEJBReferenceBuilder,config=org/apache/geronimo/Server" class="org.openejb.deployment.RemoteEJBReferenceBuilder"/>
 
     <gbean name="geronimo.deployer:role=ModuleBuilder,type=Connector,config=org/apache/geronimo/Server" class="org.apache.geronimo.connector.deployment.ConnectorModuleBuilder">
+        <attribute name="defaultParentId">org/apache/geronimo/Server</attribute>
         <attribute name="defaultMaxSize" type="int">10</attribute>
         <attribute name="defaultMinSize" type="int">0</attribute>
         <attribute name="defaultBlockingTimeoutMilliseconds" type="int">5000</attribute>
@@ -293,6 +301,8 @@
     </gbean>
 
     <gbean name="geronimo.deployer:role=ModuleBuilder,type=AppClient,config=org/apache/geronimo/Server" class="org.apache.geronimo.client.builder.AppClientModuleBuilder">
+        <attribute name="defaultClientParentId">org/apache/geronimo/Client</attribute>
+        <attribute name="defaultServerParentId">org/apache/geronimo/Server</attribute>
         <attribute name="transactionContextManagerObjectName" type="javax.management.ObjectName">geronimo.client:type=TransactionContextManager</attribute>
         <attribute name="connectionTrackerObjectName" type="javax.management.ObjectName">geronimo.client:type=ConnectionTracker</attribute>
         <reference name="EJBReferenceBuilder">geronimo.deployer:role=ClientEJBReferenceBuilder,config=org/apache/geronimo/Server</reference>
@@ -301,5 +311,14 @@
         <reference name="Store">*:role=ConfigurationStore,type=Local</reference>
         <reference name="Repository">*:role=Repository,*</reference>
     </gbean>
+
+<!--    <gbean name="openejb.CORBA:type=Compiler,vendor=Ant" class="org.openejb.corba.compiler.AntCompiler"/>-->
+<!---->
+<!--    <gbean name="openejb.CORBA:type=SkeletonGenerator,vendor=OpenORB" class="org.openejb.corba.compiler.OpenORBSkeletonGenerator">-->
+<!--        <attribute name="props" type="java.util.Properties">-->
+<!--        </attribute>-->
+<!--        <reference name="Compiler">openejb.CORBA:type=Compiler,vendor=Ant</reference>-->
+<!--    </gbean>-->
+<!---->
     <!-- end deployment block -->
 </configuration>

Modified: geronimo/trunk/modules/assembly/src/plan/system-plan.xml
==============================================================================
--- geronimo/trunk/modules/assembly/src/plan/system-plan.xml	(original)
+++ geronimo/trunk/modules/assembly/src/plan/system-plan.xml	Sun Nov  7 09:26:43 2004
@@ -29,6 +29,7 @@
 <configuration
     xmlns="http://geronimo.apache.org/xml/ns/deployment"
     configId="org/apache/geronimo/System"
+    parentId=""
     >
 
     <!-- ServerInfo service -->

Modified: geronimo/trunk/modules/client-builder/src/java/org/apache/geronimo/client/builder/AppClientModuleBuilder.java
==============================================================================
--- geronimo/trunk/modules/client-builder/src/java/org/apache/geronimo/client/builder/AppClientModuleBuilder.java	(original)
+++ geronimo/trunk/modules/client-builder/src/java/org/apache/geronimo/client/builder/AppClientModuleBuilder.java	Sun Nov  7 09:26:43 2004
@@ -74,11 +74,13 @@
  * @version $Rev: 46019 $ $Date: 2004-09-14 02:56:06 -0700 (Tue, 14 Sep 2004) $
  */
 public class AppClientModuleBuilder implements ModuleBuilder {
+
+    private final URI defaultClientParentId;
+    private final URI defaultServerParentId;
     private final Kernel kernel;
     private final Repository repository;
     private final ConfigurationStore store;
 
-    private static final URI CLIENT_PARENT_ID = URI.create("org/apache/geronimo/Client");
     private final String clientDomainName = "geronimo.client";
     private final String clientServerName = "client";
     private final String clientApplicationName = "client-application";
@@ -88,7 +90,9 @@
     private final ModuleBuilder connectorModuleBuilder;
     private final ResourceReferenceBuilder resourceReferenceBuilder;
 
-    public AppClientModuleBuilder(ObjectName transactionContextManagerObjectName,
+    public AppClientModuleBuilder(URI defaultClientParentId,
+                                  URI defaultServerParentId,
+                                  ObjectName transactionContextManagerObjectName,
                                   ObjectName connectionTrackerObjectName,
                                   EJBReferenceBuilder ejbReferenceBuilder,
                                   ModuleBuilder connectorModuleBuilder,
@@ -96,6 +100,8 @@
                                   ConfigurationStore store,
                                   Repository repository,
                                   Kernel kernel) {
+        this.defaultClientParentId = defaultClientParentId;
+        this.defaultServerParentId = defaultServerParentId;
         this.kernel = kernel;
         this.repository = repository;
         this.store = store;
@@ -158,6 +164,8 @@
             } catch (URISyntaxException e) {
                 throw new DeploymentException("Invalid parentId " + gerAppClient.getParentId(), e);
             }
+        } else {
+            parentId = defaultServerParentId;
         }
 
         return new AppClientModule(standAlone, configId, parentId, moduleFile, targetPath, appClient, gerAppClient, specDD);
@@ -318,7 +326,7 @@
                     if (geronimoAppClient.isSetClientParentId()) {
                         clientParentId = URI.create(geronimoAppClient.getClientParentId());
                     } else {
-                        clientParentId = CLIENT_PARENT_ID;
+                        clientParentId = defaultClientParentId;
                     }
                     appClientDeploymentContext = new EARContext(appClientConfiguration,
                             clientConfigId,
@@ -587,20 +595,24 @@
     public static final GBeanInfo GBEAN_INFO;
 
     static {
-        GBeanInfoBuilder infoFactory = new GBeanInfoBuilder(AppClientModuleBuilder.class);
-        infoFactory.addAttribute("transactionContextManagerObjectName", ObjectName.class, true);
-        infoFactory.addAttribute("connectionTrackerObjectName", ObjectName.class, true);
-        infoFactory.addReference("EJBReferenceBuilder", EJBReferenceBuilder.class);
-        infoFactory.addReference("ConnectorModuleBuilder", ModuleBuilder.class);
-        infoFactory.addReference("ResourceReferenceBuilder", ResourceReferenceBuilder.class);
-        infoFactory.addReference("Store", ConfigurationStore.class);
-        infoFactory.addReference("Repository", Repository.class);
-
-        infoFactory.addAttribute("kernel", Kernel.class, false);
-
-        infoFactory.addInterface(ModuleBuilder.class);
-
-        infoFactory.setConstructor(new String[]{"transactionContextManagerObjectName",
+        GBeanInfoBuilder infoBuilder = new GBeanInfoBuilder(AppClientModuleBuilder.class);
+        infoBuilder.addAttribute("defaultClientParentId", URI.class, true);
+        infoBuilder.addAttribute("defaultServerParentId", URI.class, true);
+        infoBuilder.addAttribute("transactionContextManagerObjectName", ObjectName.class, true);
+        infoBuilder.addAttribute("connectionTrackerObjectName", ObjectName.class, true);
+        infoBuilder.addReference("EJBReferenceBuilder", EJBReferenceBuilder.class);
+        infoBuilder.addReference("ConnectorModuleBuilder", ModuleBuilder.class);
+        infoBuilder.addReference("ResourceReferenceBuilder", ResourceReferenceBuilder.class);
+        infoBuilder.addReference("Store", ConfigurationStore.class);
+        infoBuilder.addReference("Repository", Repository.class);
+
+        infoBuilder.addAttribute("kernel", Kernel.class, false);
+
+        infoBuilder.addInterface(ModuleBuilder.class);
+
+        infoBuilder.setConstructor(new String[]{"defaultClientParentId",
+                                                "defaultServerParentId",
+                                                "transactionContextManagerObjectName",
                                                 "connectionTrackerObjectName",
                                                 "EJBReferenceBuilder",
                                                 "ConnectorModuleBuilder",
@@ -608,7 +620,7 @@
                                                 "Store",
                                                 "Repository",
                                                 "kernel"});
-        GBEAN_INFO = infoFactory.getBeanInfo();
+        GBEAN_INFO = infoBuilder.getBeanInfo();
     }
 
     public static GBeanInfo getGBeanInfo() {

Modified: geronimo/trunk/modules/client-builder/src/test/org/apache/geronimo/client/builder/PlanParsingTest.java
==============================================================================
--- geronimo/trunk/modules/client-builder/src/test/org/apache/geronimo/client/builder/PlanParsingTest.java	(original)
+++ geronimo/trunk/modules/client-builder/src/test/org/apache/geronimo/client/builder/PlanParsingTest.java	Sun Nov  7 09:26:43 2004
@@ -12,7 +12,7 @@
  */
 public class PlanParsingTest extends TestCase {
 
-    private AppClientModuleBuilder builder = new AppClientModuleBuilder(null, null,null, null, null, null, null, null);
+    private AppClientModuleBuilder builder = new AppClientModuleBuilder(null, null, null, null,null, null, null, null, null, null);
     File basedir = new File(System.getProperty("basedir", "."));
 
     public void testResourceRef() throws Exception {

Modified: geronimo/trunk/modules/connector-builder/src/java/org/apache/geronimo/connector/deployment/ConnectorModuleBuilder.java
==============================================================================
--- geronimo/trunk/modules/connector-builder/src/java/org/apache/geronimo/connector/deployment/ConnectorModuleBuilder.java	(original)
+++ geronimo/trunk/modules/connector-builder/src/java/org/apache/geronimo/connector/deployment/ConnectorModuleBuilder.java	Sun Nov  7 09:26:43 2004
@@ -115,8 +115,10 @@
     private final boolean defaultXATransactionCaching;
     private final boolean defaultXAThreadCaching;
     private final Kernel kernel;
+    private final URI defaultParentId;
 
-    public ConnectorModuleBuilder(int defaultMaxSize, int defaultMinSize, int defaultBlockingTimeoutMilliseconds, int defaultIdleTimeoutMinutes, boolean defaultXATransactionCaching, boolean defaultXAThreadCaching, Kernel kernel) {
+    public ConnectorModuleBuilder(URI defaultParentId, int defaultMaxSize, int defaultMinSize, int defaultBlockingTimeoutMilliseconds, int defaultIdleTimeoutMinutes, boolean defaultXATransactionCaching, boolean defaultXAThreadCaching, Kernel kernel) {
+        this.defaultParentId = defaultParentId;
         this.defaultMaxSize = defaultMaxSize;
         this.defaultMinSize = defaultMinSize;
         this.defaultBlockingTimeoutMilliseconds = defaultBlockingTimeoutMilliseconds;
@@ -191,7 +193,7 @@
 
             // if we got one extract the validate it otherwise create a default one
             if (gerConnector == null) {
-                throw new DeploymentException("A connector module must contain a geronimo-ra.xml");
+                throw new DeploymentException("A connector module must be deployed using a plan");
             }
             SchemaConversionUtils.validateDD(gerConnector);
         } catch (XmlException e) {
@@ -213,6 +215,8 @@
             } catch (URISyntaxException e) {
                 throw new DeploymentException("Invalid parentId " + gerConnector.getParentId(), e);
             }
+        } else {
+            parentId = defaultParentId;
         }
 
         return new ConnectorModule(standAlone, configId, parentId, moduleFile, targetPath, connector, gerConnector, specDD);
@@ -917,6 +921,8 @@
 
     static {
         GBeanInfoBuilder infoBuilder = new GBeanInfoBuilder(ConnectorModuleBuilder.class);
+
+        infoBuilder.addAttribute("defaultParentId", URI.class, true);
         infoBuilder.addAttribute("defaultMaxSize", int.class, true);
         infoBuilder.addAttribute("defaultMinSize", int.class, true);
         infoBuilder.addAttribute("defaultBlockingTimeoutMilliseconds", int.class, true);
@@ -929,7 +935,7 @@
         infoBuilder.addInterface(ModuleBuilder.class);
         infoBuilder.addInterface(ResourceReferenceBuilder.class);
 
-        infoBuilder.setConstructor(new String[]{"defaultMaxSize", "defaultMinSize", "defaultBlockingTimeoutMilliseconds", "defaultIdleTimeoutMinutes", "defaultXATransactionCaching", "defaultXAThreadCaching", "kernel"});
+        infoBuilder.setConstructor(new String[]{"defaultParentId", "defaultMaxSize", "defaultMinSize", "defaultBlockingTimeoutMilliseconds", "defaultIdleTimeoutMinutes", "defaultXATransactionCaching", "defaultXAThreadCaching", "kernel"});
         GBEAN_INFO = infoBuilder.getBeanInfo();
     }
 

Modified: geronimo/trunk/modules/connector-builder/src/test/org/apache/geronimo/connector/deployment/RAR_1_0ConfigBuilderTest.java
==============================================================================
--- geronimo/trunk/modules/connector-builder/src/test/org/apache/geronimo/connector/deployment/RAR_1_0ConfigBuilderTest.java	(original)
+++ geronimo/trunk/modules/connector-builder/src/test/org/apache/geronimo/connector/deployment/RAR_1_0ConfigBuilderTest.java	Sun Nov  7 09:26:43 2004
@@ -23,6 +23,7 @@
 import java.io.InputStream;
 import java.io.ObjectInputStream;
 import java.net.MalformedURLException;
+import java.net.URI;
 import java.net.URL;
 import java.net.URLClassLoader;
 import java.sql.Connection;
@@ -45,12 +46,10 @@
 import org.apache.geronimo.j2ee.deployment.Module;
 import org.apache.geronimo.j2ee.deployment.ModuleBuilder;
 import org.apache.geronimo.j2ee.deployment.RefContext;
-import org.apache.geronimo.j2ee.j2eeobjectnames.J2eeContextImpl;
 import org.apache.geronimo.j2ee.j2eeobjectnames.J2eeContext;
+import org.apache.geronimo.j2ee.j2eeobjectnames.J2eeContextImpl;
 import org.apache.geronimo.j2ee.j2eeobjectnames.NameFactory;
 import org.apache.geronimo.j2ee.management.impl.J2EEServerImpl;
-import org.apache.geronimo.j2ee.j2eeobjectnames.J2eeContext;
-import org.apache.geronimo.j2ee.j2eeobjectnames.NameFactory;
 import org.apache.geronimo.kernel.Kernel;
 import org.apache.geronimo.kernel.management.State;
 import org.apache.geronimo.system.serverinfo.ServerInfo;
@@ -74,6 +73,7 @@
     private int defaultMinSize = 0;
     private int defaultBlockingTimeoutMilliseconds = 5000;
     private int defaultidleTimeoutMinutes = 15;
+    private URI defaultParentId;
 
 
     public void testLoadJ2eeDeploymentDescriptor() throws Exception {
@@ -183,7 +183,7 @@
         ObjectName connectionTrackerName = new ObjectName("geronimo.connector:service=ConnectionTracker");
 
         Kernel kernel = new Kernel("testServer");
-        ConnectorModuleBuilder moduleBuilder = new ConnectorModuleBuilder(defaultMaxSize, defaultMinSize, defaultBlockingTimeoutMilliseconds, defaultidleTimeoutMinutes, defaultXATransactionCaching, defaultXAThreadCaching, kernel);
+        ConnectorModuleBuilder moduleBuilder = new ConnectorModuleBuilder(defaultParentId, defaultMaxSize, defaultMinSize, defaultBlockingTimeoutMilliseconds, defaultidleTimeoutMinutes, defaultXATransactionCaching, defaultXAThreadCaching, kernel);
         File rarFile = action.getRARFile();
 
         ClassLoader oldCl = Thread.currentThread().getContextClassLoader();
@@ -237,7 +237,7 @@
         JarFile rarFile = null;
         try {
             rarFile = DeploymentUtil.createJarFile(new File(basedir, "target/test-ear-noger.ear"));
-            EARConfigBuilder configBuilder = new EARConfigBuilder(j2eeServer, null, connectionTrackerName, null, null, null, null, null, null, new ConnectorModuleBuilder(defaultMaxSize, defaultMinSize, defaultBlockingTimeoutMilliseconds, defaultidleTimeoutMinutes, defaultXATransactionCaching, defaultXAThreadCaching, kernel), null, null, kernel);
+            EARConfigBuilder configBuilder = new EARConfigBuilder(defaultParentId, j2eeServer, null, connectionTrackerName, null, null, null, null, null, null, new ConnectorModuleBuilder(defaultParentId, defaultMaxSize, defaultMinSize, defaultBlockingTimeoutMilliseconds, defaultidleTimeoutMinutes, defaultXATransactionCaching, defaultXAThreadCaching, kernel), null, null, kernel);
             File tempDir = null;
             try {
                 tempDir = DeploymentUtil.createTempDir();
@@ -295,82 +295,42 @@
             }
 
             ObjectName moduleName = NameFactory.getModuleName(null, null, null, null, NameFactory.RESOURCE_ADAPTER_MODULE, j2eeContext);
-//                    ObjectName.getInstance(j2eeDomainName + ":j2eeType=ResourceAdapterModule,J2EEServer=" + j2eeServerName + ",J2EEApplication=" + j2eeApplicationName + ",name=" + j2eeModuleName);
             assertRunning(kernel, moduleName);
 
             // FirstTestOutboundConnectionFactory
             ObjectName firstConnectionManagerFactory = NameFactory.getResourceComponentName(null, null, null, null, "FirstTestOutboundConnectionFactory", NameFactory.JCA_CONNECTION_MANAGER, j2eeContext);
-//                    new ObjectName(j2eeDomainName +
-//                    ":j2eeType=ConnectionManager" +
-//                    ",J2EEServer=" + j2eeServerName +
-//                    ",name=FirstTestOutboundConnectionFactory");
             assertRunning(kernel, firstConnectionManagerFactory);
 
 
             ObjectName firstOutCF = NameFactory.getResourceComponentName(null, null, null, null, "FirstTestOutboundConnectionFactory", NameFactory.JCA_CONNECTION_FACTORY, j2eeContext);
-//                    new ObjectName(j2eeDomainName +
-//                    ":j2eeType=JCAConnectionFactory" +
-//                    ",J2EEServer=" + j2eeServerName +
-//                    ",JCAResource=null" +
-//                    ",name=FirstTestOutboundConnectionFactory");
             assertRunning(kernel, firstOutCF);
 
             ObjectName firstOutSecurity = new ObjectName("geronimo.security:service=Realm,type=PasswordCredential,name=FirstTestOutboundConnectionFactory");
             assertRunning(kernel, firstOutSecurity);
 
             ObjectName firstOutMCF = NameFactory.getResourceComponentName(null, null, null, null, "FirstTestOutboundConnectionFactory", NameFactory.JCA_MANAGED_CONNECTION_FACTORY, j2eeContext);
-//                    new ObjectName(j2eeDomainName +
-//                    ":j2eeType=JCAManagedConnectionFactory" +
-//                    ",J2EEServer=" + j2eeServerName +
-//                    ",name=FirstTestOutboundConnectionFactory");
             assertRunning(kernel, firstOutMCF);
 
             // SecondTestOutboundConnectionFactory
             ObjectName secondConnectionManagerFactory = NameFactory.getResourceComponentName(null, null, null, null, "SecondTestOutboundConnectionFactory", NameFactory.JCA_CONNECTION_MANAGER, j2eeContext);
-// new ObjectName(j2eeDomainName +
-//                    ":j2eeType=ConnectionManager" +
-//                    ",J2EEServer=" + j2eeServerName +
-//                    ",name=SecondTestOutboundConnectionFactory");
             assertRunning(kernel, secondConnectionManagerFactory);
 
 
             ObjectName secondOutCF = NameFactory.getResourceComponentName(null, null, null, null, "SecondTestOutboundConnectionFactory", NameFactory.JCA_CONNECTION_FACTORY, j2eeContext);
-//new ObjectName(j2eeDomainName +
-//                    ":j2eeType=JCAConnectionFactory" +
-//                    ",J2EEServer=" + j2eeServerName +
-//                    ",JCAResource=null" +
-//                    ",name=SecondTestOutboundConnectionFactory");
             assertRunning(kernel, secondOutCF);
 
             ObjectName secondOutMCF = NameFactory.getResourceComponentName(null, null, null, null, "SecondTestOutboundConnectionFactory", NameFactory.JCA_MANAGED_CONNECTION_FACTORY, j2eeContext);
-//                    new ObjectName(j2eeDomainName +
-//                    ":j2eeType=JCAManagedConnectionFactory" +
-//                    ",J2EEServer=" + j2eeServerName +
-//                    ",name=SecondTestOutboundConnectionFactory");
             assertRunning(kernel, secondOutMCF);
 
             // ThirdTestOutboundConnectionFactory
             ObjectName thirdConnectionManagerFactory = NameFactory.getResourceComponentName(null, null, null, null, "ThirdTestOutboundConnectionFactory", NameFactory.JCA_CONNECTION_MANAGER, j2eeContext);
-//new ObjectName(j2eeDomainName +
-//                    ":j2eeType=ConnectionManager" +
-//                    ",J2EEServer=" + j2eeServerName +
-//                    ",name=ThirdTestOutboundConnectionFactory");
             assertRunning(kernel, thirdConnectionManagerFactory);
 
 
             ObjectName thirdOutCF = NameFactory.getResourceComponentName(null, null, null, null, "ThirdTestOutboundConnectionFactory", NameFactory.JCA_CONNECTION_FACTORY, j2eeContext);
-//new ObjectName(j2eeDomainName +
-//                    ":j2eeType=JCAConnectionFactory" +
-//                    ",J2EEServer=" + j2eeServerName +
-//                    ",JCAResource=null" +
-//                    ",name=ThirdTestOutboundConnectionFactory");
             assertRunning(kernel, thirdOutCF);
 
             ObjectName thirdOutMCF = NameFactory.getResourceComponentName(null, null, null, null, "ThirdTestOutboundConnectionFactory", NameFactory.JCA_MANAGED_CONNECTION_FACTORY, j2eeContext);
-//                    new ObjectName(j2eeDomainName +
-//                    ":j2eeType=JCAManagedConnectionFactory" +
-//                    ",J2EEServer=" + j2eeServerName +
-//                    ",name=ThirdTestOutboundConnectionFactory");
             assertRunning(kernel, thirdOutMCF);
 
             kernel.stopGBean(objectName);
@@ -413,6 +373,7 @@
     }
 
     protected void setUp() throws Exception {
+        defaultParentId = null;//new URI("org/apache/geronimo/Server");
         File docDir = new File(basedir, "src/test-data/connector_1_0");
         j2eeDD = new File(docDir, "ra.xml").toURL();
         geronimoDD = new File(docDir, "geronimo-ra.xml").toURL();

Modified: geronimo/trunk/modules/connector-builder/src/test/org/apache/geronimo/connector/deployment/RAR_1_5ConfigBuilderTest.java
==============================================================================
--- geronimo/trunk/modules/connector-builder/src/test/org/apache/geronimo/connector/deployment/RAR_1_5ConfigBuilderTest.java	(original)
+++ geronimo/trunk/modules/connector-builder/src/test/org/apache/geronimo/connector/deployment/RAR_1_5ConfigBuilderTest.java	Sun Nov  7 09:26:43 2004
@@ -24,6 +24,7 @@
 import java.io.ObjectInputStream;
 import java.net.URL;
 import java.net.URLClassLoader;
+import java.net.URI;
 import java.sql.Connection;
 import java.sql.Statement;
 import java.util.ArrayList;
@@ -74,6 +75,7 @@
     private int defaultMinSize = 0;
     private int defaultBlockingTimeoutMilliseconds = 5000;
     private int defaultidleTimeoutMinutes = 15;
+    private URI defaultParentId;
 
     public void testLoadJ2eeDeploymentDescriptor() throws Exception {
         InputStream j2eeInputStream = j2eeDD.openStream();
@@ -130,7 +132,7 @@
         ObjectName connectionTrackerName = new ObjectName("geronimo.connector:service=ConnectionTracker");
 
         Kernel kernel = new Kernel("testServer");
-        ConnectorModuleBuilder moduleBuilder = new ConnectorModuleBuilder(defaultMaxSize, defaultMinSize, defaultBlockingTimeoutMilliseconds, defaultidleTimeoutMinutes, defaultXATransactionCaching, defaultXAThreadCaching, kernel);
+        ConnectorModuleBuilder moduleBuilder = new ConnectorModuleBuilder(defaultParentId, defaultMaxSize, defaultMinSize, defaultBlockingTimeoutMilliseconds, defaultidleTimeoutMinutes, defaultXATransactionCaching, defaultXAThreadCaching, kernel);
         File rarFile = action.getRARFile();
 
         ClassLoader oldCl = Thread.currentThread().getContextClassLoader();
@@ -384,6 +386,7 @@
     }
 
     protected void setUp() throws Exception {
+        defaultParentId = new URI("org/apache/geronimo/Server");
         File docDir = new File(basedir, "src/test-data/connector_1_5");
         j2eeDD = new File(docDir, "ra.xml").toURL();
         geronimoDD = new File(docDir, "geronimo-ra.xml").toURL();

Modified: geronimo/trunk/modules/deployment/src/java/org/apache/geronimo/deployment/Bootstrap.java
==============================================================================
--- geronimo/trunk/modules/deployment/src/java/org/apache/geronimo/deployment/Bootstrap.java	(original)
+++ geronimo/trunk/modules/deployment/src/java/org/apache/geronimo/deployment/Bootstrap.java	Sun Nov  7 09:26:43 2004
@@ -120,7 +120,9 @@
             // create the service builder, repository and config store objects
             LocalConfigStore configStore = new LocalConfigStore(new File(storeDir));
             ReadOnlyRepository repository = new ReadOnlyRepository(new File(repositoryDir));
-            ServiceConfigBuilder builder = new ServiceConfigBuilder(repository);
+
+            //TODO should the defaultParentId be null??
+            ServiceConfigBuilder builder = new ServiceConfigBuilder(null, repository);
 
             // create the manifext
             Manifest manifest = new Manifest();

Modified: geronimo/trunk/modules/deployment/src/java/org/apache/geronimo/deployment/service/ServiceConfigBuilder.java
==============================================================================
--- geronimo/trunk/modules/deployment/src/java/org/apache/geronimo/deployment/service/ServiceConfigBuilder.java	(original)
+++ geronimo/trunk/modules/deployment/src/java/org/apache/geronimo/deployment/service/ServiceConfigBuilder.java	Sun Nov  7 09:26:43 2004
@@ -49,14 +49,20 @@
  * @version $Rev$ $Date$
  */
 public class ServiceConfigBuilder implements ConfigurationBuilder {
+    private final URI defaultParentId;
     private final Repository repository;
     private final Kernel kernel;
 
-    public ServiceConfigBuilder(Repository repository) {
-        this(repository, null);
+    public ServiceConfigBuilder(URI defaultParentId, Repository repository) {
+        this(defaultParentId, repository, null);
     }
 
-    public ServiceConfigBuilder(Repository repository, Kernel kernel) {
+    public ServiceConfigBuilder(URI defaultParentId, Repository repository, Kernel kernel) {
+        if (defaultParentId == null) {
+            this.defaultParentId = null;
+        } else {
+            this.defaultParentId = defaultParentId;
+        }
         this.repository = repository;
         this.kernel = kernel;
     }
@@ -87,13 +93,17 @@
         }
         URI parentID;
         if (configType.isSetParentId()) {
-            try {
-                parentID = new URI(configType.getParentId());
-            } catch (URISyntaxException e) {
-                throw new DeploymentException("Invalid parentId " + configType.getParentId(), e);
+            if (configType.getParentId().equals("")) {
+                parentID = null;
+            } else {
+                try {
+                    parentID = new URI(configType.getParentId());
+                } catch (URISyntaxException e) {
+                    throw new DeploymentException("Invalid parentId " + configType.getParentId(), e);
+                }
             }
         } else {
-            parentID = null;
+            parentID = defaultParentId;
         }
 
         DeploymentContext context = null;
@@ -198,10 +208,11 @@
 
         infoFactory.addInterface(ConfigurationBuilder.class);
 
+        infoFactory.addAttribute("defaultParentId", URI.class, true);
         infoFactory.addReference("Repository", Repository.class);
         infoFactory.addAttribute("kernel", Kernel.class, false);
 
-        infoFactory.setConstructor(new String[]{"Repository", "kernel"});
+        infoFactory.setConstructor(new String[]{"defaultParentId", "Repository", "kernel"});
 
         GBEAN_INFO = infoFactory.getBeanInfo();
     }

Modified: geronimo/trunk/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/EARConfigBuilder.java
==============================================================================
--- geronimo/trunk/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/EARConfigBuilder.java	(original)
+++ geronimo/trunk/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/EARConfigBuilder.java	Sun Nov  7 09:26:43 2004
@@ -67,7 +67,6 @@
  * @version $Rev$ $Date$
  */
 public class EARConfigBuilder implements ConfigurationBuilder {
-    private static final String PARENT_ID = "org/apache/geronimo/Server";
 
     private final Kernel kernel;
     private final Repository repository;
@@ -77,6 +76,8 @@
     private final ModuleBuilder appClientConfigBuilder;
     private final EJBReferenceBuilder ejbReferenceBuilder;
     private final ResourceReferenceBuilder resourceReferenceBuilder;
+
+    private final URI defaultParentId;
     private final String j2eeServerName;
     private final String j2eeDomainName;
     private final ObjectName j2eeServer;
@@ -86,9 +87,10 @@
     private final ObjectName nonTransactionalTimerObjectName;
 
 
-    public EARConfigBuilder(ObjectName j2eeServer, ObjectName transactionContextManagerObjectName, ObjectName connectionTrackerObjectName, ObjectName transactionalTimerObjectName, ObjectName nonTransactionalTimerObjectName, Repository repository, ModuleBuilder ejbConfigBuilder, EJBReferenceBuilder ejbReferenceBuilder, ModuleBuilder webConfigBuilder, ModuleBuilder connectorConfigBuilder, ResourceReferenceBuilder resourceReferenceBuilder, ModuleBuilder appClientConfigBuilder, Kernel kernel) {
+    public EARConfigBuilder(URI defaultParentId, ObjectName j2eeServer, ObjectName transactionContextManagerObjectName, ObjectName connectionTrackerObjectName, ObjectName transactionalTimerObjectName, ObjectName nonTransactionalTimerObjectName, Repository repository, ModuleBuilder ejbConfigBuilder, EJBReferenceBuilder ejbReferenceBuilder, ModuleBuilder webConfigBuilder, ModuleBuilder connectorConfigBuilder, ResourceReferenceBuilder resourceReferenceBuilder, ModuleBuilder appClientConfigBuilder, Kernel kernel) {
         this.kernel = kernel;
         this.repository = repository;
+        this.defaultParentId = defaultParentId;
         this.j2eeServer = j2eeServer;
         j2eeServerName = j2eeServer.getKeyProperty("name");
         j2eeDomainName = j2eeServer.getDomain();
@@ -197,6 +199,8 @@
             } catch (URISyntaxException e) {
                 throw new DeploymentException("Invalid parentId " + gerApplication.getParentId(), e);
             }
+        } else {
+            parentId = defaultParentId;
         }
 
         // get the modules either the application plan or for a stand alone module from the specific deployer
@@ -242,7 +246,7 @@
         GerApplicationType gerApplication = GerApplicationType.Factory.newInstance();
 
         // set the parentId and configId
-        gerApplication.setParentId(PARENT_ID);
+        gerApplication.setParentId(defaultParentId.toString());
         String id = application.getId();
         if (id == null) {
             File fileName = new File(module.getName());
@@ -538,6 +542,7 @@
 
     static {
         GBeanInfoBuilder infoFactory = new GBeanInfoBuilder(EARConfigBuilder.class);
+        infoFactory.addAttribute("defaultParentId", URI.class, true);
         infoFactory.addAttribute("j2eeServer", ObjectName.class, true);
         infoFactory.addAttribute("transactionContextManagerObjectName", ObjectName.class, true);
         infoFactory.addAttribute("connectionTrackerObjectName", ObjectName.class, true);
@@ -557,6 +562,7 @@
         infoFactory.addInterface(ConfigurationBuilder.class);
 
         infoFactory.setConstructor(new String[]{
+            "defaultParentId",
             "j2eeServer",
             "transactionContextManagerObjectName",
             "connectionTrackerObjectName",

Modified: geronimo/trunk/modules/j2ee-builder/src/test/org/apache/geronimo/j2ee/deployment/EARConfigBuilderTest.java
==============================================================================
--- geronimo/trunk/modules/j2ee-builder/src/test/org/apache/geronimo/j2ee/deployment/EARConfigBuilderTest.java	(original)
+++ geronimo/trunk/modules/j2ee-builder/src/test/org/apache/geronimo/j2ee/deployment/EARConfigBuilderTest.java	Sun Nov  7 09:26:43 2004
@@ -18,6 +18,7 @@
 package org.apache.geronimo.j2ee.deployment;
 
 import java.io.File;
+import java.net.URI;
 import java.util.jar.JarFile;
 import javax.management.ObjectName;
 
@@ -48,6 +49,11 @@
     private static final ObjectName connectionTrackerObjectName = JMXUtil.getObjectName(j2eeServerName + ":type=ConnectionTracker");
     private static final ObjectName transactionalTimerObjectName = JMXUtil.getObjectName(j2eeServerName + ":type=ThreadPooledTimer,name=TransactionalThreaPooledTimer");
     private static final ObjectName nonTransactionalTimerObjectName = JMXUtil.getObjectName(j2eeServerName + ":type=ThreadPooledTimer,name=NonTransactionalThreaPooledTimer");
+    private URI defaultParentId;
+
+    protected void setUp() throws Exception {
+        defaultParentId = new URI("org/apache/geronimo/Server");
+    }
 
     public static Test suite() throws Exception {
         TestSuite inner = new TestSuite(EARConfigBuilderTest.class);
@@ -201,7 +207,7 @@
     }
 
     public void testBuildConfiguration() throws Exception {
-        EARConfigBuilder configBuilder = new EARConfigBuilder(j2eeServer, transactionManagerObjectName, connectionTrackerObjectName, transactionalTimerObjectName, nonTransactionalTimerObjectName, null, ejbConfigBuilder, null, webConfigBuilder, connectorConfigBuilder, resourceReferenceBuilder, appClientConfigBuilder, null);
+        EARConfigBuilder configBuilder = new EARConfigBuilder(defaultParentId, j2eeServer, transactionManagerObjectName, connectionTrackerObjectName, transactionalTimerObjectName, nonTransactionalTimerObjectName, null, ejbConfigBuilder, null, webConfigBuilder, connectorConfigBuilder, resourceReferenceBuilder, appClientConfigBuilder, null);
 
         File tempDir = null;
         try {
@@ -214,7 +220,7 @@
     }
 
     public void testNoEJBDeployer() throws Exception {
-        EARConfigBuilder configBuilder = new EARConfigBuilder(j2eeServer, transactionManagerObjectName, connectionTrackerObjectName, transactionalTimerObjectName, nonTransactionalTimerObjectName, null, null, null, webConfigBuilder, connectorConfigBuilder, resourceReferenceBuilder, appClientConfigBuilder, null);
+        EARConfigBuilder configBuilder = new EARConfigBuilder(defaultParentId, j2eeServer, transactionManagerObjectName, connectionTrackerObjectName, transactionalTimerObjectName, nonTransactionalTimerObjectName, null, null, null, webConfigBuilder, connectorConfigBuilder, resourceReferenceBuilder, appClientConfigBuilder, null);
 
         File tempDir = null;
         try {
@@ -230,7 +236,7 @@
     }
 
     public void testNoWARDeployer() throws Exception {
-        EARConfigBuilder configBuilder = new EARConfigBuilder(j2eeServer, transactionManagerObjectName, connectionTrackerObjectName, transactionalTimerObjectName, nonTransactionalTimerObjectName, null, ejbConfigBuilder, null, null, connectorConfigBuilder, resourceReferenceBuilder, appClientConfigBuilder, null);
+        EARConfigBuilder configBuilder = new EARConfigBuilder(defaultParentId, j2eeServer, transactionManagerObjectName, connectionTrackerObjectName, transactionalTimerObjectName, nonTransactionalTimerObjectName, null, ejbConfigBuilder, null, null, connectorConfigBuilder, resourceReferenceBuilder, appClientConfigBuilder, null);
 
         File tempDir = null;
         try {
@@ -246,7 +252,7 @@
     }
 
     public void testNoConnectorDeployer() throws Exception {
-        EARConfigBuilder configBuilder = new EARConfigBuilder(j2eeServer, transactionManagerObjectName, connectionTrackerObjectName, transactionalTimerObjectName, nonTransactionalTimerObjectName, null, ejbConfigBuilder, null, webConfigBuilder, null, resourceReferenceBuilder, appClientConfigBuilder, null);
+        EARConfigBuilder configBuilder = new EARConfigBuilder(defaultParentId, j2eeServer, transactionManagerObjectName, connectionTrackerObjectName, transactionalTimerObjectName, nonTransactionalTimerObjectName, null, ejbConfigBuilder, null, webConfigBuilder, null, resourceReferenceBuilder, appClientConfigBuilder, null);
 
         File tempDir = null;
         try {

Modified: geronimo/trunk/modules/jetty-builder/src/java/org/apache/geronimo/jetty/deployment/JettyModuleBuilder.java
==============================================================================
--- geronimo/trunk/modules/jetty-builder/src/java/org/apache/geronimo/jetty/deployment/JettyModuleBuilder.java	(original)
+++ geronimo/trunk/modules/jetty-builder/src/java/org/apache/geronimo/jetty/deployment/JettyModuleBuilder.java	Sun Nov  7 09:26:43 2004
@@ -28,8 +28,8 @@
 import java.util.LinkedList;
 import java.util.jar.JarFile;
 import java.util.zip.ZipEntry;
-import javax.management.ObjectName;
 import javax.management.MalformedObjectNameException;
+import javax.management.ObjectName;
 import javax.transaction.UserTransaction;
 
 import org.apache.geronimo.deployment.DeploymentException;
@@ -45,8 +45,6 @@
 import org.apache.geronimo.j2ee.j2eeobjectnames.J2eeContext;
 import org.apache.geronimo.j2ee.j2eeobjectnames.J2eeContextImpl;
 import org.apache.geronimo.j2ee.j2eeobjectnames.NameFactory;
-import org.apache.geronimo.j2ee.j2eeobjectnames.J2eeContext;
-import org.apache.geronimo.j2ee.j2eeobjectnames.NameFactory;
 import org.apache.geronimo.jetty.JettyClassLoader;
 import org.apache.geronimo.jetty.JettyWebAppContext;
 import org.apache.geronimo.jetty.JettyWebAppJACCContext;
@@ -85,7 +83,11 @@
  * @version $Rev$ $Date$
  */
 public class JettyModuleBuilder implements ModuleBuilder {
-    private static final String PARENT_ID = "org/apache/geronimo/Server";
+    private final URI defaultParentId;
+
+    public JettyModuleBuilder(URI defaultParentId) {
+        this.defaultParentId = defaultParentId;
+    }
 
     public Module createModule(File plan, JarFile moduleFile) throws DeploymentException {
         return createModule(plan, moduleFile, "war", null, true);
@@ -142,6 +144,8 @@
             } catch (URISyntaxException e) {
                 throw new DeploymentException("Invalid parentId " + jettyWebApp.getParentId(), e);
             }
+        } else {
+            parentId = defaultParentId;
         }
 
         WebModule module = new WebModule(standAlone, configId, parentId, moduleFile, targetPath, webApp, jettyWebApp, specDD);
@@ -209,7 +213,7 @@
         JettyWebAppType jettyWebApp = JettyWebAppType.Factory.newInstance();
 
         // set the parentId, configId and context root
-        jettyWebApp.setParentId(PARENT_ID);
+        jettyWebApp.setParentId(defaultParentId.toString());
         if (null != webApp.getId()) {
             id = webApp.getId();
         }
@@ -508,9 +512,12 @@
     public static final GBeanInfo GBEAN_INFO;
 
     static {
-        GBeanInfoBuilder infoFactory = new GBeanInfoBuilder(JettyModuleBuilder.class);
-        infoFactory.addInterface(ModuleBuilder.class);
-        GBEAN_INFO = infoFactory.getBeanInfo();
+        GBeanInfoBuilder infoBuilder = new GBeanInfoBuilder(JettyModuleBuilder.class);
+        infoBuilder.addAttribute("defaultParentId", URI.class, true);
+        infoBuilder.addInterface(ModuleBuilder.class);
+
+        infoBuilder.setConstructor(new String[] {"defaultParentId"});
+        GBEAN_INFO = infoBuilder.getBeanInfo();
     }
 
     public static GBeanInfo getGBeanInfo() {

Modified: geronimo/trunk/modules/jetty-builder/src/test/org/apache/geronimo/jetty/deployment/PlanParsingTest.java
==============================================================================
--- geronimo/trunk/modules/jetty-builder/src/test/org/apache/geronimo/jetty/deployment/PlanParsingTest.java	(original)
+++ geronimo/trunk/modules/jetty-builder/src/test/org/apache/geronimo/jetty/deployment/PlanParsingTest.java	Sun Nov  7 09:26:43 2004
@@ -11,7 +11,7 @@
 /**
  */
 public class PlanParsingTest extends TestCase {
-    private JettyModuleBuilder builder = new JettyModuleBuilder();
+    private JettyModuleBuilder builder = new JettyModuleBuilder(null);
     private File basedir = new File(System.getProperty("basedir", "."));
 
     public void testResourceRef() throws Exception {

Mime
View raw message