geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From djen...@apache.org
Subject svn commit: r380190 [2/3] - in /geronimo/branches/configid: applications/console-core/src/java/org/apache/geronimo/console/util/ applications/console-standard/src/java/org/apache/geronimo/console/databasemanager/wizard/ applications/console-standard/sr...
Date Thu, 23 Feb 2006 18:30:21 GMT
Modified: geronimo/branches/configid/modules/connector-builder/src/test/org/apache/geronimo/connector/deployment/ConnectorModuleBuilderTest.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/configid/modules/connector-builder/src/test/org/apache/geronimo/connector/deployment/ConnectorModuleBuilderTest.java?rev=380190&r1=380189&r2=380190&view=diff
==============================================================================
--- geronimo/branches/configid/modules/connector-builder/src/test/org/apache/geronimo/connector/deployment/ConnectorModuleBuilderTest.java (original)
+++ geronimo/branches/configid/modules/connector-builder/src/test/org/apache/geronimo/connector/deployment/ConnectorModuleBuilderTest.java Thu Feb 23 10:30:08 2006
@@ -21,7 +21,6 @@
 import org.apache.geronimo.common.DeploymentException;
 import org.apache.geronimo.connector.outbound.connectiontracking.ConnectionTrackingCoordinatorGBean;
 import org.apache.geronimo.deployment.DeploymentContext;
-import org.apache.geronimo.kernel.repository.Environment;
 import org.apache.geronimo.deployment.util.DeploymentUtil;
 import org.apache.geronimo.gbean.GBeanData;
 import org.apache.geronimo.gbean.GBeanInfo;
@@ -52,9 +51,10 @@
 import org.apache.geronimo.kernel.jmx.JMXUtil;
 import org.apache.geronimo.kernel.management.State;
 import org.apache.geronimo.kernel.repository.Artifact;
-import org.apache.geronimo.kernel.repository.Repository;
-import org.apache.geronimo.kernel.repository.DefaultArtifactResolver;
 import org.apache.geronimo.kernel.repository.DefaultArtifactManager;
+import org.apache.geronimo.kernel.repository.DefaultArtifactResolver;
+import org.apache.geronimo.kernel.repository.Environment;
+import org.apache.geronimo.kernel.repository.Repository;
 import org.apache.geronimo.system.configuration.ExecutableConfigurationUtil;
 import org.apache.geronimo.system.serverinfo.BasicServerInfo;
 import org.tranql.sql.jdbc.JDBCUtil;
@@ -75,10 +75,10 @@
 import java.sql.Statement;
 import java.util.Collections;
 import java.util.Iterator;
+import java.util.LinkedHashSet;
 import java.util.List;
 import java.util.Map;
 import java.util.Set;
-import java.util.LinkedHashSet;
 import java.util.jar.JarFile;
 
 /**
@@ -368,7 +368,7 @@
                 action.install(moduleBuilder, earContext, module, configurationStore);
                 earContext.getClassLoader(null);
                 moduleBuilder.initContext(earContext, module, cl);
-                moduleBuilder.addGBeans(earContext, module, cl);
+                moduleBuilder.addGBeans(earContext, module, cl, repository);
                 earContext.close();
 
                 verifyDeployment(earContext.getConfigurationData(), tempDir, oldCl, j2eeContext, resourceAdapterName, is15);
@@ -432,7 +432,6 @@
             assertRunning(kernel, j2eeServerObjectName);
 
             // load the configuration
-            config.setAttribute("baseURL", unpackedDir.toURL());
             kernel.loadGBean(config, cl);
             kernel.startGBean(configName);
             kernel.invoke(configName, "loadGBeans", new Object[]{null}, new String[]{ManageableAttributeStore.class.getName()});
@@ -605,17 +604,13 @@
             this.kernel = kernel;
         }
 
-        public Artifact install(URL source) throws IOException, InvalidConfigException {
-            return null;
-        }
-
         public void install(ConfigurationData configurationData) throws IOException, InvalidConfigException {
         }
 
         public void uninstall(Artifact configID) throws NoSuchConfigException, IOException {
         }
 
-        public ObjectName loadConfiguration(Artifact configId) throws NoSuchConfigException, IOException, InvalidConfigException {
+        public GBeanData loadConfiguration(Artifact configId) throws NoSuchConfigException, IOException, InvalidConfigException {
             ObjectName configurationObjectName = Configuration.getConfigurationObjectName(configId);
             GBeanData configData = new GBeanData(configurationObjectName, Configuration.GBEAN_INFO);
             Environment environment = new Environment();
@@ -624,13 +619,8 @@
             configData.setAttribute("environment", environment);
             configData.setAttribute("gBeanState", NO_OBJECTS_OS);
 
-            try {
-                kernel.loadGBean(configData, Configuration.class.getClassLoader());
-            } catch (Exception e) {
-                throw new InvalidConfigException("Unable to register configuration", e);
-            }
 
-            return configurationObjectName;
+            return configData;
         }
 
         public boolean containsConfiguration(Artifact configID) {

Modified: geronimo/branches/configid/modules/deploy-tool/src/java/org/apache/geronimo/deployment/PluginBootstrap.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/configid/modules/deploy-tool/src/java/org/apache/geronimo/deployment/PluginBootstrap.java?rev=380190&r1=380189&r2=380190&view=diff
==============================================================================
--- geronimo/branches/configid/modules/deploy-tool/src/java/org/apache/geronimo/deployment/PluginBootstrap.java (original)
+++ geronimo/branches/configid/modules/deploy-tool/src/java/org/apache/geronimo/deployment/PluginBootstrap.java Thu Feb 23 10:30:08 2006
@@ -16,18 +16,10 @@
  */
 package org.apache.geronimo.deployment;
 
-import java.io.File;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.util.jar.JarOutputStream;
-import java.util.List;
-import java.net.URL;
-import java.net.URI;
-import java.net.MalformedURLException;
-
 import org.apache.geronimo.deployment.service.ServiceConfigBuilder;
 import org.apache.geronimo.deployment.xbeans.ConfigurationDocument;
 import org.apache.geronimo.deployment.xbeans.ConfigurationType;
+import org.apache.geronimo.gbean.GBeanData;
 import org.apache.geronimo.kernel.config.ConfigurationData;
 import org.apache.geronimo.kernel.config.ConfigurationStore;
 import org.apache.geronimo.kernel.config.InvalidConfigException;
@@ -36,7 +28,14 @@
 import org.apache.geronimo.system.configuration.ExecutableConfigurationUtil;
 import org.apache.geronimo.system.repository.Maven1Repository;
 
-import javax.management.ObjectName;
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.net.MalformedURLException;
+import java.net.URI;
+import java.net.URL;
+import java.util.List;
+import java.util.jar.JarOutputStream;
 
 /**
  * @version $Rev$ $Date$
@@ -70,17 +69,13 @@
         ServiceConfigBuilder builder = new ServiceConfigBuilder(null, repository);
         ConfigurationData configurationData = builder.buildConfiguration(config, null, new ConfigurationStore() {
 
-            public Artifact install(URL source) throws IOException, InvalidConfigException {
-                return null;
-            }
-
             public void install(ConfigurationData configurationData) throws IOException, InvalidConfigException {
             }
 
             public void uninstall(Artifact configID) throws NoSuchConfigException, IOException {
             }
 
-            public ObjectName loadConfiguration(Artifact configId) throws NoSuchConfigException, IOException, InvalidConfigException {
+            public GBeanData loadConfiguration(Artifact configId) throws NoSuchConfigException, IOException, InvalidConfigException {
                 return null;
             }
 

Modified: geronimo/branches/configid/modules/deployment/src/java/org/apache/geronimo/deployment/DeploymentContext.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/configid/modules/deployment/src/java/org/apache/geronimo/deployment/DeploymentContext.java?rev=380190&r1=380189&r2=380190&view=diff
==============================================================================
--- geronimo/branches/configid/modules/deployment/src/java/org/apache/geronimo/deployment/DeploymentContext.java (original)
+++ geronimo/branches/configid/modules/deployment/src/java/org/apache/geronimo/deployment/DeploymentContext.java Thu Feb 23 10:30:08 2006
@@ -102,8 +102,7 @@
         this.baseUri = baseDir.toURI();
 
         determineNaming();
-        determineInherited();
-        determineMinimalParents();
+        setupParents();
     }
 
     private void determineNaming() throws DeploymentException {
@@ -147,48 +146,6 @@
         }
     }
 
-    private void determineInherited() throws DeploymentException {
-        if (null == kernel) {
-            return;
-        }
-
-        Collection parentId = environment.getImports();
-        if (parentId != null && parentId.size() > 0) {
-            ConfigurationManager configurationManager = ConfigurationUtil.getConfigurationManager(kernel);
-            List inherited = new ArrayList();
-            try {
-                for (Iterator iterator = parentId.iterator(); iterator.hasNext();) {
-                    Artifact parent = (Artifact) iterator.next();
-                    //TODO configid
-                    ObjectName parentName = Configuration.getConfigurationObjectName(parent);
-                    boolean loaded = false;
-                    try {
-                        if (!configurationManager.isLoaded(parent)) {
-                            parentName = configurationManager.load(parent);
-                            loaded = true;
-                        }
-
-                        Environment environment = (Environment) kernel.getAttribute(parentName, "environment");
-                        Set nonOverridableClasses = environment.getNonOverrideableClasses();
-                        for (Iterator iterator1 = nonOverridableClasses.iterator(); iterator1.hasNext();) {
-                            String nonOverridableClass = (String) iterator1.next();
-                            inherited.add(nonOverridableClass);
-                        }
-                    } finally {
-                        if (loaded) {
-                            configurationManager.unload(parent);
-                        }
-                    }
-                }
-            } catch (DeploymentException e) {
-                throw e;
-            } catch (Exception e) {
-                throw new DeploymentException(e);
-            }
-            environment.addNonOverrideableClasses(inherited);
-        }
-    }
-
     public Artifact getConfigID() {
         return environment.getConfigId();
     }
@@ -309,7 +266,7 @@
      *                             the manifest
      */
     public void addManifestClassPath(JarFile moduleFile, URI moduleBaseUri) throws DeploymentException {
-        Manifest manifest = null;
+        Manifest manifest;
         try {
             manifest = moduleFile.getManifest();
         } catch (IOException e) {
@@ -486,15 +443,15 @@
 
     }
 
-    private void determineMinimalParents() throws DeploymentException {
+    private void setupParents() throws DeploymentException {
         Collection parentId = environment.getImports();
         if (kernel != null && parentId != null && parentId.size() > 0) {
             ConfigurationManager configurationManager = ConfigurationUtil.getConfigurationManager(kernel);
             try {
                 loadAncestors(kernel, parentId, loadedAncestors, configurationManager);
-                ParentSource parentSource = new ConfigurationParentSource(kernel);
-                parentId = getExtremalSet(parentId, parentSource);
-                environment.setImports(parentId);
+//                ParentSource parentSource = new ConfigurationParentSource(kernel);
+//                parentId = getExtremalSet(parentId, parentSource);
+//                environment.setImports(parentId);
 
                 try {
                     for (Iterator iterator = parentId.iterator(); iterator.hasNext();) {
@@ -553,7 +510,6 @@
                     null,
                     moduleType,
                     environment,
-                    null,
                     new ArrayList(classpath),
                     null,
                     Collections.singleton(repository),
@@ -569,7 +525,7 @@
                         public void uninstall(Artifact configID) {
                         }
 
-                        public ObjectName loadConfiguration(Artifact configId) {
+                        public GBeanData loadConfiguration(Artifact configId) {
                             return null;
                         }
 

Modified: geronimo/branches/configid/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/EARConfigBuilder.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/configid/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/EARConfigBuilder.java?rev=380190&r1=380189&r2=380190&view=diff
==============================================================================
--- geronimo/branches/configid/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/EARConfigBuilder.java (original)
+++ geronimo/branches/configid/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/EARConfigBuilder.java Thu Feb 23 10:30:08 2006
@@ -16,29 +16,8 @@
  */
 package org.apache.geronimo.j2ee.deployment;
 
-import java.io.File;
-import java.io.IOException;
-import java.net.MalformedURLException;
-import java.net.URI;
-import java.net.URISyntaxException;
-import java.net.URL;
-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.Map;
-import java.util.Set;
-import java.util.jar.JarFile;
-import java.util.zip.ZipEntry;
-import javax.management.MalformedObjectNameException;
-import javax.management.ObjectName;
-import javax.xml.namespace.QName;
-
 import org.apache.geronimo.common.DeploymentException;
 import org.apache.geronimo.deployment.ConfigurationBuilder;
-import org.apache.geronimo.kernel.repository.Environment;
 import org.apache.geronimo.deployment.service.EnvironmentBuilder;
 import org.apache.geronimo.deployment.service.ServiceConfigBuilder;
 import org.apache.geronimo.deployment.util.DeploymentUtil;
@@ -58,6 +37,7 @@
 import org.apache.geronimo.kernel.config.ConfigurationModuleType;
 import org.apache.geronimo.kernel.config.ConfigurationStore;
 import org.apache.geronimo.kernel.repository.Artifact;
+import org.apache.geronimo.kernel.repository.Environment;
 import org.apache.geronimo.kernel.repository.Repository;
 import org.apache.geronimo.schema.SchemaConversionUtils;
 import org.apache.geronimo.security.deployment.SecurityBuilder;
@@ -71,6 +51,26 @@
 import org.apache.xmlbeans.XmlException;
 import org.apache.xmlbeans.XmlObject;
 
+import javax.management.MalformedObjectNameException;
+import javax.management.ObjectName;
+import javax.xml.namespace.QName;
+import java.io.File;
+import java.io.IOException;
+import java.net.MalformedURLException;
+import java.net.URI;
+import java.net.URISyntaxException;
+import java.net.URL;
+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.Map;
+import java.util.Set;
+import java.util.jar.JarFile;
+import java.util.zip.ZipEntry;
+
 /**
  * @version $Rev$ $Date$
  */
@@ -383,7 +383,7 @@
             // each module can now add it's GBeans
             for (Iterator iterator = modules.iterator(); iterator.hasNext();) {
                 Module module = (Module) iterator.next();
-                getBuilder(module).addGBeans(earContext, module, cl);
+                getBuilder(module).addGBeans(earContext, module, cl, repository);
             }
 
             //add the JACC gbean if there is a principal-role mapping

Modified: geronimo/branches/configid/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/ModuleBuilder.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/configid/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/ModuleBuilder.java?rev=380190&r1=380189&r2=380190&view=diff
==============================================================================
--- geronimo/branches/configid/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/ModuleBuilder.java (original)
+++ geronimo/branches/configid/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/ModuleBuilder.java Thu Feb 23 10:30:08 2006
@@ -16,14 +16,15 @@
  */
 package org.apache.geronimo.j2ee.deployment;
 
+import org.apache.geronimo.common.DeploymentException;
+import org.apache.geronimo.kernel.config.ConfigurationStore;
+import org.apache.geronimo.kernel.repository.Environment;
+import org.apache.geronimo.kernel.repository.Repository;
+
 import java.io.File;
 import java.net.URL;
 import java.util.jar.JarFile;
 
-import org.apache.geronimo.common.DeploymentException;
-import org.apache.geronimo.kernel.repository.Environment;
-import org.apache.geronimo.kernel.config.ConfigurationStore;
-
 /**
  * @version $Rev$ $Date$
  */
@@ -36,7 +37,7 @@
 
     void initContext(EARContext earContext, Module module, ClassLoader cl) throws DeploymentException;
 
-    void addGBeans(EARContext earContext, Module module, ClassLoader cl) throws DeploymentException;
+    void addGBeans(EARContext earContext, Module module, ClassLoader cl, Repository repository) throws DeploymentException;
 
     String getSchemaNamespace();
 }

Modified: geronimo/branches/configid/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/SwitchingModuleBuilder.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/configid/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/SwitchingModuleBuilder.java?rev=380190&r1=380189&r2=380190&view=diff
==============================================================================
--- geronimo/branches/configid/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/SwitchingModuleBuilder.java (original)
+++ geronimo/branches/configid/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/SwitchingModuleBuilder.java Thu Feb 23 10:30:08 2006
@@ -16,29 +16,30 @@
  */
 package org.apache.geronimo.j2ee.deployment;
 
-import java.io.File;
-import java.io.IOException;
-import java.net.URL;
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.Map;
-import java.util.jar.JarFile;
-
 import org.apache.geronimo.common.DeploymentException;
 import org.apache.geronimo.deployment.xmlbeans.XmlBeansUtil;
-import org.apache.geronimo.kernel.repository.Environment;
-import org.apache.geronimo.kernel.config.ConfigurationStore;
 import org.apache.geronimo.gbean.GBeanInfo;
 import org.apache.geronimo.gbean.GBeanInfoBuilder;
 import org.apache.geronimo.gbean.ReferenceCollection;
 import org.apache.geronimo.gbean.ReferenceCollectionEvent;
 import org.apache.geronimo.gbean.ReferenceCollectionListener;
 import org.apache.geronimo.j2ee.j2eeobjectnames.NameFactory;
+import org.apache.geronimo.kernel.config.ConfigurationStore;
+import org.apache.geronimo.kernel.repository.Environment;
+import org.apache.geronimo.kernel.repository.Repository;
 import org.apache.xmlbeans.XmlCursor;
 import org.apache.xmlbeans.XmlException;
 import org.apache.xmlbeans.XmlObject;
 
+import java.io.File;
+import java.io.IOException;
+import java.net.URL;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.Map;
+import java.util.jar.JarFile;
+
 /**
  * @version $Rev$ $Date$
  */
@@ -155,10 +156,10 @@
         builder.initContext(earContext, module, cl);
     }
 
-    public void addGBeans(EARContext earContext, Module module, ClassLoader cl) throws DeploymentException {
+    public void addGBeans(EARContext earContext, Module module, ClassLoader cl, Repository repository) throws DeploymentException {
         String namespace = module.getNamespace();
         ModuleBuilder builder = getBuilderFromNamespace(namespace);
-        builder.addGBeans(earContext, module, cl);
+        builder.addGBeans(earContext, module, cl, repository);
     }
 
     public String getSchemaNamespace() {

Modified: geronimo/branches/configid/modules/j2ee-builder/src/test/org/apache/geronimo/j2ee/deployment/EARConfigBuilderTest.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/configid/modules/j2ee-builder/src/test/org/apache/geronimo/j2ee/deployment/EARConfigBuilderTest.java?rev=380190&r1=380189&r2=380190&view=diff
==============================================================================
--- geronimo/branches/configid/modules/j2ee-builder/src/test/org/apache/geronimo/j2ee/deployment/EARConfigBuilderTest.java (original)
+++ geronimo/branches/configid/modules/j2ee-builder/src/test/org/apache/geronimo/j2ee/deployment/EARConfigBuilderTest.java Thu Feb 23 10:30:08 2006
@@ -23,7 +23,6 @@
 import junit.framework.TestSuite;
 import org.apache.geronimo.common.DeploymentException;
 import org.apache.geronimo.deployment.DeploymentContext;
-import org.apache.geronimo.kernel.repository.Environment;
 import org.apache.geronimo.deployment.util.DeploymentUtil;
 import org.apache.geronimo.gbean.GBeanData;
 import org.apache.geronimo.gbean.GBeanInfo;
@@ -39,6 +38,7 @@
 import org.apache.geronimo.kernel.config.NoSuchConfigException;
 import org.apache.geronimo.kernel.jmx.JMXUtil;
 import org.apache.geronimo.kernel.repository.Artifact;
+import org.apache.geronimo.kernel.repository.Environment;
 
 import javax.management.ObjectName;
 import javax.xml.namespace.QName;
@@ -46,13 +46,13 @@
 import java.io.File;
 import java.io.IOException;
 import java.io.ObjectOutputStream;
+import java.net.MalformedURLException;
 import java.net.URI;
 import java.net.URL;
-import java.net.MalformedURLException;
 import java.util.Collections;
+import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
-import java.util.HashMap;
 import java.util.jar.JarFile;
 
 /**
@@ -403,17 +403,13 @@
             this.kernel = kernel;
         }
 
-        public Artifact install(URL source) throws IOException, InvalidConfigException {
-            return null;
-        }
-
         public void install(ConfigurationData configurationData) throws IOException, InvalidConfigException {
         }
 
         public void uninstall(Artifact configID) throws NoSuchConfigException, IOException {
         }
 
-        public ObjectName loadConfiguration(Artifact configId) throws NoSuchConfigException, IOException, InvalidConfigException {
+        public GBeanData loadConfiguration(Artifact configId) throws NoSuchConfigException, IOException, InvalidConfigException {
             ObjectName configurationObjectName = Configuration.getConfigurationObjectName(configId);
             GBeanData configData = new GBeanData(configurationObjectName, Configuration.GBEAN_INFO);
             Environment environment = new Environment();
@@ -422,13 +418,7 @@
             configData.setAttribute("environment", environment);
             configData.setAttribute("gBeanState", NO_OBJECTS_OS);
 
-            try {
-                kernel.loadGBean(configData, Configuration.class.getClassLoader());
-            } catch (Exception e) {
-                throw new InvalidConfigException("Unable to register configuration", e);
-            }
-
-            return configurationObjectName;
+            return configData;
         }
 
         public boolean containsConfiguration(Artifact configID) {

Modified: geronimo/branches/configid/modules/j2ee-builder/src/test/org/apache/geronimo/j2ee/deployment/MockConnectorConfigBuilder.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/configid/modules/j2ee-builder/src/test/org/apache/geronimo/j2ee/deployment/MockConnectorConfigBuilder.java?rev=380190&r1=380189&r2=380190&view=diff
==============================================================================
--- geronimo/branches/configid/modules/j2ee-builder/src/test/org/apache/geronimo/j2ee/deployment/MockConnectorConfigBuilder.java (original)
+++ geronimo/branches/configid/modules/j2ee-builder/src/test/org/apache/geronimo/j2ee/deployment/MockConnectorConfigBuilder.java Thu Feb 23 10:30:08 2006
@@ -16,18 +16,18 @@
  */
 package org.apache.geronimo.j2ee.deployment;
 
-import java.io.File;
-import java.net.URL;
-import java.util.jar.JarFile;
-
-import javax.naming.Reference;
-import javax.management.ObjectName;
-
 import junit.framework.Assert;
 import org.apache.geronimo.common.DeploymentException;
 import org.apache.geronimo.gbean.GBeanData;
-import org.apache.geronimo.kernel.repository.Environment;
 import org.apache.geronimo.kernel.config.ConfigurationStore;
+import org.apache.geronimo.kernel.repository.Environment;
+import org.apache.geronimo.kernel.repository.Repository;
+
+import javax.management.ObjectName;
+import javax.naming.Reference;
+import java.io.File;
+import java.net.URL;
+import java.util.jar.JarFile;
 
 /**
  * @version $Rev$ $Date$
@@ -65,7 +65,7 @@
         this.cl = cl;
     }
 
-    public void addGBeans(EARContext earContext, Module connectorModule, ClassLoader cl) {
+    public void addGBeans(EARContext earContext, Module connectorModule, ClassLoader cl, Repository repository) {
         assertEquals(this.earContext, earContext);
 //        assertEquals(this.connectorModule, connectorModule);
         assertEquals(this.cl, cl);

Modified: geronimo/branches/configid/modules/j2ee-builder/src/test/org/apache/geronimo/j2ee/deployment/MockEJBConfigBuilder.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/configid/modules/j2ee-builder/src/test/org/apache/geronimo/j2ee/deployment/MockEJBConfigBuilder.java?rev=380190&r1=380189&r2=380190&view=diff
==============================================================================
--- geronimo/branches/configid/modules/j2ee-builder/src/test/org/apache/geronimo/j2ee/deployment/MockEJBConfigBuilder.java (original)
+++ geronimo/branches/configid/modules/j2ee-builder/src/test/org/apache/geronimo/j2ee/deployment/MockEJBConfigBuilder.java Thu Feb 23 10:30:08 2006
@@ -16,19 +16,19 @@
  */
 package org.apache.geronimo.j2ee.deployment;
 
-import java.io.File;
-import java.net.URI;
-import java.net.URL;
-import java.util.jar.JarFile;
-import javax.management.ObjectName;
-import javax.naming.Reference;
-
 import junit.framework.Assert;
-
 import org.apache.geronimo.common.DeploymentException;
 import org.apache.geronimo.gbean.GBeanData;
-import org.apache.geronimo.kernel.repository.Environment;
 import org.apache.geronimo.kernel.config.ConfigurationStore;
+import org.apache.geronimo.kernel.repository.Environment;
+import org.apache.geronimo.kernel.repository.Repository;
+
+import javax.management.ObjectName;
+import javax.naming.Reference;
+import java.io.File;
+import java.net.URI;
+import java.net.URL;
+import java.util.jar.JarFile;
 
 
 /**
@@ -67,7 +67,7 @@
         this.cl = cl;
     }
 
-    public void addGBeans(EARContext earContext, Module ejbModule, ClassLoader cl) {
+    public void addGBeans(EARContext earContext, Module ejbModule, ClassLoader cl, Repository repository) {
         assertEquals(this.earContext, earContext);
 //        assertEquals(this.ejbModule, ejbModule);
         assertEquals(this.cl, cl);

Modified: geronimo/branches/configid/modules/j2ee-builder/src/test/org/apache/geronimo/j2ee/deployment/MockWARConfigBuilder.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/configid/modules/j2ee-builder/src/test/org/apache/geronimo/j2ee/deployment/MockWARConfigBuilder.java?rev=380190&r1=380189&r2=380190&view=diff
==============================================================================
--- geronimo/branches/configid/modules/j2ee-builder/src/test/org/apache/geronimo/j2ee/deployment/MockWARConfigBuilder.java (original)
+++ geronimo/branches/configid/modules/j2ee-builder/src/test/org/apache/geronimo/j2ee/deployment/MockWARConfigBuilder.java Thu Feb 23 10:30:08 2006
@@ -16,15 +16,16 @@
  */
 package org.apache.geronimo.j2ee.deployment;
 
-import java.io.File;
-import java.net.URL;
-import java.util.jar.JarFile;
-import java.util.Map;
-
 import junit.framework.Assert;
 import org.apache.geronimo.common.DeploymentException;
-import org.apache.geronimo.kernel.repository.Environment;
 import org.apache.geronimo.kernel.config.ConfigurationStore;
+import org.apache.geronimo.kernel.repository.Environment;
+import org.apache.geronimo.kernel.repository.Repository;
+
+import java.io.File;
+import java.net.URL;
+import java.util.Map;
+import java.util.jar.JarFile;
 
 /**
  * @version $Rev$ $Date$
@@ -65,7 +66,7 @@
         this.cl = cl;
     }
 
-    public void addGBeans(EARContext earContext, Module webModule, ClassLoader cl) throws DeploymentException {
+    public void addGBeans(EARContext earContext, Module webModule, ClassLoader cl, Repository repository) throws DeploymentException {
         assertEquals(this.earContext, earContext);
 //        assertEquals(this.webModule, webModule);
         assertEquals(this.cl, cl);

Modified: geronimo/branches/configid/modules/jetty-builder/src/java/org/apache/geronimo/jetty/deployment/JettyModuleBuilder.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/configid/modules/jetty-builder/src/java/org/apache/geronimo/jetty/deployment/JettyModuleBuilder.java?rev=380190&r1=380189&r2=380190&view=diff
==============================================================================
--- geronimo/branches/configid/modules/jetty-builder/src/java/org/apache/geronimo/jetty/deployment/JettyModuleBuilder.java (original)
+++ geronimo/branches/configid/modules/jetty-builder/src/java/org/apache/geronimo/jetty/deployment/JettyModuleBuilder.java Thu Feb 23 10:30:08 2006
@@ -44,6 +44,7 @@
 import org.apache.geronimo.jetty.JettyWebAppContext;
 import org.apache.geronimo.kernel.GBeanNotFoundException;
 import org.apache.geronimo.kernel.Kernel;
+import org.apache.geronimo.kernel.config.ConfigurationData;
 import org.apache.geronimo.kernel.config.ConfigurationModuleType;
 import org.apache.geronimo.kernel.config.ConfigurationStore;
 import org.apache.geronimo.kernel.repository.Artifact;
@@ -149,7 +150,6 @@
     private final List defaultWelcomeFiles;
     private final Integer defaultSessionTimeoutSeconds;
 
-    private final Repository repository;
     private final Kernel kernel;
     private static final String JETTY_NAMESPACE = JettyWebAppDocument.type.getDocumentElementName().getNamespaceURI();
 
@@ -163,7 +163,6 @@
                               Collection defaultFilterMappings,
                               Object pojoWebServiceTemplate,
                               WebServiceBuilder webServiceBuilder,
-                              Repository repository,
                               Kernel kernel) throws GBeanNotFoundException {
         this.defaultEnvironment = defaultEnvironment;
         this.defaultSessionTimeoutSeconds = (defaultSessionTimeoutSeconds == null) ? new Integer(30 * 60) : defaultSessionTimeoutSeconds;
@@ -174,7 +173,6 @@
         this.defaultFilterMappings = defaultFilterMappings;
         this.pojoWebServiceTemplate = getGBeanData(kernel, pojoWebServiceTemplate);
         this.webServiceBuilder = webServiceBuilder;
-        this.repository = repository;
         this.kernel = kernel;
 
         //todo locale mappings
@@ -242,7 +240,7 @@
 
         EnvironmentType environmentType = jettyWebApp.getEnvironment();
         Environment environment = EnvironmentBuilder.buildEnvironment(environmentType, defaultEnvironment);
-        if (environment.getConfigId() == null) {
+        if (!standAlone && environment.getConfigId() == null) {
             Artifact configID = new Artifact(Artifact.DEFAULT_GROUP_ID, contextRoot, "1", "car");
             environment.setConfigId(configID);
         }
@@ -369,9 +367,13 @@
             moduleContext = earContext;
         } else {
             Environment environment = module.getEnvironment();
+            Artifact earConfigId = earContext.getConfigID();
+            Artifact configId = new Artifact(earConfigId.getGroupId(), earConfigId.getArtifactId() + "_" + module.getTargetPath(), earConfigId.getVersion(), "car");
+            environment.setConfigId(configId);
+            environment.addImport(earConfigId);
             File configurationDir = configurationStore.createNewConfigurationDir(environment.getConfigId());
 
-            // construct the app client deployment context... this is the same class used by the ear context
+            // construct the web app deployment context... this is the same class used by the ear context
             try {
 
                 moduleContext = new EARContext(configurationDir,
@@ -387,7 +389,7 @@
                         earContext.getRefContext());
             } catch (Exception e) {
                 DeploymentUtil.recursiveDelete(configurationDir);
-                throw new DeploymentException("Could not create a deployment context for the app client", e);
+                throw new DeploymentException("Could not create a deployment context for the web app", e);
             }
 
         }
@@ -404,6 +406,10 @@
                 URI targetPath = baseDir.resolve(new URI(null, entry.getName(), null));
                 if (entry.getName().equals("WEB-INF/web.xml")) {
                     moduleContext.addFile(targetPath, module.getOriginalSpecDD());
+                } else if (entry.getName().startsWith("WEB-INF/lib") && entry.getName().endsWith(".jar")) {
+                    moduleContext.addInclude(targetPath, warFile, entry);
+                } else if (entry.getName().equals("WEB-INF/classes")) {
+                    moduleContext.addInclude(targetPath, warFile, entry);
                 } else {
                     moduleContext.addFile(targetPath, warFile, entry);
                 }
@@ -443,8 +449,9 @@
         }
     }
 
-    public void addGBeans(EARContext earContext, Module module, ClassLoader cl) throws DeploymentException {
+    public void addGBeans(EARContext earContext, Module module, ClassLoader cl, Repository repository) throws DeploymentException {
         EARContext moduleContext = module.getEarContext();
+        ClassLoader moduleClassLoader = moduleContext.getClassLoader(repository);
         J2eeContext earJ2eeContext = moduleContext.getJ2eeContext();
         J2eeContext moduleJ2eeContext = J2eeContextImpl.newModuleContextFromApplication(earJ2eeContext, NameFactory.WEB_MODULE, module.getName());
         WebModule webModule = (WebModule) module;
@@ -457,10 +464,10 @@
             contextPriorityClassLoader = jettyWebApp.getContextPriorityClassloader();
         }
         // construct the webClassLoader
-        ClassLoader webClassLoader = getWebClassLoader(moduleContext, webModule, cl, contextPriorityClassLoader);
+//        ClassLoader webClassLoader = getWebClassLoader(moduleContext, webModule, moduleClassLoader, contextPriorityClassLoader);
 
         GbeanType[] gbeans = jettyWebApp.getGbeanArray();
-        ServiceConfigBuilder.addGBeans(gbeans, webClassLoader, moduleJ2eeContext, moduleContext);
+        ServiceConfigBuilder.addGBeans(gbeans, moduleClassLoader, moduleJ2eeContext, moduleContext);
 
         ObjectName webModuleName = null;
         try {
@@ -471,7 +478,8 @@
 
         UserTransaction userTransaction = new OnlineUserTransaction();
         //this may add to the web classpath with enhanced classes.
-        Map compContext = buildComponentContext(moduleContext, webModule, webApp, jettyWebApp, userTransaction, webClassLoader);
+        //N.B. we use the ear context which has all the gbeans we could possibly be looking up from this ear.
+        Map compContext = buildComponentContext(earContext, webModule, webApp, jettyWebApp, userTransaction, moduleClassLoader);
 
         GBeanData webModuleData = new GBeanData(webModuleName, JettyWebAppContext.GBEAN_INFO);
         try {
@@ -507,7 +515,8 @@
             webModuleData.setAttribute("webClassPath", webModule.getWebClasspath());
             // unsharableResources, applicationManagedSecurityResources
             GBeanResourceEnvironmentBuilder rebuilder = new GBeanResourceEnvironmentBuilder(webModuleData);
-            ENCConfigBuilder.setResourceEnvironment(moduleContext, webModule.getModuleURI(), rebuilder, webApp.getResourceRefArray(), jettyWebApp.getResourceRefArray());
+            //N.B. use earContext not moduleContext
+            ENCConfigBuilder.setResourceEnvironment(earContext, webModule.getModuleURI(), rebuilder, webApp.getResourceRefArray(), jettyWebApp.getResourceRefArray());
 
             webModuleData.setAttribute("contextPath", webModule.getContextRoot());
             webModuleData.setAttribute("contextPriorityClassLoader", Boolean.valueOf(contextPriorityClassLoader));
@@ -812,7 +821,7 @@
             //set up servlet gbeans.
             Map portMap = webModule.getPortMap();
 
-            addServlets(webModuleName, webModule.getModuleFile(), servletTypes, servletMappings, securityRoles, rolePermissions, portMap, webClassLoader, moduleJ2eeContext, moduleContext);
+            addServlets(webModuleName, webModule.getModuleFile(), servletTypes, servletMappings, securityRoles, rolePermissions, portMap, moduleClassLoader, moduleJ2eeContext, moduleContext);
 
             if (jettyWebApp.isSetSecurityRealmName()) {
                 if (moduleContext.getSecurityConfiguration() == null) {
@@ -846,6 +855,10 @@
 
                 webModuleData.setReferencePattern("RoleDesignateSource", moduleContext.getJaccManagerName());
             }
+            if (!module.isStandAlone()) {
+                ConfigurationData moduleConfigurationData = moduleContext.getConfigurationData();
+                earContext.addChildConfiguration(moduleConfigurationData);
+            }
         } catch (DeploymentException de) {
             throw de;
         } catch (Exception e) {
@@ -1419,7 +1432,6 @@
         infoBuilder.addReference("DefaultFilterMappings", Object.class);
         infoBuilder.addReference("PojoWebServiceTemplate", Object.class, "ServletWebServiceTemplate");
         infoBuilder.addReference("WebServiceBuilder", WebServiceBuilder.class, NameFactory.MODULE_BUILDER);
-        infoBuilder.addReference("Repository", Repository.class, NameFactory.GERONIMO_SERVICE);
         infoBuilder.addAttribute("kernel", Kernel.class, false);
         infoBuilder.addInterface(ModuleBuilder.class);
 
@@ -1434,7 +1446,6 @@
             "DefaultFilterMappings",
             "PojoWebServiceTemplate",
             "WebServiceBuilder",
-            "Repository",
             "kernel"});
         GBEAN_INFO = infoBuilder.getBeanInfo();
     }

Modified: geronimo/branches/configid/modules/jetty-builder/src/test/org/apache/geronimo/jetty/deployment/JettyModuleBuilderTest.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/configid/modules/jetty-builder/src/test/org/apache/geronimo/jetty/deployment/JettyModuleBuilderTest.java?rev=380190&r1=380189&r2=380190&view=diff
==============================================================================
--- geronimo/branches/configid/modules/jetty-builder/src/test/org/apache/geronimo/jetty/deployment/JettyModuleBuilderTest.java (original)
+++ geronimo/branches/configid/modules/jetty-builder/src/test/org/apache/geronimo/jetty/deployment/JettyModuleBuilderTest.java Thu Feb 23 10:30:08 2006
@@ -16,31 +16,10 @@
  */
 package org.apache.geronimo.jetty.deployment;
 
-import java.io.ByteArrayOutputStream;
-import java.io.File;
-import java.io.IOException;
-import java.io.ObjectOutputStream;
-import java.net.URI;
-import java.net.URL;
-import java.net.MalformedURLException;
-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 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;
-import org.apache.geronimo.kernel.repository.Environment;
 import org.apache.geronimo.deployment.util.UnpackedJarFile;
 import org.apache.geronimo.gbean.GBeanData;
 import org.apache.geronimo.gbean.GBeanInfo;
@@ -62,9 +41,6 @@
 import org.apache.geronimo.jetty.connector.HTTPConnector;
 import org.apache.geronimo.kernel.Kernel;
 import org.apache.geronimo.kernel.KernelFactory;
-import org.apache.geronimo.kernel.repository.Artifact;
-import org.apache.geronimo.kernel.repository.DefaultArtifactManager;
-import org.apache.geronimo.kernel.repository.DefaultArtifactResolver;
 import org.apache.geronimo.kernel.config.Configuration;
 import org.apache.geronimo.kernel.config.ConfigurationData;
 import org.apache.geronimo.kernel.config.ConfigurationManager;
@@ -72,16 +48,40 @@
 import org.apache.geronimo.kernel.config.ConfigurationModuleType;
 import org.apache.geronimo.kernel.config.ConfigurationStore;
 import org.apache.geronimo.kernel.config.InvalidConfigException;
-import org.apache.geronimo.kernel.config.NoSuchConfigException;
 import org.apache.geronimo.kernel.config.ManageableAttributeStore;
+import org.apache.geronimo.kernel.config.NoSuchConfigException;
 import org.apache.geronimo.kernel.jmx.JMXUtil;
 import org.apache.geronimo.kernel.management.State;
+import org.apache.geronimo.kernel.repository.Artifact;
+import org.apache.geronimo.kernel.repository.DefaultArtifactManager;
+import org.apache.geronimo.kernel.repository.DefaultArtifactResolver;
+import org.apache.geronimo.kernel.repository.Environment;
 import org.apache.geronimo.security.SecurityServiceImpl;
-import org.apache.geronimo.system.serverinfo.BasicServerInfo;
 import org.apache.geronimo.system.configuration.ExecutableConfigurationUtil;
+import org.apache.geronimo.system.serverinfo.BasicServerInfo;
 import org.apache.geronimo.transaction.context.TransactionContextManagerGBean;
 import org.apache.geronimo.transaction.manager.TransactionManagerImplGBean;
 
+import javax.management.MalformedObjectNameException;
+import javax.management.ObjectName;
+import javax.naming.Reference;
+import javax.xml.namespace.QName;
+import java.io.ByteArrayOutputStream;
+import java.io.File;
+import java.io.IOException;
+import java.io.ObjectOutputStream;
+import java.net.MalformedURLException;
+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;
+
 /**
  * @version $Rev$ $Date$
  */
@@ -118,6 +118,7 @@
         File outputPath = new File(basedir, "target/test-resources/deployables/war4");
         recursiveDelete(outputPath);
         outputPath.mkdirs();
+        new File(outputPath, "war").mkdir();
         File path = new File(basedir, "src/test-resources/deployables/war4");
         UnpackedJarFile jarFile = new UnpackedJarFile(path);
         Module module = builder.createModule(null, jarFile);
@@ -127,13 +128,13 @@
         GBeanData server = new GBeanData(serverName, J2EEServerImpl.GBEAN_INFO);
         start(server);
         builder.initContext(earContext, module, cl);
-        builder.addGBeans(earContext, module, cl);
+        builder.addGBeans(earContext, module, cl, null);
         earContext.close();
         module.close();
 
         GBeanData configData = ExecutableConfigurationUtil.getConfigurationGBeanData(earContext.getConfigurationData());
         ObjectName configName = configData.getName();
-        configData.setAttribute("baseURL", path.toURL());
+        configData.setAttribute("configurationStore", new MockConfigStore(outputPath.toURL()));
         kernel.loadGBean(configData, cl);
         kernel.startGBean(configName);
         kernel.invoke(configName, "loadGBeans", new Object[] {null}, new String[] {ManageableAttributeStore.class.getName()});
@@ -312,7 +313,7 @@
         defaultEnvironment.addImports(parentId);
         Artifact artifact = Artifact.create("foo/bar/1/car");
         defaultEnvironment.setConfigId(artifact);
-        builder = new JettyModuleBuilder(defaultEnvironment, new Integer(1800), false, Collections.EMPTY_LIST, containerName, defaultServlets, defaultFilters, defaultFilterMappings, pojoWebServiceTemplate, webServiceBuilder, null, kernel);
+        builder = new JettyModuleBuilder(defaultEnvironment, new Integer(1800), false, Collections.EMPTY_LIST, containerName, defaultServlets, defaultFilters, defaultFilterMappings, pojoWebServiceTemplate, webServiceBuilder, kernel);
 
         container = new GBeanData(containerName, JettyContainerImpl.GBEAN_INFO);
 
@@ -364,14 +365,14 @@
     }
 
     public static class MockConfigStore implements ConfigurationStore {
-        private final Kernel kernel;
 
-        public MockConfigStore(Kernel kernel) {
-            this.kernel = kernel;
+        URL baseURL;
+
+        public MockConfigStore() {
         }
 
-        public Artifact install(URL source) throws IOException, InvalidConfigException {
-            return null;
+        public MockConfigStore(URL baseURL) {
+            this.baseURL = baseURL;
         }
 
         public void install(ConfigurationData configurationData) throws IOException, InvalidConfigException {
@@ -380,7 +381,7 @@
         public void uninstall(Artifact configID) throws NoSuchConfigException, IOException {
         }
 
-        public ObjectName loadConfiguration(Artifact configId) throws NoSuchConfigException, IOException, InvalidConfigException {
+        public GBeanData loadConfiguration(Artifact configId) throws NoSuchConfigException, IOException, InvalidConfigException {
             ObjectName configurationObjectName = Configuration.getConfigurationObjectName(configId);
             GBeanData configData = new GBeanData(configurationObjectName, Configuration.GBEAN_INFO);
             Environment environment = new Environment();
@@ -389,13 +390,7 @@
             configData.setAttribute("environment", environment);
             configData.setAttribute("gBeanState", NO_OBJECTS_OS);
 
-            try {
-                kernel.loadGBean(configData, Configuration.class.getClassLoader());
-            } catch (Exception e) {
-                throw new InvalidConfigException("Unable to register configuration", e);
-            }
-
-            return configurationObjectName;
+            return configData;
         }
 
         public boolean containsConfiguration(Artifact configID) {
@@ -415,7 +410,7 @@
         }
 
         public URL resolve(Artifact configId, URI uri) throws NoSuchConfigException, MalformedURLException {
-            return null;
+            return baseURL;
         }
 
         public final static GBeanInfo GBEAN_INFO;
@@ -425,8 +420,7 @@
         static {
             GBeanInfoBuilder infoBuilder = GBeanInfoBuilder.createStatic(MockConfigStore.class, NameFactory.CONFIGURATION_STORE);
             infoBuilder.addInterface(ConfigurationStore.class);
-            infoBuilder.addAttribute("kernel", Kernel.class, false);
-            infoBuilder.setConstructor(new String[] {"kernel"});
+//            infoBuilder.setConstructor(new String[] {"kernel"});
             GBEAN_INFO = infoBuilder.getBeanInfo();
 
             ByteArrayOutputStream baos = new ByteArrayOutputStream();

Modified: geronimo/branches/configid/modules/jetty-builder/src/test/org/apache/geronimo/jetty/deployment/PlanParsingTest.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/configid/modules/jetty-builder/src/test/org/apache/geronimo/jetty/deployment/PlanParsingTest.java?rev=380190&r1=380189&r2=380190&view=diff
==============================================================================
--- geronimo/branches/configid/modules/jetty-builder/src/test/org/apache/geronimo/jetty/deployment/PlanParsingTest.java (original)
+++ geronimo/branches/configid/modules/jetty-builder/src/test/org/apache/geronimo/jetty/deployment/PlanParsingTest.java Thu Feb 23 10:30:08 2006
@@ -1,22 +1,13 @@
 package org.apache.geronimo.jetty.deployment;
 
-import java.io.File;
-import java.net.URL;
-import java.util.ArrayList;
-import java.util.HashSet;
-import java.util.List;
-import java.util.jar.JarFile;
-import javax.management.ObjectName;
-import javax.xml.namespace.QName;
-
 import junit.framework.TestCase;
 import org.apache.geronimo.deployment.util.UnpackedJarFile;
-import org.apache.geronimo.deployment.xmlbeans.XmlBeansUtil;
-import org.apache.geronimo.deployment.xbeans.EnvironmentType;
 import org.apache.geronimo.deployment.xbeans.ArtifactType;
-import org.apache.geronimo.kernel.repository.Environment;
+import org.apache.geronimo.deployment.xbeans.EnvironmentType;
+import org.apache.geronimo.deployment.xmlbeans.XmlBeansUtil;
 import org.apache.geronimo.j2ee.deployment.WebServiceBuilder;
 import org.apache.geronimo.kernel.jmx.JMXUtil;
+import org.apache.geronimo.kernel.repository.Environment;
 import org.apache.geronimo.schema.SchemaConversionUtils;
 import org.apache.geronimo.web.deployment.GenericToSpecificPlanConverter;
 import org.apache.geronimo.xbeans.geronimo.naming.GerResourceRefType;
@@ -28,6 +19,15 @@
 import org.apache.xmlbeans.XmlCursor;
 import org.apache.xmlbeans.XmlObject;
 
+import javax.management.ObjectName;
+import javax.xml.namespace.QName;
+import java.io.File;
+import java.net.URL;
+import java.util.ArrayList;
+import java.util.HashSet;
+import java.util.List;
+import java.util.jar.JarFile;
+
 /**
  */
 public class PlanParsingTest extends TestCase {
@@ -40,7 +40,7 @@
     private JettyModuleBuilder builder;
 
     public PlanParsingTest() throws Exception {
-        builder = new JettyModuleBuilder(defaultEnvironment, new Integer(1800), false, null, jettyContainerObjectName, new HashSet(), new HashSet(), new HashSet(), pojoWebServiceTemplate, webServiceBuilder, null, null);
+        builder = new JettyModuleBuilder(defaultEnvironment, new Integer(1800), false, null, jettyContainerObjectName, new HashSet(), new HashSet(), new HashSet(), pojoWebServiceTemplate, webServiceBuilder, null);
     }
 
     public void testContents() throws Exception {

Modified: geronimo/branches/configid/modules/jetty/src/java/org/apache/geronimo/jetty/JettyWebAppContext.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/configid/modules/jetty/src/java/org/apache/geronimo/jetty/JettyWebAppContext.java?rev=380190&r1=380189&r2=380190&view=diff
==============================================================================
--- geronimo/branches/configid/modules/jetty/src/java/org/apache/geronimo/jetty/JettyWebAppContext.java (original)
+++ geronimo/branches/configid/modules/jetty/src/java/org/apache/geronimo/jetty/JettyWebAppContext.java Thu Feb 23 10:30:08 2006
@@ -17,20 +17,6 @@
 
 package org.apache.geronimo.jetty;
 
-import java.io.IOException;
-import java.net.URI;
-import java.net.URL;
-import java.security.PermissionCollection;
-import java.util.Collection;
-import java.util.EventListener;
-import java.util.Hashtable;
-import java.util.Iterator;
-import java.util.Map;
-import java.util.Set;
-import javax.management.MalformedObjectNameException;
-import javax.management.ObjectName;
-import javax.naming.Context;
-
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.apache.geronimo.gbean.GBeanInfo;
@@ -39,9 +25,6 @@
 import org.apache.geronimo.j2ee.j2eeobjectnames.J2eeContext;
 import org.apache.geronimo.j2ee.j2eeobjectnames.J2eeContextImpl;
 import org.apache.geronimo.j2ee.j2eeobjectnames.NameFactory;
-import org.apache.geronimo.management.J2EEApplication;
-import org.apache.geronimo.management.J2EEServer;
-import org.apache.geronimo.management.geronimo.WebModule;
 import org.apache.geronimo.j2ee.management.impl.InvalidObjectNameException;
 import org.apache.geronimo.j2ee.management.impl.Util;
 import org.apache.geronimo.jetty.interceptor.BeforeAfter;
@@ -54,9 +37,12 @@
 import org.apache.geronimo.jetty.interceptor.WebApplicationContextBeforeAfter;
 import org.apache.geronimo.kernel.Kernel;
 import org.apache.geronimo.kernel.jmx.JMXUtil;
+import org.apache.geronimo.management.J2EEApplication;
+import org.apache.geronimo.management.J2EEServer;
+import org.apache.geronimo.management.geronimo.WebModule;
+import org.apache.geronimo.naming.enc.EnterpriseNamingContext;
 import org.apache.geronimo.naming.reference.ClassLoaderAwareReference;
 import org.apache.geronimo.naming.reference.KernelAwareReference;
-import org.apache.geronimo.naming.enc.EnterpriseNamingContext;
 import org.apache.geronimo.security.deploy.DefaultPrincipal;
 import org.apache.geronimo.security.jacc.RoleDesignateSource;
 import org.apache.geronimo.transaction.TrackedConnectionAssociator;
@@ -75,6 +61,20 @@
 import org.mortbay.jetty.servlet.WebApplicationContext;
 import org.mortbay.jetty.servlet.WebApplicationHandler;
 
+import javax.management.MalformedObjectNameException;
+import javax.management.ObjectName;
+import javax.naming.Context;
+import java.io.IOException;
+import java.net.URI;
+import java.net.URL;
+import java.security.PermissionCollection;
+import java.util.Collection;
+import java.util.EventListener;
+import java.util.Hashtable;
+import java.util.Iterator;
+import java.util.Map;
+import java.util.Set;
+
 /**
  * Wrapper for a WebApplicationContext that sets up its J2EE environment.
  *
@@ -93,7 +93,7 @@
     private final ClassLoader webClassLoader;
     private final JettyContainer jettyContainer;
 
-    private final URI webAppRoot;
+    private final String webAppRoot;
     private final WebApplicationHandler handler;
     private String displayName;
     private final String[] welcomeFiles;
@@ -107,38 +107,38 @@
 
     private String sessionManager;
 
-    
+
     public class SessionManagerConfiguration implements WebApplicationContext.Configuration {
 
-    	private WebApplicationContext webAppContext;
-    	
-    	
-		public void setWebApplicationContext(WebApplicationContext webAppContext) {
-			this.webAppContext = webAppContext;
-		}
-
-		public WebApplicationContext getWebApplicationContext() {
-			return this.webAppContext;
-		}
-
-		public void configureClassPath() throws Exception {
-		}
-
-		public void configureDefaults() throws Exception {	
-		}
-
-	
-		public void configureWebApp() throws Exception {
-		       //setup a SessionManager
-	        if (getSessionManager() != null) {
-	        	Class clazz = Thread.currentThread().getContextClassLoader().loadClass(getSessionManager());
-	          Object o = clazz.newInstance();
-	        	this.webAppContext.getServletHandler().setSessionManager((SessionManager)o);
-	        }
-		}
-    	
+        private WebApplicationContext webAppContext;
+
+
+        public void setWebApplicationContext(WebApplicationContext webAppContext) {
+            this.webAppContext = webAppContext;
+        }
+
+        public WebApplicationContext getWebApplicationContext() {
+            return this.webAppContext;
+        }
+
+        public void configureClassPath() throws Exception {
+        }
+
+        public void configureDefaults() throws Exception {
+        }
+
+
+        public void configureWebApp() throws Exception {
+            //setup a SessionManager
+            if (getSessionManager() != null) {
+                Class clazz = Thread.currentThread().getContextClassLoader().loadClass(getSessionManager());
+                Object o = clazz.newInstance();
+                this.webAppContext.getServletHandler().setSessionManager((SessionManager) o);
+            }
+        }
+
     }
-    
+
     /**
      * @deprecated never use this... this is only here because Jetty WebApplicationContext is externalizable
      */
@@ -225,27 +225,29 @@
 
         setConfigurationClassNames(new String[]{});
 
-        URI root = null;
+//        URI root = null;
         //TODO is there a simpler way to do this?
-        if (configurationBaseUrl.getProtocol().equalsIgnoreCase("file")) {
-            root = new URI("file", configurationBaseUrl.getPath(), null);
-        } else {
-            root = URI.create(configurationBaseUrl.toString());
-        }
-        webAppRoot = root.resolve(uri);
-        URL webAppRootURL = webAppRoot.toURL();
+//        if (configurationBaseUrl.getProtocol().equalsIgnoreCase("file")) {
+//            root = new URI("file", configurationBaseUrl.getPath(), null);
+//        } else {
+//            root = URI.create(configurationBaseUrl.toString());
+//        }
 
-        URL[] urls = new URL[webClassPath.length];
-        for (int i = 0; i < webClassPath.length; i++) {
-            URI classPathEntry = webClassPath[i];
-            classPathEntry = root.resolve(classPathEntry);
-            urls[i] = classPathEntry.toURL();
-        }
-        this.webClassLoader = new JettyClassLoader(urls, webAppRootURL, classLoader, contextPriorityClassLoader);
+        webAppRoot = new URL(configurationBaseUrl, uri.toString()).toString();
+//        URL webAppRootURL = webAppRoot.toURL();
+
+//        URL[] urls = new URL[webClassPath.length];
+//        for (int i = 0; i < webClassPath.length; i++) {
+//            URI classPathEntry = webClassPath[i];
+//            classPathEntry = root.resolve(classPathEntry);
+//            urls[i] = classPathEntry.toURL();
+//        }
+        this.webClassLoader = classLoader;
+        //new JettyClassLoader(urls, webAppRootURL, classLoader, contextPriorityClassLoader);
         setClassLoader(this.webClassLoader);
 
         setVirtualHosts(virtualHosts);
-        
+
         handler = new WebApplicationHandler();
         addHandler(handler);
 
@@ -266,19 +268,16 @@
         setSessionTimeoutSeconds(sessionTimeoutSeconds);
 
         // create ReadOnlyContext
-        Context enc = null;
-        if (componentContext != null) {
-            for (Iterator iterator = componentContext.values().iterator(); iterator.hasNext();) {
-                Object value = iterator.next();
-                if (value instanceof KernelAwareReference) {
-                    ((KernelAwareReference) value).setKernel(kernel);
-                }
-                if (value instanceof ClassLoaderAwareReference) {
-                    ((ClassLoaderAwareReference) value).setClassLoader(this.webClassLoader);
-                }
+        for (Iterator iterator = componentContext.values().iterator(); iterator.hasNext();) {
+            Object value = iterator.next();
+            if (value instanceof KernelAwareReference) {
+                ((KernelAwareReference) value).setKernel(kernel);
+            }
+            if (value instanceof ClassLoaderAwareReference) {
+                ((ClassLoaderAwareReference) value).setClassLoader(this.webClassLoader);
             }
-            enc = EnterpriseNamingContext.createEnterpriseNamingContext(componentContext);
         }
+        Context enc = EnterpriseNamingContext.createEnterpriseNamingContext(componentContext);
 
         int index = 0;
         BeforeAfter interceptor = new InstanceContextBeforeAfter(null, index++, unshareableResources, applicationManagedSecurityResources, trackedConnectionAssociator);
@@ -304,18 +303,17 @@
         interceptor = new RequestWrappingBeforeAfter(interceptor, handler);
         chain = interceptor;
         contextLength = index;
-        
+
         //cheat -- add jsr154 filter not as a gbean
         FilterHolder jsr154FilterHolder = new FilterHolder(handler, "jsr154", JSR154Filter.class.getName());
         handler.addFilterHolder(jsr154FilterHolder);
         jsr154FilterHolder.setInitParameter("unwrappedDispatch", "true");
         handler.addFilterPathMapping("/*", "jsr154", Dispatcher.__REQUEST | Dispatcher.__FORWARD | Dispatcher.__INCLUDE | Dispatcher.__ERROR);
-        
-        configureSessionManager (sessionManager);
-      
+
+        configureSessionManager(sessionManager);
+
     }
 
-    
 
     public String getObjectName() {
         return objectName;
@@ -356,8 +354,7 @@
     public void doStart() throws Exception {
         // reset the classsloader... jetty likes to set it to null when stopping
         setClassLoader(webClassLoader);
-        
- 
+
         // merge Geronimo and Jetty Lifecycles
         if (!isStarting()) {
             super.start();
@@ -366,7 +363,7 @@
 
         ((AbstractSessionManager) getServletHandler().getSessionManager()).setUseRequestedId(true);
 
-        setWAR(webAppRoot.toString());
+        setWAR(webAppRoot);
 
         jettyContainer.addContext(this);
 
@@ -416,7 +413,6 @@
         log.warn("JettyWebAppContext failed");
     }
 
-
     //pass through attributes.  They should be constructor params
 
     //TODO encourage jetty to improve their naming convention.
@@ -512,27 +508,26 @@
     }
 
 
-    public String getSessionManager(){
-    	return this.sessionManager;
+    public String getSessionManager() {
+        return this.sessionManager;
+    }
+
+
+    private void configureSessionManager(String sessionManagerClassName) {
+        this.sessionManager = sessionManagerClassName;
+        if (this.sessionManager != null) {
+            addConfiguration(SessionManagerConfiguration.class.getName());
+        }
     }
 
+    private void addConfiguration(String configClassName) {
+        String[] configClassNames = getConfigurationClassNames();
+        String[] newConfigClassNames = new String[configClassNames == null ? 1 : configClassNames.length + 1];
+        System.arraycopy(configClassNames, 0, newConfigClassNames, 0, configClassNames.length);
 
-    private void configureSessionManager (String sessionManagerClassName) {
-    	  this.sessionManager = sessionManagerClassName;
-          if (this.sessionManager != null) {
-        	  addConfiguration (SessionManagerConfiguration.class.getName());
-          }
-    }
-    
-    private void addConfiguration (String configClassName) {
-          String[] configClassNames = getConfigurationClassNames();
-          String[] newConfigClassNames = new String[configClassNames==null?1:configClassNames.length+1];
-          for (int i=0;i<configClassNames.length;i++)
-        	  newConfigClassNames[i] = configClassNames[i];
-          
-          newConfigClassNames[newConfigClassNames.length-1] = configClassName;
+        newConfigClassNames[newConfigClassNames.length - 1] = configClassName;
     }
-    
+
     /**
      * ObjectName must match this pattern:
      * <p/>
@@ -588,7 +583,6 @@
     }
 
 
-
     public static final GBeanInfo GBEAN_INFO;
 
     static {
@@ -652,48 +646,48 @@
         infoBuilder.addInterface(WebModule.class);
 
         infoBuilder.setConstructor(new String[]{
-            "objectName",
-            "deploymentDescriptor",
-            "uri",
-            "virtualHosts",
-            "sessionManager",
-            "componentContext",
-            "userTransaction",
-            "classLoader",
-            "webClassPath",
-            "contextPriorityClassLoader",
-            "configurationBaseUrl",
-            "unshareableResources",
-            "applicationManagedSecurityResources",
-
-            "displayName",
-            "contextParamMap",
-            "listenerClassNames",
-            "distributable",
-            "mimeMap",
-            "welcomeFiles",
-            "localeEncodingMapping",
-            "errorPages",
-            "authenticator",
-            "realmName",
-            "tagLibMap",
-            "sessionTimeoutSeconds",
-
-            "policyContextID",
-            "securityRealmName",
-            "defaultPrincipal",
-
-            "checkedPermissions",
-            "excludedPermissions",
-
-            "TransactionContextManager",
-            "TrackedConnectionAssociator",
-            "JettyContainer",
-            "RoleDesignateSource",
-
-            "J2EEServer",
-            "J2EEApplication",
-            "kernel"
+                "objectName",
+                "deploymentDescriptor",
+                "uri",
+                "virtualHosts",
+                "sessionManager",
+                "componentContext",
+                "userTransaction",
+                "classLoader",
+                "webClassPath",
+                "contextPriorityClassLoader",
+                "configurationBaseUrl",
+                "unshareableResources",
+                "applicationManagedSecurityResources",
+
+                "displayName",
+                "contextParamMap",
+                "listenerClassNames",
+                "distributable",
+                "mimeMap",
+                "welcomeFiles",
+                "localeEncodingMapping",
+                "errorPages",
+                "authenticator",
+                "realmName",
+                "tagLibMap",
+                "sessionTimeoutSeconds",
+
+                "policyContextID",
+                "securityRealmName",
+                "defaultPrincipal",
+
+                "checkedPermissions",
+                "excludedPermissions",
+
+                "TransactionContextManager",
+                "TrackedConnectionAssociator",
+                "JettyContainer",
+                "RoleDesignateSource",
+
+                "J2EEServer",
+                "J2EEApplication",
+                "kernel"
         });
 
         GBEAN_INFO = infoBuilder.getBeanInfo();

Modified: geronimo/branches/configid/modules/kernel/src/java/org/apache/geronimo/kernel/config/Configuration.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/configid/modules/kernel/src/java/org/apache/geronimo/kernel/config/Configuration.java?rev=380190&r1=380189&r2=380190&view=diff
==============================================================================
--- geronimo/branches/configid/modules/kernel/src/java/org/apache/geronimo/kernel/config/Configuration.java (original)
+++ geronimo/branches/configid/modules/kernel/src/java/org/apache/geronimo/kernel/config/Configuration.java Thu Feb 23 10:30:08 2006
@@ -32,12 +32,12 @@
 import org.apache.geronimo.kernel.jmx.JMXUtil;
 import org.apache.geronimo.kernel.management.State;
 import org.apache.geronimo.kernel.repository.Artifact;
+import org.apache.geronimo.kernel.repository.ArtifactManager;
+import org.apache.geronimo.kernel.repository.ArtifactResolver;
+import org.apache.geronimo.kernel.repository.DefaultArtifactResolver;
 import org.apache.geronimo.kernel.repository.Environment;
 import org.apache.geronimo.kernel.repository.MissingDependencyException;
 import org.apache.geronimo.kernel.repository.Repository;
-import org.apache.geronimo.kernel.repository.ArtifactResolver;
-import org.apache.geronimo.kernel.repository.DefaultArtifactResolver;
-import org.apache.geronimo.kernel.repository.ArtifactManager;
 
 import javax.management.MalformedObjectNameException;
 import javax.management.ObjectName;
@@ -127,6 +127,7 @@
      */
     private final Kernel kernel;
 
+    private final ConfigurationStore configurationStore;
     /**
      * The registered objectName for this configuraion.
      */
@@ -171,11 +172,6 @@
     private byte[] gbeanState;
 
     /**
-     * Base path used to resolve relative class path entries.
-     */
-    private final URL baseURL;
-
-    /**
      * The repositories used dependencies.
      */
     private final Collection repositories;
@@ -191,6 +187,7 @@
     public Configuration() {
         environment = null;
         kernel = null;
+        configurationStore = null;
         objectNameString = null;
         objectName = null;
         moduleType = null;
@@ -198,7 +195,6 @@
         objectNames = null;
         configurationClassLoader = null;
         classPath = null;
-        baseURL = null;
         repositories = null;
         artifactManager = null;
     }
@@ -217,7 +213,6 @@
                          String objectName,
                          ConfigurationModuleType moduleType,
                          Environment environment,
-                         URL baseURL,
                          List classPath,
                          byte[] gbeanState,
                          Collection repositories,
@@ -229,7 +224,6 @@
         this.objectNameString = objectName;
         this.objectName = objectName == null ? null : JMXUtil.getObjectName(objectName);
         this.moduleType = moduleType;
-        this.baseURL = baseURL;
         this.gbeanState = gbeanState;
         this.repositories = repositories;
         if (classPath != null) {
@@ -237,6 +231,7 @@
         } else {
             this.classPath = Collections.EMPTY_LIST;
         }
+        this.configurationStore = configurationStore;
 
         this.artifactManager = artifactManager;
 
@@ -257,6 +252,9 @@
             parents.add(kernel.getProxyManager().createProxy(parentName, Configuration.class));
         }
 
+        //propagate non overridable classes etc from parents.
+        determineInherited();
+
         // resolve dependencies
         LinkedHashSet dependencies = environment.getDependencies();
         dependencies = recursiveResolve(artifactResolver, dependencies);
@@ -286,6 +284,18 @@
         }
     }
 
+    private void determineInherited() {
+
+        for (Iterator iterator = parents.iterator(); iterator.hasNext();) {
+            Configuration parent = (Configuration) iterator.next();
+
+            Environment parentEnvironment = parent.getEnvironment();
+            Set nonOverridableClasses = parentEnvironment.getNonOverrideableClasses();
+            environment.addNonOverrideableClasses(nonOverridableClasses);
+        }
+
+    }
+
     private LinkedHashSet recursiveResolve(ArtifactResolver artifactResolver, LinkedHashSet dependencies) throws MissingDependencyException {
         dependencies = artifactResolver.resolve(parents, dependencies);
         for (Iterator iterator = new ArrayList(dependencies).iterator(); iterator.hasNext();) {
@@ -328,9 +338,14 @@
             for (Iterator i = gbeans.iterator(); i.hasNext();) {
                 GBeanData gbeanData = (GBeanData) i.next();
                 // massage the GBeanData and add the GBean to the kernel
+                setGBeanBaseUrl(gbeanData);
                 loadGBean(gbeanData, objectNames);
             }
             this.objectNames = objectNames;
+        } catch (MalformedURLException e) {
+            throw new InvalidConfigException(e);
+        } catch (NoSuchConfigException e) {
+            throw new InvalidConfigException(e);
         } finally {
             Thread.currentThread().setContextClassLoader(oldCl);
         }
@@ -386,13 +401,14 @@
     }
 
     //TODO remove this when web app cl are config. cl.
-    private static void setGBeanBaseUrl(GBeanData gbeanData, URL baseUrl) {
+    private void setGBeanBaseUrl(GBeanData gbeanData) throws MalformedURLException, NoSuchConfigException {
         GBeanInfo gbeanInfo = gbeanData.getGBeanInfo();
         Set attributes = gbeanInfo.getAttributes();
         for (Iterator iterator = attributes.iterator(); iterator.hasNext();) {
             GAttributeInfo attribute = (GAttributeInfo) iterator.next();
             if (attribute.getName().equals("configurationBaseUrl") && attribute.getType().equals("java.net.URL")) {
-                gbeanData.setAttribute("configurationBaseUrl", baseUrl);
+                URL baseURL = configurationStore.resolve(environment.getConfigId(), URI.create(""));
+                gbeanData.setAttribute("configurationBaseUrl", baseURL);
                 return;
             }
         }
@@ -541,7 +557,6 @@
 
     private ObjectName loadGBean(GBeanData beanData, Set objectNames) throws GBeanAlreadyExistsException {
         ObjectName name = beanData.getName();
-        setGBeanBaseUrl(beanData, baseURL);
 
         log.trace("Registering GBean " + name);
         kernel.loadGBean(beanData, configurationClassLoader);
@@ -656,7 +671,6 @@
         infoFactory.addAttribute("type", ConfigurationModuleType.class, true, false);
         infoFactory.addAttribute("classPath", List.class, true, false);
         infoFactory.addAttribute("gBeanState", byte[].class, true, false);
-        infoFactory.addAttribute("baseURL", URL.class, true, false);
         infoFactory.addAttribute("configurationClassLoader", ClassLoader.class, false);
         //make id readable for convenience
         infoFactory.addAttribute("id", Artifact.class, false);
@@ -681,7 +695,6 @@
                 "objectName",
                 "type",
                 "environment",
-                "baseURL",
                 "classPath",
                 "gBeanState",
                 "Repositories",

Modified: geronimo/branches/configid/modules/kernel/src/java/org/apache/geronimo/kernel/config/ConfigurationManagerImpl.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/configid/modules/kernel/src/java/org/apache/geronimo/kernel/config/ConfigurationManagerImpl.java?rev=380190&r1=380189&r2=380190&view=diff
==============================================================================
--- geronimo/branches/configid/modules/kernel/src/java/org/apache/geronimo/kernel/config/ConfigurationManagerImpl.java (original)
+++ geronimo/branches/configid/modules/kernel/src/java/org/apache/geronimo/kernel/config/ConfigurationManagerImpl.java Thu Feb 23 10:30:08 2006
@@ -19,6 +19,7 @@
 
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
+import org.apache.geronimo.gbean.GBeanData;
 import org.apache.geronimo.gbean.GBeanInfo;
 import org.apache.geronimo.gbean.GBeanInfoBuilder;
 import org.apache.geronimo.gbean.GBeanLifecycle;
@@ -110,9 +111,23 @@
         for (int i = 0; i < storeSnapshot.size(); i++) {
             ConfigurationStore store = (ConfigurationStore) storeSnapshot.get(i);
             if (store.containsConfiguration(configID)) {
-                ObjectName configName = store.loadConfiguration(configID);
-                return configName;
+                GBeanData config = store.loadConfiguration(configID);
+
+                ObjectName name = Configuration.getConfigurationObjectName(configID);
+                config.setName(name);
+                config.setAttribute("configurationStore", store);
+
+                try {
+                    kernel.loadGBean(config, Configuration.class.getClassLoader());
+                } catch (Exception e) {
+                    throw new InvalidConfigException("Unable to register configuration", e);
+                }
+
+                log.debug("Loaded Configuration " + name);
+
+                return name;
             }
+
         }
         throw new NoSuchConfigException("No configuration with id: " + configID);
     }
@@ -183,8 +198,8 @@
             Environment environment = (Environment) kernel.getAttribute(name, "environment");
             for (Iterator iterator = environment.getImports().iterator(); iterator.hasNext();) {
                 Artifact parent = (Artifact) iterator.next();
-                    loadRecursive(parent, ancestors, preloaded);
-                }
+                loadRecursive(parent, ancestors, preloaded);
+            }
         } catch (NoSuchConfigException e) {
             throw e;
         } catch (IOException e) {

Modified: geronimo/branches/configid/modules/kernel/src/java/org/apache/geronimo/kernel/config/ConfigurationStore.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/configid/modules/kernel/src/java/org/apache/geronimo/kernel/config/ConfigurationStore.java?rev=380190&r1=380189&r2=380190&view=diff
==============================================================================
--- geronimo/branches/configid/modules/kernel/src/java/org/apache/geronimo/kernel/config/ConfigurationStore.java (original)
+++ geronimo/branches/configid/modules/kernel/src/java/org/apache/geronimo/kernel/config/ConfigurationStore.java Thu Feb 23 10:30:08 2006
@@ -17,18 +17,16 @@
 
 package org.apache.geronimo.kernel.config;
 
+import org.apache.geronimo.gbean.GBeanData;
+import org.apache.geronimo.kernel.repository.Artifact;
+
 import java.io.File;
 import java.io.IOException;
+import java.net.MalformedURLException;
 import java.net.URI;
 import java.net.URL;
-import java.net.MalformedURLException;
 import java.util.List;
 
-import javax.management.ObjectName;
-
-import org.apache.geronimo.gbean.GBeanData;
-import org.apache.geronimo.kernel.repository.Artifact;
-
 /**
  * Interface to a store for Configurations.
  *
@@ -42,7 +40,7 @@
      * @throws IOException if the CAR could not be read
      * @throws InvalidConfigException if there is a configuration problem with the CAR
      */
-    Artifact install(URL source) throws IOException, InvalidConfigException;
+//    Artifact install(URL source) throws IOException, InvalidConfigException;
 
     /**
      * Move the unpacked configuration directory into this store
@@ -69,7 +67,7 @@
      * @throws IOException if a problem occurs loading the configuration from the store
      * @throws InvalidConfigException if the configuration is corrupt
      */
-    ObjectName loadConfiguration(Artifact configId) throws NoSuchConfigException, IOException, InvalidConfigException;
+//    ObjectName loadConfiguration(Artifact configId) throws NoSuchConfigException, IOException, InvalidConfigException;
 
     /**
      * Determines if the store contains a configuration with the spedified ID.
@@ -102,4 +100,7 @@
      * @return URL for the configuration component.
      */
     URL resolve(Artifact configId, URI uri) throws NoSuchConfigException, MalformedURLException;
+
+    GBeanData loadConfiguration(Artifact configId) throws IOException, InvalidConfigException, NoSuchConfigException;
+
 }

Modified: geronimo/branches/configid/modules/kernel/src/test/org/apache/geronimo/kernel/ConfigTest.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/configid/modules/kernel/src/test/org/apache/geronimo/kernel/ConfigTest.java?rev=380190&r1=380189&r2=380190&view=diff
==============================================================================
--- geronimo/branches/configid/modules/kernel/src/test/org/apache/geronimo/kernel/ConfigTest.java (original)
+++ geronimo/branches/configid/modules/kernel/src/test/org/apache/geronimo/kernel/ConfigTest.java Thu Feb 23 10:30:08 2006
@@ -17,19 +17,33 @@
 
 package org.apache.geronimo.kernel;
 
-import java.util.Collections;
-import javax.management.ObjectName;
-
 import junit.framework.TestCase;
 import org.apache.geronimo.gbean.GBeanData;
+import org.apache.geronimo.gbean.GBeanInfo;
+import org.apache.geronimo.gbean.GBeanInfoBuilder;
 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.ManageableAttributeStore;
+import org.apache.geronimo.kernel.config.NoSuchConfigException;
 import org.apache.geronimo.kernel.management.State;
 import org.apache.geronimo.kernel.repository.Artifact;
 import org.apache.geronimo.kernel.repository.DefaultArtifactManager;
 import org.apache.geronimo.kernel.repository.Environment;
 
+import javax.management.ObjectName;
+import java.io.ByteArrayOutputStream;
+import java.io.File;
+import java.io.IOException;
+import java.io.ObjectOutputStream;
+import java.net.MalformedURLException;
+import java.net.URI;
+import java.net.URL;
+import java.util.Collections;
+import java.util.List;
+
 /**
  * @version $Rev$ $Date$
  */
@@ -130,6 +144,11 @@
         kernel.loadGBean(configurationManagerData, getClass().getClassLoader());
         kernel.startGBean(configurationManagerName);
 
+//        ObjectName configurationStoreName = new ObjectName(":j2eeType=ConfigurationStore,name=foo");
+//        GBeanData configurationStoreData = new GBeanData(configurationStoreName, MockConfigStore.GBEAN_INFO);
+//        kernel.loadGBean(configurationStoreData, getClass().getClassLoader());
+//        kernel.startGBean(configurationStoreName);
+//
         ObjectName artifactManagerName = new ObjectName(":j2eeType=ArtifactManager");
         GBeanData artifactManagerData = new GBeanData(artifactManagerName, DefaultArtifactManager.GBEAN_INFO);
         kernel.loadGBean(artifactManagerData, getClass().getClassLoader());
@@ -163,10 +182,82 @@
         config.setAttribute("gBeanState", state);
         config.setName(configName);
         config.setReferencePattern("ArtifactManager", artifactManagerName);
+        config.setAttribute("configurationStore", new MockConfigStore(new File("foo").toURL()));
     }
 
     protected void tearDown() throws Exception {
         kernel.shutdown();
         super.tearDown();
     }
+
+    public static class MockConfigStore implements ConfigurationStore {
+
+        URL baseURL;
+
+        public MockConfigStore() {
+        }
+
+        public MockConfigStore(URL baseURL) {
+            this.baseURL = baseURL;
+        }
+
+        public void install(ConfigurationData configurationData) throws IOException, InvalidConfigException {
+        }
+
+        public void uninstall(Artifact configID) throws NoSuchConfigException, IOException {
+        }
+
+        public GBeanData loadConfiguration(Artifact configId) throws NoSuchConfigException, IOException, InvalidConfigException {
+            ObjectName configurationObjectName = Configuration.getConfigurationObjectName(configId);
+            GBeanData configData = new GBeanData(configurationObjectName, Configuration.GBEAN_INFO);
+            Environment environment = new Environment();
+            environment.setConfigId(configId);
+            environment.getProperties().put("foo", "geronimo.test:J2EEServer=geronimo");
+            configData.setAttribute("environment", environment);
+            configData.setAttribute("gBeanState", NO_OBJECTS_OS);
+            configData.setAttribute("configurationStore", this);
+            return configData;
+        }
+
+        public boolean containsConfiguration(Artifact configID) {
+            return true;
+        }
+
+        public String getObjectName() {
+            return null;
+        }
+
+        public List listConfigurations() {
+            return null;
+        }
+
+        public File createNewConfigurationDir(Artifact configId) {
+            return null;
+        }
+
+        public URL resolve(Artifact configId, URI uri) throws NoSuchConfigException, MalformedURLException {
+            return baseURL;
+        }
+
+        public final static GBeanInfo GBEAN_INFO;
+
+        private static final byte[] NO_OBJECTS_OS;
+
+        static {
+            GBeanInfoBuilder infoBuilder = GBeanInfoBuilder.createStatic(MockConfigStore.class, "ConfigurationStore");
+            infoBuilder.addInterface(ConfigurationStore.class);
+//            infoBuilder.setConstructor(new String[] {"kernel"});
+            GBEAN_INFO = infoBuilder.getBeanInfo();
+
+            ByteArrayOutputStream baos = new ByteArrayOutputStream();
+            try {
+                ObjectOutputStream oos = new ObjectOutputStream(baos);
+                oos.flush();
+                NO_OBJECTS_OS = baos.toByteArray();
+            } catch (IOException e) {
+                throw new RuntimeException(e);
+            }
+        }
+    }
+
 }

Modified: geronimo/branches/configid/modules/kernel/src/test/org/apache/geronimo/kernel/repository/ArtifactResolverTest.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/configid/modules/kernel/src/test/org/apache/geronimo/kernel/repository/ArtifactResolverTest.java?rev=380190&r1=380189&r2=380190&view=diff
==============================================================================
--- geronimo/branches/configid/modules/kernel/src/test/org/apache/geronimo/kernel/repository/ArtifactResolverTest.java (original)
+++ geronimo/branches/configid/modules/kernel/src/test/org/apache/geronimo/kernel/repository/ArtifactResolverTest.java Thu Feb 23 10:30:08 2006
@@ -16,17 +16,18 @@
  */
 package org.apache.geronimo.kernel.repository;
 
+import junit.framework.TestCase;
+import org.apache.geronimo.kernel.ConfigTest;
+import org.apache.geronimo.kernel.config.Configuration;
+import org.apache.geronimo.kernel.config.ConfigurationModuleType;
+
 import java.io.File;
-import java.util.SortedSet;
-import java.util.TreeSet;
 import java.util.Collections;
-import java.util.Set;
 import java.util.HashSet;
 import java.util.LinkedHashSet;
-
-import junit.framework.TestCase;
-import org.apache.geronimo.kernel.config.Configuration;
-import org.apache.geronimo.kernel.config.ConfigurationModuleType;
+import java.util.Set;
+import java.util.SortedSet;
+import java.util.TreeSet;
 
 /**
  * @version $Rev$ $Date$
@@ -94,9 +95,8 @@
                 environment,
                 null,
                 null,
-                null,
                 Collections.singleton(mockRepository),
-                null,
+                new ConfigTest.MockConfigStore(new File("foo").toURL()),
                 artifactManager,
                 artifactResolver);
         LinkedHashSet parents = new LinkedHashSet();

Modified: geronimo/branches/configid/modules/system/src/java/org/apache/geronimo/system/configuration/ConfigurationDump.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/configid/modules/system/src/java/org/apache/geronimo/system/configuration/ConfigurationDump.java?rev=380190&r1=380189&r2=380190&view=diff
==============================================================================
--- geronimo/branches/configid/modules/system/src/java/org/apache/geronimo/system/configuration/ConfigurationDump.java (original)
+++ geronimo/branches/configid/modules/system/src/java/org/apache/geronimo/system/configuration/ConfigurationDump.java Thu Feb 23 10:30:08 2006
@@ -16,18 +16,6 @@
  */
 package org.apache.geronimo.system.configuration;
 
-import java.io.File;
-import java.io.PrintWriter;
-import java.net.URI;
-import java.util.Collection;
-import java.util.Iterator;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-import javax.management.MalformedObjectNameException;
-import javax.management.ObjectName;
-
 import org.apache.commons.logging.LogFactory;
 import org.apache.geronimo.gbean.GBeanData;
 import org.apache.geronimo.kernel.Kernel;
@@ -42,6 +30,18 @@
 import org.apache.geronimo.system.repository.Maven2Repository;
 import org.apache.geronimo.system.serverinfo.BasicServerInfo;
 
+import javax.management.MalformedObjectNameException;
+import javax.management.ObjectName;
+import java.io.File;
+import java.io.PrintWriter;
+import java.net.URI;
+import java.util.Collection;
+import java.util.Iterator;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
 /**
  * @version $Rev$ $Date$
  */
@@ -277,7 +277,8 @@
             return;
         }
         if (!kernel.isLoaded(name)) {
-            configurationStore.loadConfiguration(configID);
+            //TODO THIS IS NOW BROKEN
+//            configurationStore.loadConfiguration(configID);
         }
         //put the earliest ancestors first, even if we have already started them.
         ancestors.remove(configID);



Mime
View raw message