geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From djen...@apache.org
Subject svn commit: r264657 - in /geronimo/trunk: applications/console-standard/src/java/org/apache/geronimo/console/jmsmanager/handlers/ modules/client-builder/src/java/org/apache/geronimo/client/builder/ modules/connector-builder/src/java/org/apache/geronimo...
Date Mon, 29 Aug 2005 23:33:07 GMT
Author: djencks
Date: Mon Aug 29 16:32:47 2005
New Revision: 264657

URL: http://svn.apache.org/viewcvs?rev=264657&view=rev
Log:
GERONIMO-947 step 1. Replace URI parentId with URI[]

Modified:
    geronimo/trunk/applications/console-standard/src/java/org/apache/geronimo/console/jmsmanager/handlers/CreateDestinationHandler.java
    geronimo/trunk/modules/client-builder/src/java/org/apache/geronimo/client/builder/AppClientModuleBuilder.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/ConnectorModuleBuilderTest.java
    geronimo/trunk/modules/deployment/src/java/org/apache/geronimo/deployment/DeploymentContext.java
    geronimo/trunk/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/ApplicationInfo.java
    geronimo/trunk/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/AppClientModule.java
    geronimo/trunk/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/ConnectorModule.java
    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/EARContext.java
    geronimo/trunk/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/EJBModule.java
    geronimo/trunk/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/Module.java
    geronimo/trunk/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/WebModule.java
    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/MockWARConfigBuilder.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/JettyModuleBuilderTest.java
    geronimo/trunk/modules/jetty-builder/src/test/org/apache/geronimo/jetty/deployment/PlanParsingTest.java
    geronimo/trunk/modules/kernel/src/java/org/apache/geronimo/kernel/config/Configuration.java
    geronimo/trunk/modules/kernel/src/java/org/apache/geronimo/kernel/config/ConfigurationData.java
    geronimo/trunk/modules/kernel/src/java/org/apache/geronimo/kernel/config/ConfigurationManagerImpl.java
    geronimo/trunk/modules/service-builder/src/java/org/apache/geronimo/deployment/service/ServiceConfigBuilder.java
    geronimo/trunk/modules/service-builder/src/test/org/apache/geronimo/deployment/service/ServiceConfigBuilderTest.java
    geronimo/trunk/modules/servicemix-builder/src/java/org/apache/geronimo/servicemix/deployment/ServiceMixConfigBuilder.java
    geronimo/trunk/modules/spring-builder/src/java/org/apache/geronimo/spring/deployment/SPRConfigBuilder.java
    geronimo/trunk/modules/spring-builder/src/java/org/apache/geronimo/spring/deployment/SPRContext.java
    geronimo/trunk/modules/system/src/java/org/apache/geronimo/system/configuration/ExecutableConfigurationUtil.java
    geronimo/trunk/modules/tomcat-builder/src/java/org/apache/geronimo/tomcat/deployment/TomcatModuleBuilder.java
    geronimo/trunk/modules/tomcat-builder/src/test/org/apache/geronimo/tomcat/deployment/TomcatModuleBuilderTest.java

Modified: geronimo/trunk/applications/console-standard/src/java/org/apache/geronimo/console/jmsmanager/handlers/CreateDestinationHandler.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/applications/console-standard/src/java/org/apache/geronimo/console/jmsmanager/handlers/CreateDestinationHandler.java?rev=264657&r1=264656&r2=264657&view=diff
==============================================================================
--- geronimo/trunk/applications/console-standard/src/java/org/apache/geronimo/console/jmsmanager/handlers/CreateDestinationHandler.java (original)
+++ geronimo/trunk/applications/console-standard/src/java/org/apache/geronimo/console/jmsmanager/handlers/CreateDestinationHandler.java Mon Aug 29 16:32:47 2005
@@ -53,8 +53,7 @@
     protected static Log log = LogFactory
             .getLog(CreateDestinationHandler.class);
 
-    private static final URI parentId = URI
-            .create("org/apache/geronimo/Console");
+    private static final URI[] parentId = new URI[] {URI.create("org/apache/geronimo/Console")};
 
     static final GBeanInfo QUEUE_INFO;
 

Modified: geronimo/trunk/modules/client-builder/src/java/org/apache/geronimo/client/builder/AppClientModuleBuilder.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/client-builder/src/java/org/apache/geronimo/client/builder/AppClientModuleBuilder.java?rev=264657&r1=264656&r2=264657&view=diff
==============================================================================
--- 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 Mon Aug 29 16:32:47 2005
@@ -85,8 +85,8 @@
  */
 public class AppClientModuleBuilder implements ModuleBuilder {
 
-    private final URI defaultClientParentId;
-    private final URI defaultServerParentId;
+    private final URI[] defaultClientParentId;
+    private final URI[] defaultServerParentId;
     private final ObjectName corbaGBeanObjectName;
     private final Kernel kernel;
     private final Repository repository;
@@ -100,8 +100,8 @@
     private final ResourceReferenceBuilder resourceReferenceBuilder;
     private final ServiceReferenceBuilder serviceReferenceBuilder;
 
-    public AppClientModuleBuilder(URI defaultClientParentId,
-                                  URI defaultServerParentId,
+    public AppClientModuleBuilder(URI[] defaultClientParentId,
+                                  URI[] defaultServerParentId,
                                   ObjectName transactionContextManagerObjectName,
                                   ObjectName connectionTrackerObjectName,
                                   ObjectName corbaGBeanObjectName,
@@ -174,13 +174,9 @@
             throw new DeploymentException("Invalid configId " + gerAppClient.getConfigId(), e);
         }
 
-        URI parentId = null;
+        URI[] parentId = null;
         if (gerAppClient.isSetParentId()) {
-            try {
-                parentId = new URI(gerAppClient.getParentId());
-            } catch (URISyntaxException e) {
-                throw new DeploymentException("Invalid parentId " + gerAppClient.getParentId(), e);
-            }
+                parentId = getParentIds(gerAppClient.getParentId());
         } else {
             parentId = defaultServerParentId;
         }
@@ -340,9 +336,9 @@
                 try {
 
                     URI clientConfigId = URI.create(geronimoAppClient.getClientConfigId());
-                    URI clientParentId;
+                    URI[] clientParentId;
                     if (geronimoAppClient.isSetClientParentId()) {
-                        clientParentId = URI.create(geronimoAppClient.getClientParentId());
+                        clientParentId = getParentIds(geronimoAppClient.getClientParentId());
                     } else {
                         clientParentId = defaultClientParentId;
                     }
@@ -534,6 +530,22 @@
         }
     }
 
+    private URI[] getParentIds(String parentIdString) throws DeploymentException {
+        URI[] clientParentId;
+        try {
+             String[] parentIdStrings = parentIdString.split(",");
+             clientParentId = new URI[parentIdStrings.length];
+             for (int i = 0; i < parentIdStrings.length; i++) {
+                 String idString = parentIdStrings[i];
+                 URI parent = new URI(idString);
+                 clientParentId[i] = parent;
+             }
+         } catch (URISyntaxException e) {
+             throw new DeploymentException("Invalid parentId " + parentIdString, e);
+         }
+        return clientParentId;
+    }
+
     public void addManifestClassPath(DeploymentContext deploymentContext, JarFile earFile, JarFile jarFile, URI jarFileLocation) throws DeploymentException {
         Manifest manifest = null;
         try {
@@ -622,8 +634,8 @@
 
     static {
         GBeanInfoBuilder infoBuilder = new GBeanInfoBuilder(AppClientModuleBuilder.class, NameFactory.MODULE_BUILDER);
-        infoBuilder.addAttribute("defaultClientParentId", URI.class, true);
-        infoBuilder.addAttribute("defaultServerParentId", URI.class, true);
+        infoBuilder.addAttribute("defaultClientParentId", URI[].class, true, true);
+        infoBuilder.addAttribute("defaultServerParentId", URI[].class, true, true);
         infoBuilder.addAttribute("transactionContextManagerObjectName", ObjectName.class, true);
         infoBuilder.addAttribute("connectionTrackerObjectName", ObjectName.class, true);
         infoBuilder.addAttribute("corbaGBeanObjectName", ObjectName.class, true);

Modified: geronimo/trunk/modules/connector-builder/src/java/org/apache/geronimo/connector/deployment/ConnectorModuleBuilder.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/connector-builder/src/java/org/apache/geronimo/connector/deployment/ConnectorModuleBuilder.java?rev=264657&r1=264656&r2=264657&view=diff
==============================================================================
--- 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 Mon Aug 29 16:32:47 2005
@@ -32,21 +32,18 @@
 import java.util.Set;
 import java.util.jar.JarFile;
 import java.util.zip.ZipEntry;
-
 import javax.management.MalformedObjectNameException;
 import javax.management.ObjectName;
 import javax.naming.Reference;
 
 import org.apache.geronimo.common.DeploymentException;
 import org.apache.geronimo.common.propertyeditor.PropertyEditors;
-import org.apache.geronimo.connector.ActivationSpecWrapper;
 import org.apache.geronimo.connector.ActivationSpecWrapperGBean;
 import org.apache.geronimo.connector.AdminObjectWrapper;
 import org.apache.geronimo.connector.AdminObjectWrapperGBean;
 import org.apache.geronimo.connector.JCAResourceImplGBean;
 import org.apache.geronimo.connector.ResourceAdapterImplGBean;
 import org.apache.geronimo.connector.ResourceAdapterModuleImplGBean;
-import org.apache.geronimo.connector.ResourceAdapterWrapper;
 import org.apache.geronimo.connector.ResourceAdapterWrapperGBean;
 import org.apache.geronimo.connector.outbound.JCAConnectionFactoryImplGBean;
 import org.apache.geronimo.connector.outbound.ManagedConnectionFactoryWrapper;
@@ -92,7 +89,6 @@
 import org.apache.geronimo.xbeans.geronimo.GerConnectionmanagerType;
 import org.apache.geronimo.xbeans.geronimo.GerConnectorDocument;
 import org.apache.geronimo.xbeans.geronimo.GerConnectorType;
-import org.apache.geronimo.xbeans.geronimo.GerCredentialInterfaceType;
 import org.apache.geronimo.xbeans.geronimo.GerPartitionedpoolType;
 import org.apache.geronimo.xbeans.geronimo.GerResourceadapterType;
 import org.apache.geronimo.xbeans.geronimo.GerSinglepoolType;
@@ -118,11 +114,11 @@
     private final int defaultIdleTimeoutMinutes;
     private final boolean defaultXATransactionCaching;
     private final boolean defaultXAThreadCaching;
-    private final URI defaultParentId;
+    private final URI[] defaultParentId;
     private final Repository repository;
     private final Kernel kernel;
 
-    public ConnectorModuleBuilder(URI defaultParentId,
+    public ConnectorModuleBuilder(URI[] defaultParentId,
                                   int defaultMaxSize,
                                   int defaultMinSize,
                                   int defaultBlockingTimeoutMilliseconds,
@@ -223,17 +219,25 @@
             throw new DeploymentException("Invalid configId " + gerConnector.getConfigId(), e);
         }
 
-        URI parentId = null;
+        URI[] parentId = null;
         if (gerConnector.isSetParentId()) {
+            String parentIdString = gerConnector.getParentId();
             try {
-                parentId = new URI(gerConnector.getParentId());
-            } catch (URISyntaxException e) {
-                throw new DeploymentException("Invalid parentId " + gerConnector.getParentId(), e);
-            }
+                 String[] parentIdStrings = parentIdString.split(",");
+                 parentId = new URI[parentIdStrings.length];
+                 for (int i = 0; i < parentIdStrings.length; i++) {
+                     String idString = parentIdStrings[i];
+                     URI parent = new URI(idString);
+                     parentId[i] = parent;
+                 }
+             } catch (URISyntaxException e) {
+                 throw new DeploymentException("Invalid parentId " + gerConnector.getParentId(), e);
+             }
         } else {
             parentId = defaultParentId;
         }
-
+        assert parentId != null;
+        assert parentId.length >0;
         return new ConnectorModule(standAlone, configId, parentId, moduleFile, targetPath, connector, gerConnector, specDD);
     }
 
@@ -850,7 +854,7 @@
     static {
         GBeanInfoBuilder infoBuilder = new GBeanInfoBuilder(ConnectorModuleBuilder.class, NameFactory.MODULE_BUILDER);
 
-        infoBuilder.addAttribute("defaultParentId", URI.class, true);
+        infoBuilder.addAttribute("defaultParentId", URI[].class, true);
         infoBuilder.addAttribute("defaultMaxSize", int.class, true);
         infoBuilder.addAttribute("defaultMinSize", int.class, true);
         infoBuilder.addAttribute("defaultBlockingTimeoutMilliseconds", int.class, true);

Modified: geronimo/trunk/modules/connector-builder/src/test/org/apache/geronimo/connector/deployment/ConnectorModuleBuilderTest.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/connector-builder/src/test/org/apache/geronimo/connector/deployment/ConnectorModuleBuilderTest.java?rev=264657&r1=264656&r2=264657&view=diff
==============================================================================
--- geronimo/trunk/modules/connector-builder/src/test/org/apache/geronimo/connector/deployment/ConnectorModuleBuilderTest.java (original)
+++ geronimo/trunk/modules/connector-builder/src/test/org/apache/geronimo/connector/deployment/ConnectorModuleBuilderTest.java Mon Aug 29 16:32:47 2005
@@ -87,7 +87,7 @@
     private int defaultMinSize = 0;
     private int defaultBlockingTimeoutMilliseconds = 5000;
     private int defaultidleTimeoutMinutes = 15;
-    private URI defaultParentId;
+    private URI[] defaultParentId;
     private Repository repository = new Repository() {
 
                 public boolean hasURI(URI uri) {
@@ -393,7 +393,7 @@
             kernel.startGBean(configurationManagerName);
             ConfigurationManager configurationManager = (ConfigurationManager) kernel.getProxyManager().createProxy(configurationManagerName, ConfigurationManager.class);
 
-            ObjectName baseConfigName = configurationManager.load(defaultParentId);
+            ObjectName baseConfigName = configurationManager.load(defaultParentId[0]);
             kernel.startGBean(baseConfigName);
 
             ObjectName serverInfoObjectName = ObjectName.getInstance(j2eeContext.getJ2eeDomainName() + ":name=ServerInfo");
@@ -556,7 +556,7 @@
 
     protected void setUp() throws Exception {
         configurationManagerName = new ObjectName(":j2eeType=ConfigurationManager,name=Basic");
-        defaultParentId = new URI("org/apache/geronimo/Server");
+        defaultParentId = new URI[] {new URI("org/apache/geronimo/Server")};
     }
 
     private abstract class InstallAction {

Modified: geronimo/trunk/modules/deployment/src/java/org/apache/geronimo/deployment/DeploymentContext.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/deployment/src/java/org/apache/geronimo/deployment/DeploymentContext.java?rev=264657&r1=264656&r2=264657&view=diff
==============================================================================
--- geronimo/trunk/modules/deployment/src/java/org/apache/geronimo/deployment/DeploymentContext.java (original)
+++ geronimo/trunk/modules/deployment/src/java/org/apache/geronimo/deployment/DeploymentContext.java Mon Aug 29 16:32:47 2005
@@ -36,6 +36,8 @@
 import java.util.Set;
 import java.util.StringTokenizer;
 import java.util.Arrays;
+import java.util.HashSet;
+import java.util.ArrayList;
 import java.util.jar.Attributes;
 import java.util.jar.JarFile;
 import java.util.jar.Manifest;
@@ -68,15 +70,15 @@
     private final File baseDir;
     private final URI baseUri;
     private final byte[] buffer = new byte[4096];
-    private final List loadedAncestors;
+    private final List loadedAncestors = new ArrayList();
     private final LinkedList startedAncestors;
     private final ClassLoader parentCL;
 
-    public DeploymentContext(File baseDir, URI configId, ConfigurationModuleType type, URI parentID, Kernel kernel) throws MalformedObjectNameException, DeploymentException {
+    public DeploymentContext(File baseDir, URI configId, ConfigurationModuleType type, URI[] parentID, Kernel kernel) throws MalformedObjectNameException, DeploymentException {
         this(baseDir, configId, type, parentID, null, null, kernel);
     }
 
-    public DeploymentContext(File baseDir, URI configId, ConfigurationModuleType type, URI parentId, String domain, String server, Kernel kernel) throws MalformedObjectNameException, DeploymentException {
+    public DeploymentContext(File baseDir, URI configId, ConfigurationModuleType type, URI[] parentId, String domain, String server, Kernel kernel) throws MalformedObjectNameException, DeploymentException {
         assert baseDir != null: "baseDir is null";
         assert configId != null: "configID is null";
         assert type != null: "type is null";
@@ -97,11 +99,15 @@
         configurationData.setModuleType(type);
         configurationData.setParentId(parentId);
 
-        if (kernel != null && parentId != null) {
+        if (kernel != null && parentId != null && parentId.length > 0) {
             ConfigurationManager configurationManager = ConfigurationUtil.getConfigurationManager(kernel);
-            ObjectName parentName = Configuration.getConfigurationObjectName(parentId);
+
+            ObjectName parentName = Configuration.getConfigurationObjectName(parentId[0]);
             try {
-                loadedAncestors = configurationManager.loadRecursive(parentId);
+                for (int i = 0; i < parentId.length; i++) {
+                    URI uri = parentId[i];
+                    loadedAncestors.addAll(configurationManager.loadRecursive(uri));
+                }
             } catch (Exception e) {
                 throw new DeploymentException("Unable to load parents", e);
             } finally {
@@ -118,14 +124,7 @@
             try {
                 startedAncestors = new LinkedList();
                 ObjectName ancestorName = parentName;
-                while (ancestorName != null && !isRunning(kernel, ancestorName)) {
-                    startedAncestors.addFirst(ancestorName);
-                    URI pattern = (URI) kernel.getGBeanData(ancestorName).getAttribute("parentId");
-                    if (pattern == null) {
-                        break;
-                    }
-                    ancestorName = Configuration.getConfigurationObjectName(pattern);
-                }
+                findToStart(ancestorName, kernel);
                 //we've found what we need to start, now start them.
                 for (Iterator iterator = startedAncestors.iterator(); iterator.hasNext();) {
                     ObjectName objectName = (ObjectName) iterator.next();
@@ -147,7 +146,6 @@
                 throw new DeploymentException(e);
             }
         } else {
-            loadedAncestors = null;
             startedAncestors = null;
             // no explicit parent set, so use the class loader of this class as
             // the parent... this class should be in the root geronimo classloader,
@@ -164,6 +162,21 @@
         configurationData.setServer(server);
     }
 
+    private void findToStart(ObjectName ancestorName, Kernel kernel) throws Exception {
+        if (ancestorName != null && !isRunning(kernel, ancestorName)) {
+            startedAncestors.addFirst(ancestorName);
+            URI[] patterns = (URI[]) kernel.getGBeanData(ancestorName).getAttribute("parentId");
+            if (patterns == null) {
+                return;
+            }
+            for (int i = 0; i < patterns.length; i++) {
+                URI pattern = patterns[i];
+                ancestorName = Configuration.getConfigurationObjectName(pattern);
+                findToStart(ancestorName, kernel);
+            }
+        }
+    }
+
     private static boolean isRunning(Kernel kernel, ObjectName name) throws Exception {
         return State.RUNNING_INDEX == kernel.getGBeanState(name);
     }
@@ -493,11 +506,16 @@
         config.setAttribute("domain", configurationData.getDomain());
         config.setAttribute("server", configurationData.getServer());
 
-        URI parentId = configurationData.getParentId();
+        URI[] parentId = configurationData.getParentId();
         if (parentId != null) {
             config.setAttribute("parentId", parentId);
-            ObjectName parentName = Configuration.getConfigurationObjectName(parentId);
-            config.setReferencePattern("Parent", parentName);
+            Set parentNames = new HashSet();
+            for (int i = 0; i < parentId.length; i++) {
+                URI uri = parentId[i];
+                ObjectName parentName = Configuration.getConfigurationObjectName(uri);
+                parentNames.add(parentName);
+            }
+            config.setReferencePatterns("Parent", parentNames);
         }
 
         config.setAttribute("gBeanState", Configuration.storeGBeans(gbeans.getGBeans()));

Modified: geronimo/trunk/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/ApplicationInfo.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/ApplicationInfo.java?rev=264657&r1=264656&r2=264657&view=diff
==============================================================================
--- geronimo/trunk/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/ApplicationInfo.java (original)
+++ geronimo/trunk/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/ApplicationInfo.java Mon Aug 29 16:32:47 2005
@@ -28,7 +28,7 @@
 public class ApplicationInfo {
     private ConfigurationModuleType type;
     private URI configId;
-    private URI parentId;
+    private URI[] parentId;
     private String applicationName;
     private XmlObject specDD;
     private XmlObject vendorDD;
@@ -39,7 +39,13 @@
     public ApplicationInfo() {
     }
 
-    public ApplicationInfo(ConfigurationModuleType type, URI configId, URI parentId, String applicationName, XmlObject specDD, XmlObject vendorDD, Set modules, Set moduleLocations, String originalSpecDD) {
+    public ApplicationInfo(ConfigurationModuleType type, URI configId, URI[] parentId, String applicationName, XmlObject specDD, XmlObject vendorDD, Set modules, Set moduleLocations, String originalSpecDD) {
+        assert type != null;
+        assert configId != null;
+        assert parentId != null;
+        assert modules != null;
+        assert moduleLocations != null;
+
         this.type = type;
         this.configId = configId;
         this.parentId = parentId;
@@ -67,11 +73,11 @@
         this.configId = configId;
     }
 
-    public URI getParentId() {
+    public URI[] getParentId() {
         return parentId;
     }
 
-    public void setParentId(URI parentId) {
+    public void setParentId(URI[] parentId) {
         this.parentId = parentId;
     }
 

Modified: geronimo/trunk/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/AppClientModule.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/AppClientModule.java?rev=264657&r1=264656&r2=264657&view=diff
==============================================================================
--- geronimo/trunk/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/AppClientModule.java (original)
+++ geronimo/trunk/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/AppClientModule.java Mon Aug 29 16:32:47 2005
@@ -34,7 +34,7 @@
     private JarFile earFile;
     private Collection resourceModules;
 
-    public AppClientModule(boolean standAlone, URI configId, URI parentId, JarFile moduleFile, String targetPath, XmlObject specDD, XmlObject vendorDD, String originalSpecDD) {
+    public AppClientModule(boolean standAlone, URI configId, URI[] parentId, JarFile moduleFile, String targetPath, XmlObject specDD, XmlObject vendorDD, String originalSpecDD) {
         super(standAlone, configId, parentId, moduleFile, targetPath, specDD, vendorDD, originalSpecDD);
     }
 

Modified: geronimo/trunk/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/ConnectorModule.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/ConnectorModule.java?rev=264657&r1=264656&r2=264657&view=diff
==============================================================================
--- geronimo/trunk/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/ConnectorModule.java (original)
+++ geronimo/trunk/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/ConnectorModule.java Mon Aug 29 16:32:47 2005
@@ -29,7 +29,7 @@
  * @version $Rev$ $Date$
  */
 public class ConnectorModule extends Module {
-    public ConnectorModule(boolean standAlone, URI configId, URI parentId, JarFile moduleFile, String targetPath, XmlObject specDD, XmlObject vendorDD, String originalSpecDD) {
+    public ConnectorModule(boolean standAlone, URI configId, URI[] parentId, JarFile moduleFile, String targetPath, XmlObject specDD, XmlObject vendorDD, String originalSpecDD) {
         super(standAlone, configId, parentId, moduleFile, targetPath, specDD, vendorDD, originalSpecDD);
     }
 

Modified: geronimo/trunk/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/EARConfigBuilder.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/EARConfigBuilder.java?rev=264657&r1=264656&r2=264657&view=diff
==============================================================================
--- 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 Mon Aug 29 16:32:47 2005
@@ -30,6 +30,7 @@
 import java.util.LinkedHashSet;
 import java.util.Map;
 import java.util.Set;
+import java.util.Arrays;
 import java.util.jar.JarFile;
 import java.util.zip.ZipEntry;
 import javax.management.MalformedObjectNameException;
@@ -83,7 +84,7 @@
     private final ResourceReferenceBuilder resourceReferenceBuilder;
     private final ServiceReferenceBuilder serviceReferenceBuilder;
 
-    private final URI defaultParentId;
+    private final URI[] defaultParentId;
     private final ObjectName transactionContextManagerObjectName;
     private final ObjectName connectionTrackerObjectName;
     private final ObjectName transactionalTimerObjectName;
@@ -91,7 +92,7 @@
     private final ObjectName corbaGBeanObjectName;
 
 
-    public EARConfigBuilder(URI defaultParentId, ObjectName transactionContextManagerObjectName, ObjectName connectionTrackerObjectName, ObjectName transactionalTimerObjectName, ObjectName nonTransactionalTimerObjectName, ObjectName corbaGBeanObjectName, Repository repository, ModuleBuilder ejbConfigBuilder, EJBReferenceBuilder ejbReferenceBuilder, ModuleBuilder webConfigBuilder, ModuleBuilder connectorConfigBuilder, ResourceReferenceBuilder resourceReferenceBuilder, ModuleBuilder appClientConfigBuilder, ServiceReferenceBuilder serviceReferenceBuilder, Kernel kernel) {
+    public EARConfigBuilder(URI[] defaultParentId, ObjectName transactionContextManagerObjectName, ObjectName connectionTrackerObjectName, ObjectName transactionalTimerObjectName, ObjectName nonTransactionalTimerObjectName, ObjectName corbaGBeanObjectName, Repository repository, ModuleBuilder ejbConfigBuilder, EJBReferenceBuilder ejbReferenceBuilder, ModuleBuilder webConfigBuilder, ModuleBuilder connectorConfigBuilder, ResourceReferenceBuilder resourceReferenceBuilder, ModuleBuilder appClientConfigBuilder, ServiceReferenceBuilder serviceReferenceBuilder, Kernel kernel) {
         this.kernel = kernel;
         this.repository = repository;
         this.defaultParentId = defaultParentId;
@@ -220,13 +221,20 @@
             throw new DeploymentException("Invalid configId " + gerApplication.getConfigId(), e);
         }
 
-        URI parentId = null;
+        URI[] parentId = null;
         if (gerApplication.isSetParentId()) {
+            String parentIdString = gerApplication.getParentId();
             try {
-                parentId = new URI(gerApplication.getParentId());
-            } catch (URISyntaxException e) {
-                throw new DeploymentException("Invalid parentId " + gerApplication.getParentId(), e);
-            }
+                 String[] parentIdStrings = parentIdString.split(",");
+                 parentId = new URI[parentIdStrings.length];
+                 for (int i = 0; i < parentIdStrings.length; i++) {
+                     String idString = parentIdStrings[i];
+                     URI parent = new URI(idString);
+                     parentId[i] = parent;
+                 }
+             } catch (URISyntaxException e) {
+                 throw new DeploymentException("Invalid parentId " + gerApplication.getParentId(), e);
+             }
         } else {
             parentId = defaultParentId;
         }
@@ -273,8 +281,7 @@
         // construct the empty geronimo-application.xml
         GerApplicationType gerApplication = GerApplicationType.Factory.newInstance();
 
-        // set the parentId and configId
-        gerApplication.setParentId(defaultParentId.toString());
+        // set the configId
         String id = application.getId();
         if (id == null) {
             File fileName = new File(module.getName());
@@ -699,7 +706,7 @@
 
     static {
         GBeanInfoBuilder infoFactory = new GBeanInfoBuilder(EARConfigBuilder.class, NameFactory.CONFIG_BUILDER);
-        infoFactory.addAttribute("defaultParentId", URI.class, true);
+        infoFactory.addAttribute("defaultParentId", URI[].class, true, true);
         infoFactory.addAttribute("transactionContextManagerObjectName", ObjectName.class, true);
         infoFactory.addAttribute("connectionTrackerObjectName", ObjectName.class, true);
         infoFactory.addAttribute("transactionalTimerObjectName", ObjectName.class, true);

Modified: geronimo/trunk/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/EARContext.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/EARContext.java?rev=264657&r1=264656&r2=264657&view=diff
==============================================================================
--- geronimo/trunk/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/EARContext.java (original)
+++ geronimo/trunk/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/EARContext.java Mon Aug 29 16:32:47 2005
@@ -55,7 +55,7 @@
     private ObjectName jaccManagerName;
     private SecurityConfiguration securityConfiguration;
 
-    public EARContext(File baseDir, URI id, ConfigurationModuleType moduleType, URI parentID, Kernel kernel, String j2eeApplicationName, ObjectName transactionContextManagerObjectName, ObjectName connectionTrackerObjectName, ObjectName transactedTimerName, ObjectName nonTransactedTimerName, ObjectName corbaGBeanObjectName, RefContext refContext) throws MalformedObjectNameException, DeploymentException {
+    public EARContext(File baseDir, URI id, ConfigurationModuleType moduleType, URI[] parentID, Kernel kernel, String j2eeApplicationName, ObjectName transactionContextManagerObjectName, ObjectName connectionTrackerObjectName, ObjectName transactedTimerName, ObjectName nonTransactedTimerName, ObjectName corbaGBeanObjectName, RefContext refContext) throws MalformedObjectNameException, DeploymentException {
         super(baseDir, id, moduleType, parentID, kernel);
         j2eeContext = new J2eeContextImpl(getDomain(), getServer(), j2eeApplicationName == null ? NameFactory.NULL : j2eeApplicationName, NameFactory.J2EE_MODULE, NameFactory.NULL, null, null);
         domainObjectName = NameFactory.getDomainName(null, j2eeContext);

Modified: geronimo/trunk/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/EJBModule.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/EJBModule.java?rev=264657&r1=264656&r2=264657&view=diff
==============================================================================
--- geronimo/trunk/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/EJBModule.java (original)
+++ geronimo/trunk/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/EJBModule.java Mon Aug 29 16:32:47 2005
@@ -29,7 +29,7 @@
  * @version $Rev$ $Date$
  */
 public class EJBModule extends Module {
-    public EJBModule(boolean standAlone, URI configId, URI parentId, JarFile moduleFile, String targetPath, XmlObject specDD, XmlObject vendorDD, String originalSpecDD) {
+    public EJBModule(boolean standAlone, URI configId, URI[] parentId, JarFile moduleFile, String targetPath, XmlObject specDD, XmlObject vendorDD, String originalSpecDD) {
         super(standAlone, configId, parentId, moduleFile, targetPath, specDD, vendorDD, originalSpecDD);
     }
 

Modified: geronimo/trunk/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/Module.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/Module.java?rev=264657&r1=264656&r2=264657&view=diff
==============================================================================
--- geronimo/trunk/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/Module.java (original)
+++ geronimo/trunk/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/Module.java Mon Aug 29 16:32:47 2005
@@ -34,7 +34,7 @@
     private final boolean standAlone;
     private final String name;
     private final URI configId;
-    private final URI parentId;
+    private final URI[] parentId;
     private final URI moduleURI;
     private final JarFile moduleFile;
     private final String targetPath;
@@ -45,7 +45,7 @@
 
     private URI uniqueModuleLocation;
 
-    protected Module(boolean standAlone, URI configId, URI parentId, JarFile moduleFile, String targetPath, XmlObject specDD, XmlObject vendorDD, String originalSpecDD) {
+    protected Module(boolean standAlone, URI configId, URI[] parentId, JarFile moduleFile, String targetPath, XmlObject specDD, XmlObject vendorDD, String originalSpecDD) {
         assert targetPath != null: "targetPath is null";
 
         this.standAlone = standAlone;
@@ -82,7 +82,7 @@
         return configId;
     }
 
-    public URI getParentId() {
+    public URI[] getParentId() {
         return parentId;
     }
 

Modified: geronimo/trunk/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/WebModule.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/WebModule.java?rev=264657&r1=264656&r2=264657&view=diff
==============================================================================
--- geronimo/trunk/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/WebModule.java (original)
+++ geronimo/trunk/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/WebModule.java Mon Aug 29 16:32:47 2005
@@ -33,20 +33,17 @@
 public class WebModule extends Module {
 
     private final LinkedHashSet webClassPath = new LinkedHashSet();
-    private String contextRoot;
+    private final String contextRoot;
     private final Map portMap;
 
-    public WebModule(boolean standAlone, URI configId, URI parentId, JarFile moduleFile, String targetPath, XmlObject specDD, XmlObject vendorDD, String originalSpecDD, Map portMap) {
+    public WebModule(boolean standAlone, URI configId, URI[] parentId, JarFile moduleFile, String targetPath, XmlObject specDD, XmlObject vendorDD, String originalSpecDD, String contextRoot, Map portMap) {
         super(standAlone, configId, parentId, moduleFile, targetPath, specDD, vendorDD, originalSpecDD);
+        this.contextRoot = contextRoot;
         this.portMap = portMap;
     }
 
     public String getContextRoot() {
         return contextRoot;
-    }
-
-    public void setContextRoot(String contextRoot) {
-        this.contextRoot = contextRoot;
     }
 
     public ConfigurationModuleType getType() {

Modified: geronimo/trunk/modules/j2ee-builder/src/test/org/apache/geronimo/j2ee/deployment/EARConfigBuilderTest.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/j2ee-builder/src/test/org/apache/geronimo/j2ee/deployment/EARConfigBuilderTest.java?rev=264657&r1=264656&r2=264657&view=diff
==============================================================================
--- 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 Mon Aug 29 16:32:47 2005
@@ -77,11 +77,12 @@
     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;
+    private URI[] defaultParentId;
+    private static String contextRoot = "test";
     private static final Map portMap = null;
 
     protected void setUp() throws Exception {
-        defaultParentId = new URI("org/apache/geronimo/Server");
+        defaultParentId = new URI[] {new URI("org/apache/geronimo/Server")};
     }
 
     public static Test suite() throws Exception {
@@ -90,9 +91,8 @@
             protected void setUp() throws Exception {
                 earFile = DeploymentUtil.createJarFile(new File(basedir, "target/test-ear14/test-ear.ear"));
                 ejbConfigBuilder.ejbModule = new EJBModule(false, null, null, null, "test-ejb-jar.jar", null, null, null);
-                webConfigBuilder.contextRoot = "test";
-                webConfigBuilder.webModule = new WebModule(false, null, null, null, "test-war.war", null, null, null, portMap);
-                webConfigBuilder.webModule.setContextRoot("test");
+                webConfigBuilder.contextRoot = contextRoot;
+                webConfigBuilder.webModule = new WebModule(false, null, null, null, "test-war.war", null, null, null, contextRoot, portMap);
                 connectorConfigBuilder.connectorModule = new ConnectorModule(false, null, null, null, "test-rar.rar", null, null, null);
             }
 
@@ -107,9 +107,8 @@
             protected void setUp() throws Exception {
                 earFile = DeploymentUtil.createJarFile(new File(basedir, "target/test-ear14/test-naked-ear.ear"));
                 ejbConfigBuilder.ejbModule = new EJBModule(false, null, null, null, "test-ejb-jar.jar", null, null, null);
-                webConfigBuilder.contextRoot = "test";
-                webConfigBuilder.webModule = new WebModule(false, null, null, null, "test-war.war", null, null, null, portMap);
-                webConfigBuilder.webModule.setContextRoot("test");
+                webConfigBuilder.contextRoot = contextRoot;
+                webConfigBuilder.webModule = new WebModule(false, null, null, null, "test-war.war", null, null, null, contextRoot, portMap);
                 connectorConfigBuilder.connectorModule = new ConnectorModule(false, null, null, null, "test-rar.rar", null, null, null);
             }
 
@@ -124,9 +123,8 @@
             protected void setUp() throws Exception {
                 earFile = DeploymentUtil.createJarFile(new File(basedir, "target/test-ear13/test-ear.ear"));
                 ejbConfigBuilder.ejbModule = new EJBModule(false, null, null, null, "test-ejb-jar.jar", null, null, null);
-                webConfigBuilder.contextRoot = "test";
-                webConfigBuilder.webModule = new WebModule(false, null, null, null, "test-war.war", null, null, null, portMap);
-                webConfigBuilder.webModule.setContextRoot("test");
+                webConfigBuilder.contextRoot = contextRoot;
+                webConfigBuilder.webModule = new WebModule(false, null, null, null, "test-war.war", null, null, null, contextRoot, portMap);
                 connectorConfigBuilder.connectorModule = new ConnectorModule(false, null, null, null, "test-rar.rar", null, null, null);
             }
 
@@ -141,9 +139,8 @@
             protected void setUp() throws Exception {
                 earFile = DeploymentUtil.createJarFile(new File(basedir, "target/test-ear13/test-naked-ear.ear"));
                 ejbConfigBuilder.ejbModule = new EJBModule(false, null, null, null, "test-ejb-jar.jar", null, null, null);
-                webConfigBuilder.contextRoot = "test";
-                webConfigBuilder.webModule = new WebModule(false, null, null, null, "test-war.war", null, null, null, portMap);
-                webConfigBuilder.webModule.setContextRoot("test");
+                webConfigBuilder.contextRoot = contextRoot;
+                webConfigBuilder.webModule = new WebModule(false, null, null, null, "test-war.war", null, null, null, contextRoot, portMap);
                 connectorConfigBuilder.connectorModule = new ConnectorModule(false, null, null, null, "test-rar.rar", null, null, null);
             }
 
@@ -158,9 +155,8 @@
             protected void setUp() throws Exception {
                 earFile = DeploymentUtil.createJarFile(new File(basedir, "target/test-unpacked-ear/full/"));
                 ejbConfigBuilder.ejbModule = new EJBModule(false, null, null, null, "test-ejb-jar.jar/", null, null, null);
-                webConfigBuilder.contextRoot = "test";
-                webConfigBuilder.webModule = new WebModule(false, null, null, null, "test-war.war/", null, null, null, portMap);
-                webConfigBuilder.webModule.setContextRoot("test");
+                webConfigBuilder.contextRoot = contextRoot;
+                webConfigBuilder.webModule = new WebModule(false, null, null, null, "test-war.war/", null, null, null, contextRoot, portMap);
                 connectorConfigBuilder.connectorModule = new ConnectorModule(false, null, null, null, "test-rar.rar", null, null, null);
             }
 
@@ -175,9 +171,8 @@
             protected void setUp() throws Exception {
                 earFile = DeploymentUtil.createJarFile(new File(basedir, "target/test-unpacked-ear/naked/"));
                 ejbConfigBuilder.ejbModule = new EJBModule(false, null, null, null, "test-ejb-jar.jar/", null, null, null);
-                webConfigBuilder.contextRoot = "test";
-                webConfigBuilder.webModule = new WebModule(false, null, null, null, "test-war.war", null, null, null, portMap);
-                webConfigBuilder.webModule.setContextRoot("test");
+                webConfigBuilder.contextRoot = contextRoot;
+                webConfigBuilder.webModule = new WebModule(false, null, null, null, "test-war.war", null, null, null, contextRoot, portMap);
                 connectorConfigBuilder.connectorModule = new ConnectorModule(false, null, null, null, "test-rar.rar", null, null, null);
             }
 
@@ -192,9 +187,8 @@
             protected void setUp() throws Exception {
                 earFile = DeploymentUtil.createJarFile(new File(basedir, "target/test-unpacked-ear/alt-dd/"));
                 ejbConfigBuilder.ejbModule = new EJBModule(false, null, null, null, "test-ejb-jar.jar/", null, null, null);
-                webConfigBuilder.contextRoot = "test";
-                webConfigBuilder.webModule = new WebModule(false, null, null, null, "test-war.war/", null, null, null, portMap);
-                webConfigBuilder.webModule.setContextRoot("test");
+                webConfigBuilder.contextRoot = contextRoot;
+                webConfigBuilder.webModule = new WebModule(false, null, null, null, "test-war.war/", null, null, null, contextRoot, portMap);
                 connectorConfigBuilder.connectorModule = new ConnectorModule(false, null, null, null, "test-rar.rar", null, null, null);
             }
 
@@ -209,9 +203,8 @@
             protected void setUp() throws Exception {
                 earFile = DeploymentUtil.createJarFile(new File(basedir, "target/test-unpacked-ear/alt-dd.ear"));
                 ejbConfigBuilder.ejbModule = new EJBModule(false, null, null, null, "test-ejb-jar.jar/", null, null, null);
-                webConfigBuilder.contextRoot = "test";
-                webConfigBuilder.webModule = new WebModule(false, null, null, null, "test-war.war/", null, null, null, portMap);
-                webConfigBuilder.webModule.setContextRoot("test");
+                webConfigBuilder.contextRoot = contextRoot;
+                webConfigBuilder.webModule = new WebModule(false, null, null, null, "test-war.war/", null, null, null, contextRoot, portMap);
                 connectorConfigBuilder.connectorModule = new ConnectorModule(false, null, null, null, "test-rar.rar", null, null, null);
             }
 

Modified: geronimo/trunk/modules/j2ee-builder/src/test/org/apache/geronimo/j2ee/deployment/MockWARConfigBuilder.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/j2ee-builder/src/test/org/apache/geronimo/j2ee/deployment/MockWARConfigBuilder.java?rev=264657&r1=264656&r2=264657&view=diff
==============================================================================
--- geronimo/trunk/modules/j2ee-builder/src/test/org/apache/geronimo/j2ee/deployment/MockWARConfigBuilder.java (original)
+++ geronimo/trunk/modules/j2ee-builder/src/test/org/apache/geronimo/j2ee/deployment/MockWARConfigBuilder.java Mon Aug 29 16:32:47 2005
@@ -38,11 +38,11 @@
     private Map portMap = null;
 
     public Module createModule(File plan, JarFile moduleFile) throws DeploymentException {
-        return new WebModule(true, null, null, moduleFile, "war", null, null, null, portMap);
+        return new WebModule(true, null, null, moduleFile, "war", null, null, null, contextRoot, portMap);
     }
 
     public Module createModule(Object plan, JarFile moduleFile, String targetPath, URL specDDUrl, URI earConfigId, Object moduleContextInfo) throws DeploymentException {
-        return new WebModule(false, null, null, moduleFile, targetPath, null, null, null, portMap);
+        return new WebModule(false, null, null, moduleFile, targetPath, null, null, null, contextRoot, portMap);
     }
 
     public void installModule(JarFile earFile, EARContext earContext, Module webModule) throws DeploymentException {

Modified: geronimo/trunk/modules/jetty-builder/src/java/org/apache/geronimo/jetty/deployment/JettyModuleBuilder.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/jetty-builder/src/java/org/apache/geronimo/jetty/deployment/JettyModuleBuilder.java?rev=264657&r1=264656&r2=264657&view=diff
==============================================================================
--- 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 Mon Aug 29 16:32:47 2005
@@ -131,7 +131,7 @@
  */
 public class JettyModuleBuilder implements ModuleBuilder {
     private final static Log log = LogFactory.getLog(JettyModuleBuilder.class);
-    private final URI defaultParentId;
+    private final URI[] defaultParentId;
     private final ObjectName jettyContainerObjectName;
     private final Collection defaultServlets;
     private final Collection defaultFilters;
@@ -149,7 +149,7 @@
     private static final String JETTY_CONFIG_NAMESPACE = "http://geronimo.apache.org/xml/ns/web/jetty";
     private static final QName JETTY_CONFIG_QNAME = new QName(JETTY_CONFIG_NAMESPACE, "jetty");
 
-    public JettyModuleBuilder(URI defaultParentId,
+    public JettyModuleBuilder(URI[] defaultParentId,
                               Integer defaultSessionTimeoutSeconds,
                               boolean defaultContextPriorityClassloader,
                               List defaultWelcomeFiles,
@@ -255,19 +255,27 @@
             throw new DeploymentException("Invalid configId " + jettyWebApp.getConfigId(), e);
         }
 
-        URI parentId = null;
+        URI[] parentId = null;
         if (jettyWebApp.isSetParentId()) {
+            String parentIdString = jettyWebApp.getParentId();
             try {
-                parentId = new URI(jettyWebApp.getParentId());
+                String[] parentIdStrings = parentIdString.split(",");
+                parentId = new URI[parentIdStrings.length];
+                for (int i = 0; i < parentIdStrings.length; i++) {
+                    String idString = parentIdStrings[i];
+                    URI parent = new URI(idString);
+                    parentId[i] = parent;
+                }
             } catch (URISyntaxException e) {
-                throw new DeploymentException("Invalid parentId " + jettyWebApp.getParentId(), e);
+                throw new DeploymentException("Invalid parentId " + parentIdString, e);
             }
         } else {
             parentId = defaultParentId;
         }
 
-        WebModule module = new WebModule(standAlone, configId, parentId, moduleFile, targetPath, webApp, jettyWebApp, specDD, portMap);
-        module.setContextRoot(contextRoot);
+        assert parentId != null;
+        assert parentId.length >0;
+        WebModule module = new WebModule(standAlone, configId, parentId, moduleFile, targetPath, webApp, jettyWebApp, specDD, contextRoot, portMap);
         return module;
     }
 
@@ -380,7 +388,6 @@
         GerWebAppType jettyWebApp = GerWebAppType.Factory.newInstance();
 
         // set the parentId, configId and context root
-        jettyWebApp.setParentId(defaultParentId.toString());
         jettyWebApp.setConfigId(contextRoot);
         jettyWebApp.setContextRoot(contextRoot);
         jettyWebApp.setContextPriorityClassloader(defaultContextPriorityClassloader);
@@ -478,7 +485,7 @@
                     throw new DeploymentException("More than one jetty configuration element: " + anys);
                 }
                 if (anys.length == 1) {
-                    GerJettyConfigType jettyConfigType = (GerJettyConfigType)anys[0].copy().changeType(GerJettyConfigType.type);
+                    GerJettyConfigType jettyConfigType = (GerJettyConfigType) anys[0].copy().changeType(GerJettyConfigType.type);
                     String[] hosts = jettyConfigType.getVirtualHostArray();
                     for (int i = 0; i < hosts.length; i++) {
                         hosts[i] = hosts[i].trim();
@@ -1382,7 +1389,7 @@
 
     static {
         GBeanInfoBuilder infoBuilder = new GBeanInfoBuilder(JettyModuleBuilder.class, NameFactory.MODULE_BUILDER);
-        infoBuilder.addAttribute("defaultParentId", URI.class, true);
+        infoBuilder.addAttribute("defaultParentId", URI[].class, true);
         infoBuilder.addAttribute("defaultSessionTimeoutSeconds", Integer.class, true);
         infoBuilder.addAttribute("defaultContextPriorityClassloader", boolean.class, true);
         infoBuilder.addAttribute("defaultWelcomeFiles", List.class, true);

Modified: geronimo/trunk/modules/jetty-builder/src/test/org/apache/geronimo/jetty/deployment/JettyModuleBuilderTest.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/jetty-builder/src/test/org/apache/geronimo/jetty/deployment/JettyModuleBuilderTest.java?rev=264657&r1=264656&r2=264657&view=diff
==============================================================================
--- geronimo/trunk/modules/jetty-builder/src/test/org/apache/geronimo/jetty/deployment/JettyModuleBuilderTest.java (original)
+++ geronimo/trunk/modules/jetty-builder/src/test/org/apache/geronimo/jetty/deployment/JettyModuleBuilderTest.java Mon Aug 29 16:32:47 2005
@@ -102,7 +102,7 @@
     private J2eeContext moduleContext = new J2eeContextImpl("jetty.test", "test", "null", NameFactory.WEB_MODULE, "jettyTest", null, null);
     private JettyModuleBuilder builder;
     private File basedir = new File(System.getProperty("basedir", "."));
-    private URI parentId = URI.create("org/apache/geronimo/Foo");
+    private URI[] parentId = new URI[] {URI.create("org/apache/geronimo/Foo")};
 
     public void testDeployWar4() throws Exception {
         File outputPath = new File(basedir, "target/test-resources/deployables/war4");
@@ -259,7 +259,7 @@
         kernel.startGBean(configurationManagerName);
         ConfigurationManager configurationManager = (ConfigurationManager) kernel.getProxyManager().createProxy(configurationManagerName, ConfigurationManager.class);
 
-        ObjectName baseConfigName = configurationManager.load(parentId);
+        ObjectName baseConfigName = configurationManager.load(parentId[0]);
         kernel.startGBean(baseConfigName);
 
         Collection defaultServlets = new HashSet();
@@ -282,7 +282,7 @@
         start(securityServiceGBean);
 
 
-        builder = new JettyModuleBuilder(new URI("null"), new Integer(1800), false, Collections.EMPTY_LIST, containerName, defaultServlets, defaultFilters, defaultFilterMappings, pojoWebServiceTemplate, webServiceBuilder, null, kernel);
+        builder = new JettyModuleBuilder(new URI[] {new URI("null")}, new Integer(1800), false, Collections.EMPTY_LIST, containerName, defaultServlets, defaultFilters, defaultFilterMappings, pojoWebServiceTemplate, webServiceBuilder, null, kernel);
 
         container = new GBeanData(containerName, JettyContainerImpl.GBEAN_INFO);
 

Modified: geronimo/trunk/modules/jetty-builder/src/test/org/apache/geronimo/jetty/deployment/PlanParsingTest.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/jetty-builder/src/test/org/apache/geronimo/jetty/deployment/PlanParsingTest.java?rev=264657&r1=264656&r2=264657&view=diff
==============================================================================
--- 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 Mon Aug 29 16:32:47 2005
@@ -27,7 +27,7 @@
     private File basedir = new File(System.getProperty("basedir", "."));
 
     public PlanParsingTest() throws Exception {
-        builder = new JettyModuleBuilder(URI.create("defaultParent"), new Integer(1800), false, null, jettyContainerObjectName, new HashSet(), new HashSet(), new HashSet(), pojoWebServiceTemplate, webServiceBuilder, null, null);
+        builder = new JettyModuleBuilder(new URI[] {URI.create("defaultParent")}, new Integer(1800), false, null, jettyContainerObjectName, new HashSet(), new HashSet(), new HashSet(), pojoWebServiceTemplate, webServiceBuilder, null, null);
     }
 
     public void testContents() throws Exception {

Modified: geronimo/trunk/modules/kernel/src/java/org/apache/geronimo/kernel/config/Configuration.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/kernel/src/java/org/apache/geronimo/kernel/config/Configuration.java?rev=264657&r1=264656&r2=264657&view=diff
==============================================================================
--- geronimo/trunk/modules/kernel/src/java/org/apache/geronimo/kernel/config/Configuration.java (original)
+++ geronimo/trunk/modules/kernel/src/java/org/apache/geronimo/kernel/config/Configuration.java Mon Aug 29 16:32:47 2005
@@ -40,13 +40,17 @@
 
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
-import org.apache.geronimo.gbean.*;
-import org.apache.geronimo.kernel.Kernel;
-import org.apache.geronimo.kernel.ObjectInputStreamExt;
+import org.apache.geronimo.gbean.GAttributeInfo;
+import org.apache.geronimo.gbean.GBeanData;
+import org.apache.geronimo.gbean.GBeanInfo;
+import org.apache.geronimo.gbean.GBeanInfoBuilder;
+import org.apache.geronimo.gbean.GBeanLifecycle;
 import org.apache.geronimo.kernel.GBeanAlreadyExistsException;
 import org.apache.geronimo.kernel.GBeanNotFoundException;
-import org.apache.geronimo.kernel.management.State;
+import org.apache.geronimo.kernel.Kernel;
+import org.apache.geronimo.kernel.ObjectInputStreamExt;
 import org.apache.geronimo.kernel.jmx.JMXUtil;
+import org.apache.geronimo.kernel.management.State;
 import org.apache.geronimo.kernel.repository.MissingDependencyException;
 import org.apache.geronimo.kernel.repository.Repository;
 
@@ -114,7 +118,7 @@
     /**
      * The uri of the parent of this configuration.  May be null.
      */
-    private final URI parentId;
+    private final URI[] parentId;
 
     /**
      * The configuration store from which this configuration was loaded.  May be null if this configuration
@@ -205,7 +209,7 @@
             URI id,
             ConfigurationModuleType moduleType,
             URL baseURL,
-            URI parentId,
+            URI[] parentId,
             ConfigurationParent parent,
             String domain,
             String server,
@@ -394,7 +398,7 @@
      *
      * @return the unique id of the parent, or null if it does not have one
      */
-    public URI getParentId() {
+    public URI[] getParentId() {
         return parentId;
     }
 
@@ -590,7 +594,7 @@
         infoFactory.addAttribute("objectName", String.class, false);
         infoFactory.addAttribute("id", URI.class, true);
         infoFactory.addAttribute("type", ConfigurationModuleType.class, true);
-        infoFactory.addAttribute("parentId", URI.class, true);
+        infoFactory.addAttribute("parentId", URI[].class, true);
         infoFactory.addAttribute("domain", String.class, true);
         infoFactory.addAttribute("server", String.class, true);
         infoFactory.addAttribute("classPath", List.class, true);

Modified: geronimo/trunk/modules/kernel/src/java/org/apache/geronimo/kernel/config/ConfigurationData.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/kernel/src/java/org/apache/geronimo/kernel/config/ConfigurationData.java?rev=264657&r1=264656&r2=264657&view=diff
==============================================================================
--- geronimo/trunk/modules/kernel/src/java/org/apache/geronimo/kernel/config/ConfigurationData.java (original)
+++ geronimo/trunk/modules/kernel/src/java/org/apache/geronimo/kernel/config/ConfigurationData.java Mon Aug 29 16:32:47 2005
@@ -43,7 +43,7 @@
     /**
      * The uri of the parent of this configuration.  May be null.
      */
-    private URI parentId;
+    private URI[] parentId;
 
     /**
      * The domain name of the configurations.  This is used to autogenerate names for sub components.
@@ -106,11 +106,11 @@
         this.moduleType = moduleType;
     }
 
-    public URI getParentId() {
+    public URI[] getParentId() {
         return parentId;
     }
 
-    public void setParentId(URI parentId) {
+    public void setParentId(URI[] parentId) {
         this.parentId = parentId;
     }
 

Modified: geronimo/trunk/modules/kernel/src/java/org/apache/geronimo/kernel/config/ConfigurationManagerImpl.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/kernel/src/java/org/apache/geronimo/kernel/config/ConfigurationManagerImpl.java?rev=264657&r1=264656&r2=264657&view=diff
==============================================================================
--- geronimo/trunk/modules/kernel/src/java/org/apache/geronimo/kernel/config/ConfigurationManagerImpl.java (original)
+++ geronimo/trunk/modules/kernel/src/java/org/apache/geronimo/kernel/config/ConfigurationManagerImpl.java Mon Aug 29 16:32:47 2005
@@ -96,14 +96,24 @@
     }
 
     public List loadRecursive(URI configID) throws NoSuchConfigException, IOException, InvalidConfigException {
+        LinkedList ancestors = new LinkedList();
+        loadRecursive(configID, ancestors);
+        return ancestors;
+    }
+
+    private void loadRecursive(URI configID, LinkedList ancestors) throws NoSuchConfigException, IOException, InvalidConfigException {
         try {
-            LinkedList ancestors = new LinkedList();
             while (configID != null && !isLoaded(configID)) {
                 ObjectName name = load(configID);
                 ancestors.addFirst(name);
-                configID = (URI) kernel.getAttribute(name, "parentId");
+                URI[] parents = (URI[]) kernel.getAttribute(name, "parentId");
+                if (parents != null) {
+                    for (int i = 0; i < parents.length; i++) {
+                        URI parent = parents[i];
+                        loadRecursive(parent, ancestors);
+                    }
+                }
             }
-            return ancestors;
         } catch (NoSuchConfigException e) {
             throw e;
         } catch (IOException e) {

Modified: geronimo/trunk/modules/service-builder/src/java/org/apache/geronimo/deployment/service/ServiceConfigBuilder.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/service-builder/src/java/org/apache/geronimo/deployment/service/ServiceConfigBuilder.java?rev=264657&r1=264656&r2=264657&view=diff
==============================================================================
--- geronimo/trunk/modules/service-builder/src/java/org/apache/geronimo/deployment/service/ServiceConfigBuilder.java (original)
+++ geronimo/trunk/modules/service-builder/src/java/org/apache/geronimo/deployment/service/ServiceConfigBuilder.java Mon Aug 29 16:32:47 2005
@@ -25,10 +25,10 @@
 import java.net.URISyntaxException;
 import java.net.URL;
 import java.net.URLClassLoader;
+import java.util.ArrayList;
 import java.util.Collection;
 import java.util.HashMap;
 import java.util.Map;
-import java.util.ArrayList;
 import java.util.jar.JarFile;
 import javax.management.MalformedObjectNameException;
 import javax.management.ObjectName;
@@ -54,20 +54,20 @@
 import org.apache.geronimo.j2ee.j2eeobjectnames.J2eeContextImpl;
 import org.apache.geronimo.j2ee.j2eeobjectnames.NameFactory;
 import org.apache.geronimo.kernel.Kernel;
-import org.apache.geronimo.kernel.config.ConfigurationModuleType;
 import org.apache.geronimo.kernel.config.ConfigurationData;
+import org.apache.geronimo.kernel.config.ConfigurationModuleType;
 import org.apache.geronimo.kernel.repository.MissingDependencyException;
 import org.apache.geronimo.kernel.repository.Repository;
 import org.apache.xmlbeans.XmlCursor;
 import org.apache.xmlbeans.XmlException;
-import org.apache.xmlbeans.XmlOptions;
 import org.apache.xmlbeans.XmlObject;
+import org.apache.xmlbeans.XmlOptions;
 
 /**
  * @version $Rev$ $Date$
  */
 public class ServiceConfigBuilder implements ConfigurationBuilder {
-    private final URI defaultParentId;
+    private final URI[] defaultParentId;
     private final Repository repository;
     private final Kernel kernel;
 
@@ -78,11 +78,11 @@
     private Map refRefMap;
     private static final QName SERVICE_QNAME = new QName("http://geronimo.apache.org/xml/ns/deployment", "configuration");
 
-    public ServiceConfigBuilder(URI defaultParentId, Repository repository) {
+    public ServiceConfigBuilder(URI[] defaultParentId, Repository repository) {
         this(defaultParentId, repository, null, null, null);
     }
 
-    public ServiceConfigBuilder(URI defaultParentId, Repository repository, Collection xmlAttributeBuilders, Collection xmlReferenceBuilders, Kernel kernel) {
+    public ServiceConfigBuilder(URI[] defaultParentId, Repository repository, Collection xmlAttributeBuilders, Collection xmlReferenceBuilders, Kernel kernel) {
         this.defaultParentId = defaultParentId;
         this.repository = repository;
         this.kernel = kernel;
@@ -145,15 +145,15 @@
     }
 
     public URI getConfigurationID(Object plan, JarFile module) throws IOException, DeploymentException {
-        ConfigurationType configType = (ConfigurationType) plan;
-        try {
-            return new URI(configType.getConfigId());
-        } catch (URISyntaxException e) {
-            throw new DeploymentException("Invalid configId " + configType.getConfigId(), e);
-        }
-    }
+         ConfigurationType configType = (ConfigurationType) plan;
+         try {
+             return new URI(configType.getConfigId());
+         } catch (URISyntaxException e) {
+             throw new DeploymentException("Invalid configId " + configType.getConfigId(), e);
+         }
+     }
 
-    public ConfigurationData buildConfiguration(Object plan, JarFile unused, File outfile) throws IOException, DeploymentException {
+     public ConfigurationData buildConfiguration(Object plan, JarFile unused, File outfile) throws IOException, DeploymentException {
         ConfigurationType configType = (ConfigurationType) plan;
         String domain = null;
         String server = null;
@@ -162,10 +162,17 @@
     }
 
     public ConfigurationData buildConfiguration(ConfigurationType configType, String domain, String server, File outfile) throws DeploymentException, IOException {
-        URI parentID = null;
+        URI[] parentID = null;
         if (configType.isSetParentId()) {
             try {
-                parentID = new URI(configType.getParentId());
+                String parentIdString = configType.getParentId();
+                String[] parentIdStrings = parentIdString.split(",");
+                parentID = new URI[parentIdStrings.length];
+                for (int i = 0; i < parentIdStrings.length; i++) {
+                    String idString = parentIdStrings[i];
+                    URI parent = new URI(idString);
+                    parentID[i] = parent;
+                }
             } catch (URISyntaxException e) {
                 throw new DeploymentException("Invalid parentId " + configType.getParentId(), e);
             }
@@ -383,7 +390,7 @@
 
         infoFactory.addInterface(ConfigurationBuilder.class);
 
-        infoFactory.addAttribute("defaultParentId", URI.class, true);
+        infoFactory.addAttribute("defaultParentId", URI[].class, true);
         infoFactory.addReference("Repository", Repository.class, NameFactory.GERONIMO_SERVICE);
         infoFactory.addReference("XmlAttributeBuilders", XmlAttributeBuilder.class, "XmlAttributeBuilder");
         infoFactory.addReference("XmlReferenceBuilders", XmlReferenceBuilder.class, "XmlReferenceBuilder");

Modified: geronimo/trunk/modules/service-builder/src/test/org/apache/geronimo/deployment/service/ServiceConfigBuilderTest.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/service-builder/src/test/org/apache/geronimo/deployment/service/ServiceConfigBuilderTest.java?rev=264657&r1=264656&r2=264657&view=diff
==============================================================================
--- geronimo/trunk/modules/service-builder/src/test/org/apache/geronimo/deployment/service/ServiceConfigBuilderTest.java (original)
+++ geronimo/trunk/modules/service-builder/src/test/org/apache/geronimo/deployment/service/ServiceConfigBuilderTest.java Mon Aug 29 16:32:47 2005
@@ -45,7 +45,7 @@
         JavaBeanXmlAttributeBuilder javaBeanXmlAttributeBuilder = new JavaBeanXmlAttributeBuilder();
         //this is kind of cheating, we rely on the builder to iterate through existing members of the collection.
         referenceCollection.add(javaBeanXmlAttributeBuilder);
-        ServiceConfigBuilder builder = new ServiceConfigBuilder(URI.create("test/foo"), null, referenceCollection, null, null);
+        ServiceConfigBuilder builder = new ServiceConfigBuilder(new URI[] {URI.create("test/foo")}, null, referenceCollection, null, null);
         ClassLoader cl = Thread.currentThread().getContextClassLoader();
         URL plan1 = cl.getResource("services/plan1.xml");
         ConfigurationDocument doc = ConfigurationDocument.Factory.parse(plan1);
@@ -56,7 +56,7 @@
             fail("could not create temp dir");
         }
         try {
-            DeploymentContext context = new DeploymentContext(outFile, URI.create("foo/bar"), ConfigurationModuleType.SERVICE, URI.create("foo"), "domain", "server", null);
+            DeploymentContext context = new DeploymentContext(outFile, URI.create("foo/bar"), ConfigurationModuleType.SERVICE, new URI[] {URI.create("foo")}, "domain", "server", null);
             J2eeContext j2eeContext = new J2eeContextImpl("domain", "server", "null", "test", "configtest", "foo", NameFactory.J2EE_MODULE);
             GbeanType[] gbeans = plan.getGbeanArray();
             ServiceConfigBuilder.addGBeans(gbeans, cl, j2eeContext, context);

Modified: geronimo/trunk/modules/servicemix-builder/src/java/org/apache/geronimo/servicemix/deployment/ServiceMixConfigBuilder.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/servicemix-builder/src/java/org/apache/geronimo/servicemix/deployment/ServiceMixConfigBuilder.java?rev=264657&r1=264656&r2=264657&view=diff
==============================================================================
--- geronimo/trunk/modules/servicemix-builder/src/java/org/apache/geronimo/servicemix/deployment/ServiceMixConfigBuilder.java (original)
+++ geronimo/trunk/modules/servicemix-builder/src/java/org/apache/geronimo/servicemix/deployment/ServiceMixConfigBuilder.java Mon Aug 29 16:32:47 2005
@@ -51,8 +51,8 @@
  */
 public class ServiceMixConfigBuilder implements ConfigurationBuilder {
     private static final Log log = LogFactory.getLog(ServiceMixConfigBuilder.class);
-    
-    private final URI defaultParentId;
+
+    private final URI[] defaultParentId;
     private final Repository repository;
     private final Kernel kernel;
     private String deploymentDependencies;
@@ -61,7 +61,7 @@
     static {
         GBeanInfoBuilder infoFactory = new GBeanInfoBuilder(ServiceMixConfigBuilder.class, NameFactory.CONFIG_BUILDER);
         infoFactory.addInterface(ConfigurationBuilder.class);
-        infoFactory.addAttribute("defaultParentId", URI.class, true);
+        infoFactory.addAttribute("defaultParentId", URI[].class, true);
         infoFactory.addAttribute("deploymentDependencies", String.class, true);
         infoFactory.addReference("Repository", Repository.class, NameFactory.GERONIMO_SERVICE);
         infoFactory.addAttribute("kernel", Kernel.class, false);
@@ -73,11 +73,11 @@
         return GBEAN_INFO;
     }
 
-    public ServiceMixConfigBuilder(URI defaultParentId, Repository repository) {
+    public ServiceMixConfigBuilder(URI[] defaultParentId, Repository repository) {
         this(defaultParentId, repository, null);
     }
 
-    public ServiceMixConfigBuilder(URI defaultParentId, Repository repository, Kernel kernel) {
+    public ServiceMixConfigBuilder(URI[] defaultParentId, Repository repository, Kernel kernel) {
         this.defaultParentId = defaultParentId;
         this.repository = repository;
         this.kernel = kernel;
@@ -94,8 +94,8 @@
             log.debug("Not a ServiceMix deployment: no jbi.xml found.");
             //no jbi.xml, not for us
             return null;
-        }   
-        
+        }
+
         try {
             Properties properties = new Properties();
             InputStream is = DeploymentUtil.createJarURL(module, "META-INF/jbi-geronimo.properties").openStream();
@@ -107,7 +107,7 @@
             return properties;
         } catch (Exception e) {
             throw new DeploymentException("Could not load META-INF/jbi-geronimo.properties: "+e,e);
-        }   
+        }
     }
 
     public URI getConfigurationID(Object plan, JarFile module) throws IOException, DeploymentException {
@@ -121,9 +121,9 @@
 
     public ConfigurationData buildConfiguration(Object plan, JarFile module, File outfile) throws IOException, DeploymentException {
         log.debug("Installing ServiceMix deployment.");
-        Properties properties = (Properties)plan;        
+        Properties properties = (Properties)plan;
 
-        URI parentID = defaultParentId;
+        URI[] parentID = defaultParentId;
         URI configID;
         try {
             configID = new URI(properties.getProperty("configID"));
@@ -156,7 +156,7 @@
         } catch (MalformedObjectNameException e) {
             throw new DeploymentException("Invalid gbean name: "+e,e);
         }
-        
+
         if( deploymentDependencies!=null ) {
             String[] strings = deploymentDependencies.split("\\,");
             for (int i = 0; i < strings.length; i++) {
@@ -170,8 +170,8 @@
                 }
             }
         }
-        
-        context.close();        
+
+        context.close();
         ConfigurationData configurationData = context.getConfigurationData();
         try {
             configurationData.addClassPathLocation(new URI("."));

Modified: geronimo/trunk/modules/spring-builder/src/java/org/apache/geronimo/spring/deployment/SPRConfigBuilder.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/spring-builder/src/java/org/apache/geronimo/spring/deployment/SPRConfigBuilder.java?rev=264657&r1=264656&r2=264657&view=diff
==============================================================================
--- geronimo/trunk/modules/spring-builder/src/java/org/apache/geronimo/spring/deployment/SPRConfigBuilder.java (original)
+++ geronimo/trunk/modules/spring-builder/src/java/org/apache/geronimo/spring/deployment/SPRConfigBuilder.java Mon Aug 29 16:32:47 2005
@@ -54,10 +54,10 @@
 
   protected final Kernel     _kernel;
   protected final Repository _repository;
-  protected final URI        _defaultParentId;
+  protected final URI[]        _defaultParentId;
 
   public
-    SPRConfigBuilder(URI defaultParentId, Repository repository, Kernel kernel)
+    SPRConfigBuilder(URI[] defaultParentId, Repository repository, Kernel kernel)
   {
     _kernel         =kernel;
     _repository     =repository;
@@ -72,7 +72,7 @@
   static
   {
     GBeanInfoBuilder infoFactory = new GBeanInfoBuilder(SPRConfigBuilder.class, NameFactory.CONFIG_BUILDER);
-    infoFactory.addAttribute("defaultParentId" , URI.class, true);
+    infoFactory.addAttribute("defaultParentId" , URI[].class, true);
     infoFactory.addReference("Repository"      , Repository.class, NameFactory.GERONIMO_SERVICE);
     infoFactory.addAttribute("kernel"          , Kernel.class, false);
     infoFactory.addInterface(ConfigurationBuilder.class);
@@ -125,7 +125,7 @@
     try
     {
       URI configId=new URI(sprFile.getName());	// could be overridden in META-INF/geronimo-spring.xml
-      URI parentId=_defaultParentId; // could be overridden in META-INF/geronimo-spring.xml
+      URI[] parentId=_defaultParentId; // could be overridden in META-INF/geronimo-spring.xml
       URI configPath=new URI(_defaultConfigPath);
 
       ctx=new SPRContext(outfile, configId, ConfigurationModuleType.SPR, parentId, _kernel);

Modified: geronimo/trunk/modules/spring-builder/src/java/org/apache/geronimo/spring/deployment/SPRContext.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/spring-builder/src/java/org/apache/geronimo/spring/deployment/SPRContext.java?rev=264657&r1=264656&r2=264657&view=diff
==============================================================================
--- geronimo/trunk/modules/spring-builder/src/java/org/apache/geronimo/spring/deployment/SPRContext.java (original)
+++ geronimo/trunk/modules/spring-builder/src/java/org/apache/geronimo/spring/deployment/SPRContext.java Mon Aug 29 16:32:47 2005
@@ -32,7 +32,7 @@
   extends DeploymentContext
 {
   public
-    SPRContext(File baseDir, URI id, ConfigurationModuleType moduleType, URI parentID, Kernel kernel)
+    SPRContext(File baseDir, URI id, ConfigurationModuleType moduleType, URI[] parentID, Kernel kernel)
     throws MalformedObjectNameException, DeploymentException
   {
     super(baseDir, id, moduleType, parentID, kernel);

Modified: geronimo/trunk/modules/system/src/java/org/apache/geronimo/system/configuration/ExecutableConfigurationUtil.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/system/src/java/org/apache/geronimo/system/configuration/ExecutableConfigurationUtil.java?rev=264657&r1=264656&r2=264657&view=diff
==============================================================================
--- geronimo/trunk/modules/system/src/java/org/apache/geronimo/system/configuration/ExecutableConfigurationUtil.java (original)
+++ geronimo/trunk/modules/system/src/java/org/apache/geronimo/system/configuration/ExecutableConfigurationUtil.java Mon Aug 29 16:32:47 2005
@@ -28,6 +28,8 @@
 import java.util.Collections;
 import java.util.Iterator;
 import java.util.LinkedList;
+import java.util.Set;
+import java.util.HashSet;
 import java.util.jar.JarOutputStream;
 import java.util.jar.Manifest;
 import java.util.zip.ZipEntry;
@@ -109,7 +111,7 @@
             out.closeEntry();
         }
     }
-    
+
     public static void writeConfiguration(ConfigurationData configurationData, File source) throws InvalidConfigException, IOException {
         // convert the configuration data to a gbeandata object
         GBeanData configurationGBeanData = getConfigurationGBeanData(configurationData);
@@ -151,11 +153,16 @@
             config.setAttribute("domain", configurationData.getDomain());
             config.setAttribute("server", configurationData.getServer());
 
-            URI parentId = configurationData.getParentId();
+            URI[] parentId = configurationData.getParentId();
             if (parentId != null) {
                 config.setAttribute("parentId", parentId);
-                ObjectName parentName = Configuration.getConfigurationObjectName(parentId);
-                config.setReferencePattern("Parent", parentName);
+                Set parentNames = new HashSet();
+                for (int i = 0; i < parentId.length; i++) {
+                    URI uri = parentId[i];
+                    ObjectName parentName = Configuration.getConfigurationObjectName(uri);
+                    parentNames.add(parentName);
+                }
+                config.setReferencePatterns("Parent", parentNames);
             }
 
             config.setAttribute("gBeanState", Configuration.storeGBeans(configurationData.getGBeans()));

Modified: geronimo/trunk/modules/tomcat-builder/src/java/org/apache/geronimo/tomcat/deployment/TomcatModuleBuilder.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/tomcat-builder/src/java/org/apache/geronimo/tomcat/deployment/TomcatModuleBuilder.java?rev=264657&r1=264656&r2=264657&view=diff
==============================================================================
--- geronimo/trunk/modules/tomcat-builder/src/java/org/apache/geronimo/tomcat/deployment/TomcatModuleBuilder.java (original)
+++ geronimo/trunk/modules/tomcat-builder/src/java/org/apache/geronimo/tomcat/deployment/TomcatModuleBuilder.java Mon Aug 29 16:32:47 2005
@@ -104,7 +104,7 @@
  */
 public class TomcatModuleBuilder implements ModuleBuilder {
 
-    private final URI defaultParentId;
+    private final URI[] defaultParentId;
     private final boolean defaultContextPriorityClassloader;
     private final ObjectName tomcatContainerObjectName;
 
@@ -114,7 +114,7 @@
     private static final String TOMCAT_CONFIG_NAMESPACE = "http://geronimo.apache.org/xml/ns/web/tomcat";
     private static final QName TOMCAT_CONFIG_QNAME = new QName(TOMCAT_CONFIG_NAMESPACE, "tomcat");
 
-    public TomcatModuleBuilder(URI defaultParentId,
+    public TomcatModuleBuilder(URI[] defaultParentId,
                                boolean defaultContextPriorityClassloader,
                                ObjectName tomcatContainerObjectName,
                                WebServiceBuilder webServiceBuilder,
@@ -177,12 +177,19 @@
             throw new DeploymentException("Invalid configId " + tomcatWebApp.getConfigId(), e);
         }
 
-        URI parentId = null;
+        URI[] parentId = null;
         if (tomcatWebApp.isSetParentId()) {
+            String parentIdString = tomcatWebApp.getParentId();
             try {
-                parentId = new URI(tomcatWebApp.getParentId());
+                String[] parentIdStrings = parentIdString.split(",");
+                parentId = new URI[parentIdStrings.length];
+                for (int i = 0; i < parentIdStrings.length; i++) {
+                    String idString = parentIdStrings[i];
+                    URI parent = new URI(idString);
+                    parentId[i] = parent;
+                }
             } catch (URISyntaxException e) {
-                throw new DeploymentException("Invalid parentId " + tomcatWebApp.getParentId(), e);
+                throw new DeploymentException("Invalid parentId " + parentIdString, e);
             }
         } else {
             parentId = defaultParentId;
@@ -203,8 +210,7 @@
             }
         }
 
-        WebModule module = new WebModule(standAlone, configId, parentId, moduleFile, targetPath, webApp, tomcatWebApp, specDD, portMap);
-        module.setContextRoot(contextRoot);
+        WebModule module = new WebModule(standAlone, configId, parentId, moduleFile, targetPath, webApp, tomcatWebApp, specDD, contextRoot, portMap);
         return module;
     }
 
@@ -288,8 +294,7 @@
 
         GerWebAppType tomcatWebApp = GerWebAppType.Factory.newInstance();
 
-        // set the parentId, configId and context root
-        tomcatWebApp.setParentId(defaultParentId.toString());
+        // set the configId and context root
         if (null != webApp.getId()) {
             id = webApp.getId();
         }
@@ -471,14 +476,14 @@
                 securityHolder.setSecurityRealm(tomcatWebApp.getSecurityRealmName().trim());
 
                 if (tomcatWebApp.isSetSecurity()){
-                    
+
                     securityHolder.setSecurity(true);
                     /**
                      * TODO - go back to commented version when possible.
                      */
                     String policyContextID = webModuleName.getCanonicalName().replaceAll("[, :]", "_");
                     securityHolder.setPolicyContextID(policyContextID);
-    
+
                     ComponentPermissions componentPermissions = buildSpecSecurityConfig(webApp, securityRoles, rolePermissions);
                     securityHolder.setExcluded(componentPermissions.getExcludedPermissions());
                     PermissionCollection checkedPermissions = new Permissions();
@@ -936,7 +941,7 @@
 
     static {
         GBeanInfoBuilder infoBuilder = new GBeanInfoBuilder(TomcatModuleBuilder.class, NameFactory.MODULE_BUILDER);
-        infoBuilder.addAttribute("defaultParentId", URI.class, true);
+        infoBuilder.addAttribute("defaultParentId", URI[].class, true);
         infoBuilder.addAttribute("defaultContextPriorityClassloader", boolean.class, true);
         infoBuilder.addAttribute("tomcatContainerObjectName", ObjectName.class, true);
         infoBuilder.addReference("WebServiceBuilder", WebServiceBuilder.class, NameFactory.MODULE_BUILDER);

Modified: geronimo/trunk/modules/tomcat-builder/src/test/org/apache/geronimo/tomcat/deployment/TomcatModuleBuilderTest.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/tomcat-builder/src/test/org/apache/geronimo/tomcat/deployment/TomcatModuleBuilderTest.java?rev=264657&r1=264656&r2=264657&view=diff
==============================================================================
--- geronimo/trunk/modules/tomcat-builder/src/test/org/apache/geronimo/tomcat/deployment/TomcatModuleBuilderTest.java (original)
+++ geronimo/trunk/modules/tomcat-builder/src/test/org/apache/geronimo/tomcat/deployment/TomcatModuleBuilderTest.java Mon Aug 29 16:32:47 2005
@@ -32,14 +32,12 @@
 import java.util.List;
 import java.util.Map;
 import java.util.Set;
-
 import javax.management.MalformedObjectNameException;
 import javax.management.ObjectName;
 import javax.naming.Reference;
 import javax.xml.namespace.QName;
 
 import junit.framework.TestCase;
-
 import org.apache.commons.io.FileUtils;
 import org.apache.geronimo.axis.builder.AxisBuilder;
 import org.apache.geronimo.common.DeploymentException;
@@ -52,11 +50,11 @@
 import org.apache.geronimo.j2ee.deployment.EARContext;
 import org.apache.geronimo.j2ee.deployment.EJBReferenceBuilder;
 import org.apache.geronimo.j2ee.deployment.Module;
+import org.apache.geronimo.j2ee.deployment.NamingContext;
 import org.apache.geronimo.j2ee.deployment.RefContext;
 import org.apache.geronimo.j2ee.deployment.ResourceReferenceBuilder;
 import org.apache.geronimo.j2ee.deployment.ServiceReferenceBuilder;
 import org.apache.geronimo.j2ee.deployment.WebServiceBuilder;
-import org.apache.geronimo.j2ee.deployment.NamingContext;
 import org.apache.geronimo.j2ee.j2eeobjectnames.J2eeContext;
 import org.apache.geronimo.j2ee.j2eeobjectnames.J2eeContextImpl;
 import org.apache.geronimo.j2ee.j2eeobjectnames.NameFactory;
@@ -82,9 +80,7 @@
 import org.apache.geronimo.tomcat.HostGBean;
 import org.apache.geronimo.tomcat.RealmGBean;
 import org.apache.geronimo.tomcat.TomcatContainer;
-import org.apache.geronimo.transaction.context.TransactionContextManager;
 import org.apache.geronimo.transaction.context.TransactionContextManagerGBean;
-import org.apache.geronimo.transaction.manager.TransactionManagerImpl;
 import org.apache.geronimo.transaction.manager.TransactionManagerImplGBean;
 
 /**
@@ -143,7 +139,7 @@
 
     private File basedir = new File(System.getProperty("basedir", "."));
 
-    private URI parentId = URI.create("org/apache/geronimo/Foo");
+    private URI[] parentId = new URI[] {URI.create("org/apache/geronimo/Foo")};
 
     public void testDeployWar4() throws Exception {
         deployWar("war4", "org/apache/geronimo/test");
@@ -366,7 +362,7 @@
         kernel.startGBean(configurationManagerName);
         ConfigurationManager configurationManager = (ConfigurationManager) kernel.getProxyManager().createProxy(configurationManagerName, ConfigurationManager.class);
 
-        ObjectName baseConfigName = configurationManager.load(parentId);
+        ObjectName baseConfigName = configurationManager.load(parentId[0]);
         kernel.startGBean(baseConfigName);
 
         serverInfoName = new ObjectName("geronimo.system:name=ServerInfo");
@@ -388,7 +384,7 @@
 
         WebServiceBuilder webServiceBuilder = new AxisBuilder();
 
-        builder = new TomcatModuleBuilder(new URI("null"), false, containerName, webServiceBuilder, null);
+        builder = new TomcatModuleBuilder(new URI[] {new URI("null")}, false, containerName, webServiceBuilder, null);
 
         // Default Realm
         Map initParams = new HashMap();



Mime
View raw message