geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From djen...@apache.org
Subject svn commit: r278940 [3/3] - in /geronimo/trunk: applications/console-ear/src/plan/ applications/console-standard/src/java/org/apache/geronimo/console/jmsmanager/handlers/ modules/assembly/ modules/assembly/src/plan/ modules/assembly/src/var/config/ mod...
Date Tue, 06 Sep 2005 08:21:26 GMT
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=278940&r1=278939&r2=278940&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 Tue Sep  6 01:20:51 2005
@@ -16,15 +16,15 @@
  */
 package org.apache.geronimo.j2ee.deployment;
 
+import java.io.IOException;
 import java.net.URI;
 import java.net.URISyntaxException;
-import java.util.jar.JarFile;
 import java.util.Collection;
-import java.util.Set;
-import java.io.IOException;
+import java.util.List;
+import java.util.jar.JarFile;
 
-import org.apache.geronimo.kernel.config.ConfigurationModuleType;
 import org.apache.geronimo.deployment.DeploymentContext;
+import org.apache.geronimo.kernel.config.ConfigurationModuleType;
 import org.apache.xmlbeans.XmlObject;
 
 /**
@@ -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, List 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=278940&r1=278939&r2=278940&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 Tue Sep  6 01:20:51 2005
@@ -19,6 +19,7 @@
 import java.net.URI;
 import java.net.URISyntaxException;
 import java.util.jar.JarFile;
+import java.util.List;
 import java.io.IOException;
 
 import org.apache.xmlbeans.XmlObject;
@@ -29,7 +30,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, List 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=278940&r1=278939&r2=278940&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 Tue Sep  6 01:20:51 2005
@@ -22,15 +22,16 @@
 import java.net.URI;
 import java.net.URISyntaxException;
 import java.net.URL;
+import java.util.Arrays;
 import java.util.Collections;
 import java.util.Enumeration;
 import java.util.HashMap;
 import java.util.HashSet;
 import java.util.Iterator;
 import java.util.LinkedHashSet;
+import java.util.List;
 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;
@@ -84,7 +85,7 @@
     private final ResourceReferenceBuilder resourceReferenceBuilder;
     private final ServiceReferenceBuilder serviceReferenceBuilder;
 
-    private final URI[] defaultParentId;
+    private final List defaultParentId;
     private final ObjectName transactionContextManagerObjectName;
     private final ObjectName connectionTrackerObjectName;
     private final ObjectName transactionalTimerObjectName;
@@ -95,7 +96,7 @@
     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;
+        this.defaultParentId = defaultParentId == null ? Collections.EMPTY_LIST : Arrays.asList(defaultParentId);
 
         this.ejbConfigBuilder = ejbConfigBuilder;
         this.ejbReferenceBuilder = ejbReferenceBuilder;
@@ -221,10 +222,8 @@
             throw new DeploymentException("Invalid configId " + gerApplication.getConfigId(), e);
         }
 
-        URI[] parentId = ServiceConfigBuilder.getParentID(gerApplication.getParentId(), gerApplication.getImportArray());
-         if (parentId == null) {
-             parentId = defaultParentId;
-         }
+        List parentId = ServiceConfigBuilder.getParentID(gerApplication.getParentId(), gerApplication.getImportArray());
+        parentId.addAll(defaultParentId);
 
         // get the modules either the application plan or for a stand alone module from the specific deployer
         // todo change module so you can extract the real module path back out.. then we can eliminate

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=278940&r1=278939&r2=278940&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 Tue Sep  6 01:20:51 2005
@@ -20,6 +20,7 @@
 import java.net.URI;
 import java.util.HashMap;
 import java.util.Map;
+import java.util.List;
 import javax.management.MalformedObjectNameException;
 import javax.management.ObjectName;
 
@@ -55,7 +56,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, List 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=278940&r1=278939&r2=278940&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 Tue Sep  6 01:20:51 2005
@@ -19,6 +19,7 @@
 import java.net.URI;
 import java.net.URISyntaxException;
 import java.util.jar.JarFile;
+import java.util.List;
 import java.io.IOException;
 
 import org.apache.xmlbeans.XmlObject;
@@ -29,7 +30,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, List 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=278940&r1=278939&r2=278940&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 Tue Sep  6 01:20:51 2005
@@ -17,6 +17,7 @@
 package org.apache.geronimo.j2ee.deployment;
 
 import java.util.jar.JarFile;
+import java.util.List;
 import java.net.URI;
 import java.net.URISyntaxException;
 import java.io.IOException;
@@ -34,7 +35,7 @@
     private final boolean standAlone;
     private final String name;
     private final URI configId;
-    private final URI[] parentId;
+    private final List parentId;
     private final URI moduleURI;
     private final JarFile moduleFile;
     private final String targetPath;
@@ -45,7 +46,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, List parentId, JarFile moduleFile, String targetPath, XmlObject specDD, XmlObject vendorDD, String originalSpecDD) {
         assert targetPath != null: "targetPath is null";
 
         this.standAlone = standAlone;
@@ -82,7 +83,7 @@
         return configId;
     }
 
-    public URI[] getParentId() {
+    public List getParentId() {
         return parentId;
     }
 

Modified: geronimo/trunk/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/ModuleBuilder.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/ModuleBuilder.java?rev=278940&r1=278939&r2=278940&view=diff
==============================================================================
--- geronimo/trunk/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/ModuleBuilder.java (original)
+++ geronimo/trunk/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/ModuleBuilder.java Tue Sep  6 01:20:51 2005
@@ -36,4 +36,6 @@
     void initContext(EARContext earContext, Module module, ClassLoader cl) throws DeploymentException;
 
     void addGBeans(EARContext earContext, Module module, ClassLoader cl) throws DeploymentException;
+
+    String getSchemaNamespace();
 }

Added: geronimo/trunk/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/SwitchingModuleBuilder.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/SwitchingModuleBuilder.java?rev=278940&view=auto
==============================================================================
--- geronimo/trunk/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/SwitchingModuleBuilder.java (added)
+++ geronimo/trunk/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/SwitchingModuleBuilder.java Tue Sep  6 01:20:51 2005
@@ -0,0 +1,178 @@
+/**
+ *
+ * Copyright 2005 The Apache Software Foundation
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+package org.apache.geronimo.j2ee.deployment;
+
+import java.io.File;
+import java.io.IOException;
+import java.util.jar.JarFile;
+import java.util.Map;
+import java.util.HashMap;
+import java.util.Collection;
+import java.util.Iterator;
+import java.net.URL;
+import java.net.URI;
+
+import org.apache.geronimo.j2ee.deployment.ModuleBuilder;
+import org.apache.geronimo.j2ee.deployment.Module;
+import org.apache.geronimo.j2ee.deployment.EARContext;
+import org.apache.geronimo.j2ee.j2eeobjectnames.NameFactory;
+import org.apache.geronimo.common.DeploymentException;
+import org.apache.geronimo.gbean.ReferenceCollection;
+import org.apache.geronimo.gbean.ReferenceCollectionListener;
+import org.apache.geronimo.gbean.ReferenceCollectionEvent;
+import org.apache.geronimo.gbean.GBeanInfo;
+import org.apache.geronimo.gbean.GBeanInfoBuilder;
+import org.apache.geronimo.schema.SchemaConversionUtils;
+import org.apache.xmlbeans.XmlObject;
+import org.apache.xmlbeans.XmlException;
+import org.apache.xmlbeans.XmlCursor;
+
+/**
+ * @version $Rev:  $ $Date:  $
+ */
+public class SwitchingModuleBuilder implements ModuleBuilder {
+
+    private final ReferenceCollection builders;
+    private final Map namespaceToBuilderMap = new HashMap();
+
+    private String defaultNamespace;
+
+    public SwitchingModuleBuilder(Collection builders) {
+        this.builders = (ReferenceCollection) builders;
+        this.builders.addReferenceCollectionListener(new ReferenceCollectionListener() {
+            public void memberAdded(ReferenceCollectionEvent event) {
+                ModuleBuilder builder = (ModuleBuilder) event.getMember();
+                String namespace = builder.getSchemaNamespace();
+                namespaceToBuilderMap.put(namespace, builder);
+            }
+
+            public void memberRemoved(ReferenceCollectionEvent event) {
+                ModuleBuilder builder = (ModuleBuilder) event.getMember();
+                String namespace =  builder.getSchemaNamespace();
+                namespaceToBuilderMap.remove(namespace);
+            }
+        });
+        for (Iterator iterator = builders.iterator(); iterator.hasNext();) {
+            ModuleBuilder builder = (ModuleBuilder) iterator.next();
+            String namespace =  builder.getSchemaNamespace();
+            namespaceToBuilderMap.put(namespace, builder);
+        }
+
+    }
+
+    public String getDefaultNamespace() {
+        return defaultNamespace;
+    }
+
+    public void setDefaultNamespace(String defaultNamespace) {
+        this.defaultNamespace = defaultNamespace;
+    }
+
+    public Module createModule(File plan, JarFile moduleFile) throws DeploymentException {
+        String namespace;
+        if (plan == null) {
+            namespace = defaultNamespace;
+        } else {
+            namespace = getNamespaceFromPlan(plan);
+        }
+        ModuleBuilder builder = getBuilderFromNamespace(namespace);
+        return builder.createModule(plan, moduleFile);
+    }
+
+    private String getNamespaceFromPlan(Object plan) throws DeploymentException {
+        XmlObject xmlObject;
+        if (plan instanceof File) {
+            try {
+                xmlObject = SchemaConversionUtils.parse(((File) plan).toURL());
+            } catch (IOException e) {
+                throw new DeploymentException("Could not read plan file", e);
+            } catch (XmlException e) {
+                throw new DeploymentException("Plan file does not contain well formed xml", e);
+            }
+        } else if (plan instanceof XmlObject) {
+            xmlObject = (XmlObject) plan;
+        } else {
+            return defaultNamespace;
+        }
+        XmlCursor cursor = xmlObject.newCursor();
+        try {
+            cursor.toFirstChild();
+            String namespace = cursor.getName().getNamespaceURI();
+            return namespace;
+        } finally {
+            cursor.dispose();
+        }
+    }
+
+    private ModuleBuilder getBuilderFromNamespace(String namespace) throws DeploymentException {
+        ModuleBuilder builder = (ModuleBuilder) namespaceToBuilderMap.get(namespace);
+        if (builder == null) {
+            builder = (ModuleBuilder) namespaceToBuilderMap.get(defaultNamespace);
+        }
+        if (builder == null) {
+            throw new DeploymentException("No builder found for namespace: " + namespace + " or default namespace: " + defaultNamespace);
+        }
+        return builder;
+    }
+
+    public Module createModule(Object plan, JarFile moduleFile, String targetPath, URL specDDUrl, URI earConfigId, Object moduleContextInfo) throws DeploymentException {
+        String namespace = getNamespaceFromPlan(plan);
+        ModuleBuilder builder = getBuilderFromNamespace(namespace);
+        return builder.createModule(plan, moduleFile, targetPath, specDDUrl, earConfigId, moduleContextInfo);
+    }
+
+    public void installModule(JarFile earFile, EARContext earContext, Module module) throws DeploymentException {
+        XmlObject plan = module.getVendorDD();
+        String namespace = getNamespaceFromPlan(plan);
+        ModuleBuilder builder = getBuilderFromNamespace(namespace);
+        builder.installModule(earFile, earContext, module);
+    }
+
+    public void initContext(EARContext earContext, Module module, ClassLoader cl) throws DeploymentException {
+        XmlObject plan = module.getVendorDD();
+        String namespace = getNamespaceFromPlan(plan);
+        ModuleBuilder builder = getBuilderFromNamespace(namespace);
+        builder.initContext(earContext, module, cl);
+    }
+
+    public void addGBeans(EARContext earContext, Module module, ClassLoader cl) throws DeploymentException {
+        XmlObject plan = module.getVendorDD();
+        String namespace = getNamespaceFromPlan(plan);
+        ModuleBuilder builder = getBuilderFromNamespace(namespace);
+        builder.addGBeans(earContext, module, cl);
+    }
+
+    public String getSchemaNamespace() {
+        return null;
+    }
+
+    public static final GBeanInfo GBEAN_INFO;
+
+    static {
+        GBeanInfoBuilder infoBuilder = new GBeanInfoBuilder(SwitchingModuleBuilder.class, NameFactory.MODULE_BUILDER);
+        infoBuilder.addAttribute("defaultNamespace", String.class, true, true);
+        infoBuilder.addReference("ModuleBuilders", ModuleBuilder.class, NameFactory.MODULE_BUILDER);
+        infoBuilder.addInterface(ModuleBuilder.class);
+
+        infoBuilder.setConstructor(new String[] {"ModuleBuilders"});
+        GBEAN_INFO = infoBuilder.getBeanInfo();
+    }
+
+    public static GBeanInfo getGBeanInfo() {
+        return GBEAN_INFO;
+    }
+}

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=278940&r1=278939&r2=278940&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 Tue Sep  6 01:20:51 2005
@@ -19,6 +19,7 @@
 import java.util.jar.JarFile;
 import java.util.LinkedHashSet;
 import java.util.Map;
+import java.util.List;
 import java.net.URI;
 import java.net.URISyntaxException;
 import java.io.IOException;
@@ -36,7 +37,7 @@
     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, String contextRoot, Map portMap) {
+    public WebModule(boolean standAlone, URI configId, List 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;

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=278940&r1=278939&r2=278940&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 Tue Sep  6 01:20:51 2005
@@ -44,9 +44,9 @@
 import org.apache.geronimo.j2ee.j2eeobjectnames.NameFactory;
 import org.apache.geronimo.kernel.Kernel;
 import org.apache.geronimo.kernel.KernelFactory;
-import org.apache.geronimo.kernel.config.ConfigurationManagerImpl;
 import org.apache.geronimo.kernel.config.Configuration;
 import org.apache.geronimo.kernel.config.ConfigurationData;
+import org.apache.geronimo.kernel.config.ConfigurationManagerImpl;
 import org.apache.geronimo.kernel.config.ConfigurationStore;
 import org.apache.geronimo.kernel.config.InvalidConfigException;
 import org.apache.geronimo.kernel.config.NoSuchConfigException;
@@ -236,14 +236,14 @@
         kernel.loadGBean(store, this.getClass().getClassLoader());
         kernel.startGBean(store.getName());
 
-        EARConfigBuilder configBuilder = new EARConfigBuilder(defaultParentId, transactionManagerObjectName, connectionTrackerObjectName, transactionalTimerObjectName, nonTransactionalTimerObjectName, null, null, ejbConfigBuilder, ejbConfigBuilder, webConfigBuilder, connectorConfigBuilder, resourceReferenceBuilder, appClientConfigBuilder, serviceReferenceBuilder, kernel);
-
         ObjectName configurationManagerName = new ObjectName(":j2eeType=ConfigurationManager,name=Basic");
         GBeanData configurationManagerData = new GBeanData(configurationManagerName, ConfigurationManagerImpl.GBEAN_INFO);
         configurationManagerData.setReferencePatterns("Stores", Collections.singleton(store.getName()));
         kernel.loadGBean(configurationManagerData, getClass().getClassLoader());
         kernel.startGBean(configurationManagerName);
 
+        EARConfigBuilder configBuilder = new EARConfigBuilder(defaultParentId, transactionManagerObjectName, connectionTrackerObjectName, transactionalTimerObjectName, nonTransactionalTimerObjectName, null, null, ejbConfigBuilder, ejbConfigBuilder, webConfigBuilder, connectorConfigBuilder, resourceReferenceBuilder, appClientConfigBuilder, serviceReferenceBuilder, kernel);
+
         File tempDir = null;
         try {
             tempDir = DeploymentUtil.createTempDir();
@@ -432,7 +432,7 @@
             return null;
         }
 
-        public List listConfiguations() {
+        public List listConfigurations() {
             return null;
         }
 

Modified: geronimo/trunk/modules/j2ee-builder/src/test/org/apache/geronimo/j2ee/deployment/MockConnectorConfigBuilder.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/j2ee-builder/src/test/org/apache/geronimo/j2ee/deployment/MockConnectorConfigBuilder.java?rev=278940&r1=278939&r2=278940&view=diff
==============================================================================
--- geronimo/trunk/modules/j2ee-builder/src/test/org/apache/geronimo/j2ee/deployment/MockConnectorConfigBuilder.java (original)
+++ geronimo/trunk/modules/j2ee-builder/src/test/org/apache/geronimo/j2ee/deployment/MockConnectorConfigBuilder.java Tue Sep  6 01:20:51 2005
@@ -70,6 +70,10 @@
         assertEquals(this.cl, cl);
     }
 
+    public String getSchemaNamespace() {
+        return null;
+    }
+
     public Reference createResourceRef(String containerId, Class iface) throws DeploymentException {
         return null;
     }

Modified: geronimo/trunk/modules/j2ee-builder/src/test/org/apache/geronimo/j2ee/deployment/MockEJBConfigBuilder.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/j2ee-builder/src/test/org/apache/geronimo/j2ee/deployment/MockEJBConfigBuilder.java?rev=278940&r1=278939&r2=278940&view=diff
==============================================================================
--- geronimo/trunk/modules/j2ee-builder/src/test/org/apache/geronimo/j2ee/deployment/MockEJBConfigBuilder.java (original)
+++ geronimo/trunk/modules/j2ee-builder/src/test/org/apache/geronimo/j2ee/deployment/MockEJBConfigBuilder.java Tue Sep  6 01:20:51 2005
@@ -71,6 +71,10 @@
         assertEquals(this.cl, cl);
     }
 
+    public String getSchemaNamespace() {
+        return null;
+    }
+
     public Reference createEJBLocalReference(String objectName, GBeanData gbeanData, boolean isSession, String localHome, String local) throws DeploymentException {
         return 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=278940&r1=278939&r2=278940&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 Tue Sep  6 01:20:51 2005
@@ -73,4 +73,8 @@
         this.contextRoot = ((WebModule) webModule).getContextRoot();
     }
 
+    public String getSchemaNamespace() {
+        return null;
+    }
+
 }

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=278940&r1=278939&r2=278940&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 Tue Sep  6 01:20:51 2005
@@ -40,6 +40,7 @@
 import java.util.Map;
 import java.util.Set;
 import java.util.TreeSet;
+import java.util.Arrays;
 import java.util.jar.JarFile;
 import java.util.zip.ZipEntry;
 
@@ -59,6 +60,7 @@
 import org.apache.geronimo.deployment.util.DeploymentUtil;
 import org.apache.geronimo.deployment.xbeans.DependencyType;
 import org.apache.geronimo.deployment.xbeans.GbeanType;
+import org.apache.geronimo.deployment.DeploymentContext;
 import org.apache.geronimo.gbean.GBeanData;
 import org.apache.geronimo.gbean.GBeanInfo;
 import org.apache.geronimo.gbean.GBeanInfoBuilder;
@@ -131,7 +133,7 @@
  */
 public class JettyModuleBuilder implements ModuleBuilder {
     private final static Log log = LogFactory.getLog(JettyModuleBuilder.class);
-    private final URI[] defaultParentId;
+    private final List defaultParentId;
     private final ObjectName jettyContainerObjectName;
     private final Collection defaultServlets;
     private final Collection defaultFilters;
@@ -148,6 +150,7 @@
     private final Kernel kernel;
     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");
+    private static final String JETTY_NAMESPACE = JETTY_CONFIG_NAMESPACE;//GerConnectorDocument.type.getDocumentElementName().getNamespaceURI();
 
     public JettyModuleBuilder(URI[] defaultParentId,
                               Integer defaultSessionTimeoutSeconds,
@@ -161,7 +164,8 @@
                               WebServiceBuilder webServiceBuilder,
                               Repository repository,
                               Kernel kernel) throws GBeanNotFoundException {
-        this.defaultParentId = defaultParentId;
+        this.defaultParentId = defaultParentId == null? Collections.EMPTY_LIST: Arrays.asList(defaultParentId);
+
         this.defaultSessionTimeoutSeconds = (defaultSessionTimeoutSeconds == null) ? new Integer(30 * 60) : defaultSessionTimeoutSeconds;
         this.defaultContextPriorityClassloader = defaultContextPriorityClassloader;
         this.jettyContainerObjectName = jettyContainerObjectName;
@@ -255,13 +259,10 @@
             throw new DeploymentException("Invalid configId " + jettyWebApp.getConfigId(), e);
         }
 
-        URI[] parentId = ServiceConfigBuilder.getParentID(jettyWebApp.getParentId(), jettyWebApp.getImportArray());
-        if (parentId == null) {
-            parentId = defaultParentId;
+        List parentId = ServiceConfigBuilder.getParentID(jettyWebApp.getParentId(), jettyWebApp.getImportArray());
+        if (parentId.isEmpty()) {
+            parentId = new ArrayList(defaultParentId);
         }
-
-        assert parentId != null;
-        assert parentId.length >0;
         WebModule module = new WebModule(standAlone, configId, parentId, moduleFile, targetPath, webApp, jettyWebApp, specDD, contextRoot, portMap);
         return module;
     }
@@ -382,6 +383,7 @@
     }
 
     public void installModule(JarFile earFile, EARContext earContext, Module module) throws DeploymentException {
+        earContext.addParentId(defaultParentId);
         try {
             URI baseDir = URI.create(module.getTargetPath() + "/");
 
@@ -827,6 +829,10 @@
         }
     }
 
+    public String getSchemaNamespace() {
+        return JETTY_NAMESPACE;
+    }
+
     private ClassLoader getWebClassLoader(EARContext earContext, WebModule webModule, ClassLoader cl, boolean contextPriorityClassLoader) throws DeploymentException {
         getWebClassPath(earContext, webModule);
         URI[] webClassPath = webModule.getWebClasspath();
@@ -1376,11 +1382,11 @@
 
     static {
         GBeanInfoBuilder infoBuilder = new GBeanInfoBuilder(JettyModuleBuilder.class, NameFactory.MODULE_BUILDER);
-        infoBuilder.addAttribute("defaultParentId", URI[].class, true);
-        infoBuilder.addAttribute("defaultSessionTimeoutSeconds", Integer.class, true);
-        infoBuilder.addAttribute("defaultContextPriorityClassloader", boolean.class, true);
-        infoBuilder.addAttribute("defaultWelcomeFiles", List.class, true);
-        infoBuilder.addAttribute("jettyContainerObjectName", ObjectName.class, true);
+        infoBuilder.addAttribute("defaultParentId", URI[].class, true, true);
+        infoBuilder.addAttribute("defaultSessionTimeoutSeconds", Integer.class, true, true);
+        infoBuilder.addAttribute("defaultContextPriorityClassloader", boolean.class, true, true);
+        infoBuilder.addAttribute("defaultWelcomeFiles", List.class, true, true);
+        infoBuilder.addAttribute("jettyContainerObjectName", ObjectName.class, true, true);
         infoBuilder.addReference("DefaultServlets", Object.class);
         infoBuilder.addReference("DefaultFilters", Object.class);
         infoBuilder.addReference("DefaultFilterMappings", Object.class);

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=278940&r1=278939&r2=278940&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 Tue Sep  6 01:20:51 2005
@@ -22,21 +22,20 @@
 import java.io.ObjectOutputStream;
 import java.net.URI;
 import java.net.URL;
+import java.util.Arrays;
+import java.util.Collection;
 import java.util.Collections;
 import java.util.HashSet;
 import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
 import java.util.Set;
-import java.util.Collection;
-
 import javax.management.MalformedObjectNameException;
 import javax.management.ObjectName;
 import javax.naming.Reference;
 import javax.xml.namespace.QName;
 
 import junit.framework.TestCase;
-
 import org.apache.geronimo.common.DeploymentException;
 import org.apache.geronimo.connector.outbound.connectiontracking.ConnectionTrackingCoordinatorGBean;
 import org.apache.geronimo.deployment.DeploymentContext;
@@ -47,12 +46,12 @@
 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.UnavailableWebServiceBuilder;
 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;
@@ -73,9 +72,7 @@
 import org.apache.geronimo.kernel.management.State;
 import org.apache.geronimo.security.SecurityServiceImpl;
 import org.apache.geronimo.system.serverinfo.BasicServerInfo;
-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;
 
 /**
@@ -102,7 +99,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 = new URI[] {URI.create("org/apache/geronimo/Foo")};
+    private List parentId = Arrays.asList(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 +256,7 @@
         kernel.startGBean(configurationManagerName);
         ConfigurationManager configurationManager = (ConfigurationManager) kernel.getProxyManager().createProxy(configurationManagerName, ConfigurationManager.class);
 
-        ObjectName baseConfigName = configurationManager.load(parentId[0]);
+        ObjectName baseConfigName = configurationManager.load((URI) parentId.get(0));
         kernel.startGBean(baseConfigName);
 
         Collection defaultServlets = new HashSet();
@@ -384,7 +381,7 @@
             return null;
         }
 
-        public List listConfiguations() {
+        public List listConfigurations() {
             return null;
         }
 

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=278940&r1=278939&r2=278940&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 Tue Sep  6 01:20:51 2005
@@ -1,9 +1,9 @@
 package org.apache.geronimo.jetty.deployment;
 
 import java.io.File;
+import java.net.URI;
 import java.util.HashSet;
 import java.util.jar.JarFile;
-import java.net.URI;
 import javax.management.ObjectName;
 
 import junit.framework.TestCase;

Modified: geronimo/trunk/modules/jmx-remoting/src/java/org/apache/geronimo/jmxremoting/JMXConnector.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/jmx-remoting/src/java/org/apache/geronimo/jmxremoting/JMXConnector.java?rev=278940&r1=278939&r2=278940&view=diff
==============================================================================
--- geronimo/trunk/modules/jmx-remoting/src/java/org/apache/geronimo/jmxremoting/JMXConnector.java (original)
+++ geronimo/trunk/modules/jmx-remoting/src/java/org/apache/geronimo/jmxremoting/JMXConnector.java Tue Sep  6 01:20:51 2005
@@ -142,8 +142,8 @@
 
     static {
         GBeanInfoBuilder infoFactory = new GBeanInfoBuilder(JMXConnector.class); //TODO just  a gbean?
-        infoFactory.addAttribute("url", String.class, true);
-        infoFactory.addAttribute("applicationConfigName", String.class, true);
+        infoFactory.addAttribute("url", String.class, true, true);
+        infoFactory.addAttribute("applicationConfigName", String.class, true, true);
         infoFactory.addAttribute("kernel", Kernel.class, false);
         infoFactory.addAttribute("objectName", String.class, false);
         infoFactory.addAttribute("classLoader", ClassLoader.class, false);

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=278940&r1=278939&r2=278940&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 Tue Sep  6 01:20:51 2005
@@ -363,24 +363,10 @@
     public synchronized void doStop() throws Exception {
         log.info("Stopping configuration " + id);
 
-        GBeanData[] gbeans = storeCurrentGBeans();
 
         // shutdown the configuration and unload all beans
         shutdown();
 
-        // update the configuation store
-        if (configurationStore != null) {
-            ConfigurationData configurationData = new ConfigurationData();
-            configurationData.setId(id);
-            configurationData.setModuleType(moduleType);
-            configurationData.setDomain(domain);
-            configurationData.setServer(server);
-            configurationData.setParentId(parentId);
-            configurationData.setGBeans(Arrays.asList(gbeans));
-            configurationData.setDependencies(dependencies);
-            configurationData.setClassPath(classPath);
-            configurationStore.updateConfiguration(configurationData);
-        }
     }
 
     private void shutdown() {
@@ -410,6 +396,28 @@
         shutdown();
     }
 
+    public synchronized void saveState() throws Exception {
+        GBeanData[] gbeans = storeCurrentGBeans();
+        // update the configuration store
+        if (configurationStore != null) {
+            ConfigurationData configurationData = new ConfigurationData();
+            configurationData.setId(id);
+            configurationData.setModuleType(moduleType);
+            configurationData.setDomain(domain);
+            configurationData.setServer(server);
+            if (parentId != null && parentId.length > 0) {
+                configurationData.setParentId(Arrays.asList(parentId));
+            } else {
+                configurationData.setParentId(Collections.EMPTY_LIST);
+            }
+            configurationData.setGBeans(Arrays.asList(gbeans));
+            configurationData.setDependencies(dependencies);
+            configurationData.setClassPath(classPath);
+            configurationStore.updateConfiguration(configurationData);
+        }
+
+    }
+
     /**
      * Return the unique id of this Configuration's parent
      *
@@ -626,6 +634,7 @@
 
         infoFactory.addOperation("addGBean", new Class[]{GBeanData.class, boolean.class});
         infoFactory.addOperation("removeGBean", new Class[]{ObjectName.class});
+        infoFactory.addOperation("saveState");
 
         infoFactory.setConstructor(new String[]{
             "kernel",

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=278940&r1=278939&r2=278940&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 Tue Sep  6 01:20:51 2005
@@ -43,7 +43,7 @@
     /**
      * The uri of the parent of this configuration.  May be null.
      */
-    private URI[] parentId;
+    private List 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 List getParentId() {
         return parentId;
     }
 
-    public void setParentId(URI[] parentId) {
+    public void setParentId(List parentId) {
         this.parentId = parentId;
     }
 

Modified: geronimo/trunk/modules/kernel/src/java/org/apache/geronimo/kernel/config/ConfigurationManager.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/kernel/src/java/org/apache/geronimo/kernel/config/ConfigurationManager.java?rev=278940&r1=278939&r2=278940&view=diff
==============================================================================
--- geronimo/trunk/modules/kernel/src/java/org/apache/geronimo/kernel/config/ConfigurationManager.java (original)
+++ geronimo/trunk/modules/kernel/src/java/org/apache/geronimo/kernel/config/ConfigurationManager.java Tue Sep  6 01:20:51 2005
@@ -19,6 +19,7 @@
 import java.io.IOException;
 import java.net.URI;
 import java.util.List;
+import java.util.Collection;
 import javax.management.ObjectName;
 
 /**
@@ -72,4 +73,5 @@
      * @throws NoSuchConfigException if the configuration is now loaded into the kernel
      */
     void unload(URI configID) throws NoSuchConfigException;
+    
 }

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=278940&r1=278939&r2=278940&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 Tue Sep  6 01:20:51 2005
@@ -78,7 +78,7 @@
         for (int i = 0; i < storeSnapshot.size(); i++) {
             ConfigurationStore store = (ConfigurationStore) storeSnapshot.get(i);
             if (storeName.equals(JMXUtil.getObjectName(store.getObjectName()))) {
-                return store.listConfiguations();
+                return store.listConfigurations();
             }
         }
         throw new NoSuchStoreException("No such store: " + storeName);

Modified: geronimo/trunk/modules/kernel/src/java/org/apache/geronimo/kernel/config/ConfigurationStore.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/kernel/src/java/org/apache/geronimo/kernel/config/ConfigurationStore.java?rev=278940&r1=278939&r2=278940&view=diff
==============================================================================
--- geronimo/trunk/modules/kernel/src/java/org/apache/geronimo/kernel/config/ConfigurationStore.java (original)
+++ geronimo/trunk/modules/kernel/src/java/org/apache/geronimo/kernel/config/ConfigurationStore.java Tue Sep  6 01:20:51 2005
@@ -95,7 +95,7 @@
      *
      * @return a List ConfigurationInfo objects
      */
-    List listConfiguations();
+    List listConfigurations();
 
     File createNewConfigurationDir();
 

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=278940&r1=278939&r2=278940&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 Tue Sep  6 01:20:51 2005
@@ -26,10 +26,16 @@
 import java.net.URL;
 import java.net.URLClassLoader;
 import java.util.ArrayList;
+import java.util.Arrays;
 import java.util.Collection;
+import java.util.Collections;
 import java.util.HashMap;
-import java.util.Map;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.LinkedHashMap;
 import java.util.List;
+import java.util.Map;
+import java.util.Set;
 import java.util.jar.JarFile;
 import javax.management.MalformedObjectNameException;
 import javax.management.ObjectName;
@@ -55,6 +61,7 @@
 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.Configuration;
 import org.apache.geronimo.kernel.config.ConfigurationData;
 import org.apache.geronimo.kernel.config.ConfigurationModuleType;
 import org.apache.geronimo.kernel.repository.MissingDependencyException;
@@ -68,7 +75,7 @@
  * @version $Rev$ $Date$
  */
 public class ServiceConfigBuilder implements ConfigurationBuilder {
-    private final URI[] defaultParentId;
+    private final List defaultParentId;
     private final Repository repository;
     private final Kernel kernel;
 
@@ -84,7 +91,8 @@
     }
 
     public ServiceConfigBuilder(URI[] defaultParentId, Repository repository, Collection xmlAttributeBuilders, Collection xmlReferenceBuilders, Kernel kernel) {
-        this.defaultParentId = defaultParentId;
+        this.defaultParentId = defaultParentId == null? Collections.EMPTY_LIST: Arrays.asList(defaultParentId);
+
         this.repository = repository;
         this.kernel = kernel;
         if (xmlAttributeBuilders != null) {
@@ -163,8 +171,8 @@
     }
 
     public ConfigurationData buildConfiguration(ConfigurationType configType, String domain, String server, File outfile) throws DeploymentException, IOException {
-        URI[] parentID = getParentID(configType.getParentId(), configType.getImportArray());
-        if (parentID == null) {
+        List parentID = getParentID(configType.getParentId(), configType.getImportArray());
+        if (parentID == null || parentID.size() == 0) {
             if (configType.isSetDomain()) {
                 if (!configType.isSetServer()) {
                     throw new DeploymentException("You must set both domain and server");
@@ -204,7 +212,7 @@
         return context.getConfigurationData();
     }
 
-    public static URI[] getParentID(String parentIDString, DependencyType[] imports) throws DeploymentException {
+    public static List getParentID(String parentIDString, DependencyType[] imports) throws DeploymentException {
         List uris = new ArrayList();
         if (parentIDString != null) {
             try {
@@ -213,15 +221,14 @@
                 throw new DeploymentException("Invalid parentId " + parentIDString, e);
             }
         } else if (imports.length == 0) {
-            return null;
+            return new ArrayList();
         }
         for (int i = 0; i < imports.length; i++) {
             DependencyType anImport = imports[i];
             URI parentURI = getDependencyURI(anImport);
             uris.add(parentURI);
         }
-        URI[] parentID = (URI[]) uris.toArray(new URI[uris.size()]);
-        return parentID;
+        return uris;
     }
 
     public static void addIncludes(DeploymentContext context, DependencyType[] includes, Repository repository) throws DeploymentException {

Modified: geronimo/trunk/modules/service-builder/src/test/org/apache/geronimo/deployment/service/ParentIDTest.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/service-builder/src/test/org/apache/geronimo/deployment/service/ParentIDTest.java?rev=278940&r1=278939&r2=278940&view=diff
==============================================================================
--- geronimo/trunk/modules/service-builder/src/test/org/apache/geronimo/deployment/service/ParentIDTest.java (original)
+++ geronimo/trunk/modules/service-builder/src/test/org/apache/geronimo/deployment/service/ParentIDTest.java Tue Sep  6 01:20:51 2005
@@ -17,6 +17,7 @@
 package org.apache.geronimo.deployment.service;
 
 import java.net.URI;
+import java.util.List;
 
 import junit.framework.TestCase;
 import org.apache.geronimo.deployment.xbeans.DependencyType;
@@ -27,21 +28,21 @@
 public class ParentIDTest extends TestCase {
 
     public void testNoParents() throws Exception {
-        URI[] parentId = ServiceConfigBuilder.getParentID(null, new DependencyType[] {});
-        assertNull(parentId);
+        List parentId = ServiceConfigBuilder.getParentID(null, new DependencyType[] {});
+        assertEquals(0, parentId.size());
     }
 
     public void testAttributeParent() throws Exception {
-        URI[] parentId = ServiceConfigBuilder.getParentID("attribute", new DependencyType[] {});
-        assertEquals(1, parentId.length);
+        List parentId = ServiceConfigBuilder.getParentID("attribute", new DependencyType[] {});
+        assertEquals(1, parentId.size());
     }
 
     public void testImportParent1() throws Exception {
         DependencyType anImport = DependencyType.Factory.newInstance();
         anImport.setUri("import");
-        URI[] parentId = ServiceConfigBuilder.getParentID(null, new DependencyType[] {anImport});
-        assertEquals(1, parentId.length);
-        assertEquals("import", parentId[0].getPath());
+        List parentId = ServiceConfigBuilder.getParentID(null, new DependencyType[] {anImport});
+        assertEquals(1, parentId.size());
+        assertEquals("import", ((URI)parentId.get(0)).getPath());
     }
 
     public void testImportParent2() throws Exception {
@@ -50,9 +51,9 @@
         anImport.setType("type");
         anImport.setArtifactId("artifactId");
         anImport.setVersion("version");
-        URI[] parentId = ServiceConfigBuilder.getParentID(null, new DependencyType[] {anImport});
-        assertEquals(1, parentId.length);
-        assertEquals("groupId/types/artifactId-version.type", parentId[0].getPath());
+        List parentId = ServiceConfigBuilder.getParentID(null, new DependencyType[] {anImport});
+        assertEquals(1, parentId.size());
+        assertEquals("groupId/types/artifactId-version.type", ((URI)parentId.get(0)).getPath());
     }
 
     public void testBothParent() throws Exception {
@@ -60,11 +61,11 @@
         import1.setUri("import1");
         DependencyType import2 = DependencyType.Factory.newInstance();
         import2.setUri("import2");
-        URI[] parentId = ServiceConfigBuilder.getParentID("attribute", new DependencyType[] {import1, import2});
-        assertEquals(3, parentId.length);
-        assertEquals("attribute", parentId[0].getPath());
-        assertEquals("import1", parentId[1].getPath());
-        assertEquals("import2", parentId[2].getPath());
+        List parentId = ServiceConfigBuilder.getParentID("attribute", new DependencyType[] {import1, import2});
+        assertEquals(3, parentId.size());
+        assertEquals("attribute", ((URI)parentId.get(0)).getPath());
+        assertEquals("import1", ((URI)parentId.get(1)).getPath());
+        assertEquals("import2", ((URI)parentId.get(2)).getPath());
     }
 
 

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=278940&r1=278939&r2=278940&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 Tue Sep  6 01:20:51 2005
@@ -20,6 +20,9 @@
 import java.net.URL;
 import java.io.File;
 import java.util.ArrayList;
+import java.util.List;
+import java.util.Arrays;
+import java.util.Set;
 import javax.management.ObjectName;
 import junit.framework.TestCase;
 import org.apache.geronimo.deployment.xbeans.ConfigurationDocument;
@@ -40,12 +43,15 @@
  */
 public class ServiceConfigBuilderTest extends TestCase {
 
+    private URI[] parentIdArray = new URI[] {URI.create("test/foo")};
+    private List parentId = Arrays.asList(parentIdArray);
+
     public void testJavaBeanXmlAttribute() throws Exception {
         ReferenceCollection referenceCollection = new MockReferenceCollection();
         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(new URI[] {URI.create("test/foo")}, null, referenceCollection, null, null);
+        new ServiceConfigBuilder(parentIdArray, null, referenceCollection, null, null);
         ClassLoader cl = Thread.currentThread().getContextClassLoader();
         URL plan1 = cl.getResource("services/plan1.xml");
         ConfigurationDocument doc = ConfigurationDocument.Factory.parse(plan1);
@@ -56,13 +62,14 @@
             fail("could not create temp dir");
         }
         try {
-            DeploymentContext context = new DeploymentContext(outFile, URI.create("foo/bar"), ConfigurationModuleType.SERVICE, new URI[] {URI.create("foo")}, "domain", "server", null);
+            DeploymentContext context = new DeploymentContext(outFile, URI.create("foo/bar"), ConfigurationModuleType.SERVICE, parentId, "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);
-            GBeanData[] beanDatas = context.getGBeans();
-            assertEquals(1, beanDatas.length);
-            GBeanData data = beanDatas[0];
+            Set beanDatas = context.listGBeans(new ObjectName("*:*"));
+            assertEquals(1, beanDatas.size());
+            ObjectName beanName = (ObjectName) beanDatas.iterator().next();
+            GBeanData data = context.getGBeanInstance(beanName); 
             FooBarBean fooBarBean = (FooBarBean) data.getAttribute("fooBarBean");
             assertNotNull(fooBarBean);
             assertEquals("foo", fooBarBean.getFoo());

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=278940&r1=278939&r2=278940&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 Tue Sep  6 01:20:51 2005
@@ -24,6 +24,8 @@
 import java.net.URISyntaxException;
 import java.util.Enumeration;
 import java.util.Properties;
+import java.util.List;
+import java.util.ArrayList;
 import java.util.jar.JarFile;
 import java.util.zip.ZipEntry;
 
@@ -52,7 +54,7 @@
 public class ServiceMixConfigBuilder implements ConfigurationBuilder {
     private static final Log log = LogFactory.getLog(ServiceMixConfigBuilder.class);
 
-    private final URI[] defaultParentId;
+    private final List defaultParentId;
     private final Repository repository;
     private final Kernel kernel;
     private String deploymentDependencies;
@@ -62,7 +64,7 @@
     static {
         GBeanInfoBuilder infoFactory = new GBeanInfoBuilder(ServiceMixConfigBuilder.class, NameFactory.CONFIG_BUILDER);
         infoFactory.addInterface(ConfigurationBuilder.class);
-        infoFactory.addAttribute("defaultParentId", URI[].class, true);
+        infoFactory.addAttribute("defaultParentId", List.class, true);
         infoFactory.addAttribute("deploymentDependencies", String.class, true);
         infoFactory.addReference("Repository", Repository.class, NameFactory.GERONIMO_SERVICE);
         infoFactory.addAttribute("kernel", Kernel.class, false);
@@ -74,11 +76,11 @@
         return GBEAN_INFO;
     }
 
-    public ServiceMixConfigBuilder(URI[] defaultParentId, Repository repository) {
+    public ServiceMixConfigBuilder(List defaultParentId, Repository repository) {
         this(defaultParentId, repository, null);
     }
 
-    public ServiceMixConfigBuilder(URI[] defaultParentId, Repository repository, Kernel kernel) {
+    public ServiceMixConfigBuilder(List defaultParentId, Repository repository, Kernel kernel) {
         this.defaultParentId = defaultParentId;
         this.repository = repository;
         this.kernel = kernel;
@@ -124,7 +126,7 @@
         log.debug("Installing ServiceMix deployment.");
         Properties properties = (Properties) plan;
 
-        URI[] parentID = defaultParentId;
+        List parentID = new ArrayList(defaultParentId);
         URI configID;
         try {
             configID = new URI(properties.getProperty("configID"));

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=278940&r1=278939&r2=278940&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 Tue Sep  6 01:20:51 2005
@@ -54,10 +54,10 @@
 
   protected final Kernel     _kernel;
   protected final Repository _repository;
-  protected final URI[]        _defaultParentId;
+  protected final List        _defaultParentId;
 
   public
-    SPRConfigBuilder(URI[] defaultParentId, Repository repository, Kernel kernel)
+    SPRConfigBuilder(List 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" , List.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
+      List parentId= new ArrayList(_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=278940&r1=278939&r2=278940&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 Tue Sep  6 01:20:51 2005
@@ -18,6 +18,7 @@
 
 import java.io.File;
 import java.net.URI;
+import java.util.List;
 import javax.management.MalformedObjectNameException;
 
 import org.apache.geronimo.common.DeploymentException;
@@ -32,8 +33,8 @@
   extends DeploymentContext
 {
   public
-    SPRContext(File baseDir, URI id, ConfigurationModuleType moduleType, URI[] parentID, Kernel kernel)
-    throws MalformedObjectNameException, DeploymentException
+    SPRContext(File baseDir, URI id, ConfigurationModuleType moduleType, List parentID, Kernel kernel)
+    throws 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=278940&r1=278939&r2=278940&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 Tue Sep  6 01:20:51 2005
@@ -28,8 +28,7 @@
 import java.util.Collections;
 import java.util.Iterator;
 import java.util.LinkedList;
-import java.util.Set;
-import java.util.HashSet;
+import java.util.List;
 import java.util.jar.JarOutputStream;
 import java.util.jar.Manifest;
 import java.util.zip.ZipEntry;
@@ -139,11 +138,11 @@
             if (out != null) {
                 try {
                     out.flush();
-                } catch(Exception ignored) {
+                } catch (Exception ignored) {
                 }
                 try {
                     out.close();
-                } catch(Exception ignored) {
+                } catch (Exception ignored) {
                 }
             }
         }
@@ -158,9 +157,9 @@
             config.setAttribute("domain", configurationData.getDomain());
             config.setAttribute("server", configurationData.getServer());
 
-            URI[] parentId = configurationData.getParentId();
-            if (parentId != null) {
-                config.setAttribute("parentId", parentId);
+            List parentId = configurationData.getParentId();
+            if (parentId.size() > 0) {
+                config.setAttribute("parentId", parentId.toArray(new URI[parentId.size()]));
             }
 
             config.setAttribute("gBeanState", Configuration.storeGBeans(configurationData.getGBeans()));

Modified: geronimo/trunk/modules/system/src/java/org/apache/geronimo/system/configuration/LocalAttributeManager.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/system/src/java/org/apache/geronimo/system/configuration/LocalAttributeManager.java?rev=278940&r1=278939&r2=278940&view=diff
==============================================================================
--- geronimo/trunk/modules/system/src/java/org/apache/geronimo/system/configuration/LocalAttributeManager.java (original)
+++ geronimo/trunk/modules/system/src/java/org/apache/geronimo/system/configuration/LocalAttributeManager.java Tue Sep  6 01:20:51 2005
@@ -84,7 +84,7 @@
     }
 
     public Object getValue(String configurationName, ObjectName gbean, GAttributeInfo attribute) {
-        log.info("Checking value for "+configurationName+"/"+gbean+"/"+attribute.getName());
+        log.debug("Checking value for "+configurationName+"/"+gbean+"/"+attribute.getName());
         Map config = (Map) configurations.get(configurationName);
         if(config == null) {
             return null; // nothing specified for this configuration
@@ -107,6 +107,7 @@
                 return null;
             }
             editor.setAsText(value);
+            log.info("Setting value for "+configurationName+"/"+gbean+"/" + attribute.getName() + " to value " + value);
             return editor.getValue();
         } catch (ClassNotFoundException e) {
             //todo: use the Configuration's ClassLoader to load the attribute, if this ever becomes an issue

Modified: geronimo/trunk/modules/system/src/java/org/apache/geronimo/system/configuration/LocalConfigStore.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/system/src/java/org/apache/geronimo/system/configuration/LocalConfigStore.java?rev=278940&r1=278939&r2=278940&view=diff
==============================================================================
--- geronimo/trunk/modules/system/src/java/org/apache/geronimo/system/configuration/LocalConfigStore.java (original)
+++ geronimo/trunk/modules/system/src/java/org/apache/geronimo/system/configuration/LocalConfigStore.java Tue Sep  6 01:20:51 2005
@@ -305,7 +305,7 @@
         }
     }
 
-    public List listConfiguations() {
+    public List listConfigurations() {
         List configs;
         synchronized (this) {
             configs = new ArrayList(index.size());

Modified: geronimo/trunk/modules/system/src/test/org/apache/geronimo/system/configuration/LocalConfigStoreTest.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/system/src/test/org/apache/geronimo/system/configuration/LocalConfigStoreTest.java?rev=278940&r1=278939&r2=278940&view=diff
==============================================================================
--- geronimo/trunk/modules/system/src/test/org/apache/geronimo/system/configuration/LocalConfigStoreTest.java (original)
+++ geronimo/trunk/modules/system/src/test/org/apache/geronimo/system/configuration/LocalConfigStoreTest.java Tue Sep  6 01:20:51 2005
@@ -92,6 +92,7 @@
         kernel.setAttribute(gbeanName1, "value", "9900990099");
         assertEquals("9900990099", kernel.getAttribute(gbeanName1, "value"));
 
+        kernel.invoke(configName, "saveState");
         // stop and unload the config
         kernel.stopGBean(configName);
         kernel.unloadGBean(configName);

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=278940&r1=278939&r2=278940&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 Tue Sep  6 01:20:51 2005
@@ -34,6 +34,9 @@
 import java.util.Iterator;
 import java.util.Map;
 import java.util.Set;
+import java.util.List;
+import java.util.ArrayList;
+import java.util.Arrays;
 import java.util.jar.JarFile;
 import java.util.zip.ZipEntry;
 
@@ -50,6 +53,7 @@
 import org.apache.geronimo.deployment.util.DeploymentUtil;
 import org.apache.geronimo.deployment.xbeans.DependencyType;
 import org.apache.geronimo.deployment.xbeans.GbeanType;
+import org.apache.geronimo.deployment.DeploymentContext;
 import org.apache.geronimo.gbean.GBeanData;
 import org.apache.geronimo.gbean.GBeanInfo;
 import org.apache.geronimo.gbean.GBeanInfoBuilder;
@@ -62,6 +66,7 @@
 import org.apache.geronimo.j2ee.j2eeobjectnames.J2eeContextImpl;
 import org.apache.geronimo.j2ee.j2eeobjectnames.NameFactory;
 import org.apache.geronimo.kernel.StoredObject;
+import org.apache.geronimo.kernel.Kernel;
 import org.apache.geronimo.kernel.repository.Repository;
 import org.apache.geronimo.naming.deployment.ENCConfigBuilder;
 import org.apache.geronimo.naming.deployment.GBeanResourceEnvironmentBuilder;
@@ -104,26 +109,32 @@
  */
 public class TomcatModuleBuilder implements ModuleBuilder {
 
-    private final URI[] defaultParentId;
+    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");
+
+    private final List defaultParentId;
     private final boolean defaultContextPriorityClassloader;
     private final ObjectName tomcatContainerObjectName;
 
     private final WebServiceBuilder webServiceBuilder;
 
     private final Repository repository;
-    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");
+    private final Kernel kernel;
+    private static final String TOMCAT_NAMESPACE = TOMCAT_CONFIG_NAMESPACE;//OpenejbOpenejbJarDocument.type.getDocumentElementName().getNamespaceURI();
 
     public TomcatModuleBuilder(URI[] defaultParentId,
                                boolean defaultContextPriorityClassloader,
                                ObjectName tomcatContainerObjectName,
                                WebServiceBuilder webServiceBuilder,
-                               Repository repository) {
-        this.defaultParentId = defaultParentId;
+                               Repository repository,
+                               Kernel kernel) {
+        this.defaultParentId = defaultParentId == null? Collections.EMPTY_LIST: Arrays.asList(defaultParentId);
+
         this.defaultContextPriorityClassloader = defaultContextPriorityClassloader;
         this.tomcatContainerObjectName = tomcatContainerObjectName;
         this.webServiceBuilder = webServiceBuilder;
         this.repository = repository;
+        this.kernel = kernel;
     }
 
     public Module createModule(File plan, JarFile moduleFile) throws DeploymentException {
@@ -177,9 +188,9 @@
             throw new DeploymentException("Invalid configId " + tomcatWebApp.getConfigId(), e);
         }
 
-        URI[] parentId = ServiceConfigBuilder.getParentID(tomcatWebApp.getParentId(), tomcatWebApp.getImportArray());
-        if (parentId == null) {
-            parentId = defaultParentId;
+        List parentId = ServiceConfigBuilder.getParentID(tomcatWebApp.getParentId(), tomcatWebApp.getImportArray());
+        if (parentId.isEmpty()) {
+            parentId = new ArrayList(defaultParentId);
         }
 
         if (contextRoot == null) {
@@ -205,6 +216,7 @@
     /**
      * Some servlets will have multiple url patterns.  However, webservice servlets
      * will only have one, which is what this method is intended for.
+     *
      * @param webApp
      * @param contextRoot
      * @return
@@ -292,6 +304,7 @@
     }
 
     public void installModule(JarFile earFile, EARContext earContext, Module module) throws DeploymentException {
+        earContext.addParentId(defaultParentId);
         try {
             URI baseDir = URI.create(module.getTargetPath() + "/");
 
@@ -401,7 +414,7 @@
                     throw new DeploymentException("More than one tomcat config: " + anys);
                 }
                 if (anys.length == 1) {
-                    GerTomcatConfigType tomcatConfig = (GerTomcatConfigType)anys[0].copy().changeType(GerTomcatConfigType.type);
+                    GerTomcatConfigType tomcatConfig = (GerTomcatConfigType) anys[0].copy().changeType(GerTomcatConfigType.type);
                     if (tomcatConfig.isSetHost()) {
                         String virtualServer = tomcatConfig.getHost().trim();
                         webModuleData.setAttribute("virtualServer", virtualServer);
@@ -463,7 +476,7 @@
                 SecurityHolder securityHolder = new SecurityHolder();
                 securityHolder.setSecurityRealm(tomcatWebApp.getSecurityRealmName().trim());
 
-                if (tomcatWebApp.isSetSecurity()){
+                if (tomcatWebApp.isSetSecurity()) {
 
                     securityHolder.setSecurity(true);
                     /**
@@ -485,8 +498,8 @@
                     securityHolder.setChecked(checkedPermissions);
                     earContext.addSecurityContext(policyContextID, componentPermissions);
 //                    if (tomcatWebApp.isSetSecurity()) {
-                        SecurityConfiguration securityConfiguration = SecurityBuilder.buildSecurityConfiguration(tomcatWebApp.getSecurity());
-                        earContext.setSecurityConfiguration(securityConfiguration);
+                    SecurityConfiguration securityConfiguration = SecurityBuilder.buildSecurityConfiguration(tomcatWebApp.getSecurity());
+                    earContext.setSecurityConfiguration(securityConfiguration);
 //                    }
                     DefaultPrincipal defaultPrincipal = earContext.getSecurityConfiguration().getDefaultPrincipal();
                     securityHolder.setDefaultPrincipal(defaultPrincipal);
@@ -505,6 +518,10 @@
         }
     }
 
+    public String getSchemaNamespace() {
+        return TOMCAT_NAMESPACE;
+    }
+
     private ClassLoader getWebClassLoader(EARContext earContext, WebModule webModule, ClassLoader cl, boolean contextPriorityClassLoader) throws DeploymentException {
         getWebClassPath(earContext, webModule);
         URI[] webClassPath = webModule.getWebClasspath();
@@ -929,19 +946,21 @@
 
     static {
         GBeanInfoBuilder infoBuilder = new GBeanInfoBuilder(TomcatModuleBuilder.class, NameFactory.MODULE_BUILDER);
-        infoBuilder.addAttribute("defaultParentId", URI[].class, true);
-        infoBuilder.addAttribute("defaultContextPriorityClassloader", boolean.class, true);
-        infoBuilder.addAttribute("tomcatContainerObjectName", ObjectName.class, true);
+        infoBuilder.addAttribute("defaultParentId", URI[].class, true, true);
+        infoBuilder.addAttribute("defaultContextPriorityClassloader", boolean.class, true, true);
+        infoBuilder.addAttribute("tomcatContainerObjectName", ObjectName.class, true, true);
         infoBuilder.addReference("WebServiceBuilder", WebServiceBuilder.class, NameFactory.MODULE_BUILDER);
         infoBuilder.addReference("Repository", Repository.class, NameFactory.GERONIMO_SERVICE);
         infoBuilder.addInterface(ModuleBuilder.class);
+        infoBuilder.addAttribute("kernel", Kernel.class, false);
 
         infoBuilder.setConstructor(new String[]{
             "defaultParentId",
             "defaultContextPriorityClassloader",
             "tomcatContainerObjectName",
             "WebServiceBuilder",
-            "Repository"});
+            "Repository",
+            "kernel"});
         GBEAN_INFO = infoBuilder.getBeanInfo();
     }
 

Modified: geronimo/trunk/modules/tomcat-builder/src/test/org/apache/geronimo/tomcat/deployment/PlanParsingTest.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/tomcat-builder/src/test/org/apache/geronimo/tomcat/deployment/PlanParsingTest.java?rev=278940&r1=278939&r2=278940&view=diff
==============================================================================
--- geronimo/trunk/modules/tomcat-builder/src/test/org/apache/geronimo/tomcat/deployment/PlanParsingTest.java (original)
+++ geronimo/trunk/modules/tomcat-builder/src/test/org/apache/geronimo/tomcat/deployment/PlanParsingTest.java Tue Sep  6 01:20:51 2005
@@ -5,6 +5,7 @@
 
 import junit.framework.TestCase;
 import org.apache.geronimo.kernel.jmx.JMXUtil;
+import org.apache.geronimo.kernel.Kernel;
 import org.apache.geronimo.schema.SchemaConversionUtils;
 import org.apache.geronimo.xbeans.geronimo.naming.GerResourceRefType;
 import org.apache.geronimo.xbeans.geronimo.web.GerWebAppType;
@@ -14,8 +15,13 @@
  */
 public class PlanParsingTest extends TestCase {
     ObjectName tomcatContainerObjectName = JMXUtil.getObjectName("test:type=TomcatContainer");
-    private TomcatModuleBuilder builder = new TomcatModuleBuilder(null, false, tomcatContainerObjectName, null, null);
+    Kernel kernel = null;
+    private TomcatModuleBuilder builder;
     private File basedir = new File(System.getProperty("basedir", "."));
+
+    protected void setUp() throws Exception {
+        builder = new TomcatModuleBuilder(null, false, tomcatContainerObjectName, null, null, kernel);
+    }
 
     public void testResourceRef() throws Exception {
         File resourcePlan = new File(basedir, "src/test-resources/plans/plan1.xml");

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=278940&r1=278939&r2=278940&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 Tue Sep  6 01:20:51 2005
@@ -32,6 +32,7 @@
 import java.util.List;
 import java.util.Map;
 import java.util.Set;
+import java.util.Arrays;
 import javax.management.MalformedObjectNameException;
 import javax.management.ObjectName;
 import javax.naming.Reference;
@@ -139,7 +140,7 @@
 
     private File basedir = new File(System.getProperty("basedir", "."));
 
-    private URI[] parentId = new URI[] {URI.create("org/apache/geronimo/Foo")};
+    private List parentId = Arrays.asList(new URI[] {URI.create("org/apache/geronimo/Foo")});
 
     public void testDeployWar4() throws Exception {
         deployWar("war4", "org/apache/geronimo/test");
@@ -362,7 +363,7 @@
         kernel.startGBean(configurationManagerName);
         ConfigurationManager configurationManager = (ConfigurationManager) kernel.getProxyManager().createProxy(configurationManagerName, ConfigurationManager.class);
 
-        ObjectName baseConfigName = configurationManager.load(parentId[0]);
+        ObjectName baseConfigName = configurationManager.load((URI) parentId.get(0));
         kernel.startGBean(baseConfigName);
 
         serverInfoName = new ObjectName("geronimo.system:name=ServerInfo");
@@ -384,7 +385,7 @@
 
         WebServiceBuilder webServiceBuilder = new AxisBuilder();
 
-        builder = new TomcatModuleBuilder(new URI[] {new URI("null")}, false, containerName, webServiceBuilder, null);
+        builder = new TomcatModuleBuilder(new URI[] {new URI("null")}, false, containerName, webServiceBuilder, null, kernel);
 
         // Default Realm
         Map initParams = new HashMap();
@@ -522,7 +523,7 @@
             return null;
         }
 
-        public List listConfiguations() {
+        public List listConfigurations() {
             return null;
         }
 

Modified: geronimo/trunk/plugins/geronimo-packaging-plugin/src/java/org/apache/geronimo/plugin/packaging/MavenConfigStore.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/plugins/geronimo-packaging-plugin/src/java/org/apache/geronimo/plugin/packaging/MavenConfigStore.java?rev=278940&r1=278939&r2=278940&view=diff
==============================================================================
--- geronimo/trunk/plugins/geronimo-packaging-plugin/src/java/org/apache/geronimo/plugin/packaging/MavenConfigStore.java (original)
+++ geronimo/trunk/plugins/geronimo-packaging-plugin/src/java/org/apache/geronimo/plugin/packaging/MavenConfigStore.java Tue Sep  6 01:20:51 2005
@@ -47,7 +47,7 @@
  */
 public class MavenConfigStore implements ConfigurationStore {
     private final Kernel kernel;
-    private final ObjectName objectName;
+    private final ObjectName objectN ame;
     private final Repository repository;
     private final ManageableAttributeStore attributeStore;
 



Mime
View raw message