geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From djen...@apache.org
Subject svn commit: r377136 [2/3] - in /geronimo/branches/configid: modules/client-builder/src/java/org/apache/geronimo/client/builder/ modules/client-builder/src/schema/ modules/client-builder/src/test-resources/plans/ modules/client-builder/src/test/org/apac...
Date Sun, 12 Feb 2006 05:51:43 GMT
Modified: geronimo/branches/configid/modules/jetty-builder/src/test-resources/deployables/war5/WEB-INF/geronimo-jetty.xml
URL: http://svn.apache.org/viewcvs/geronimo/branches/configid/modules/jetty-builder/src/test-resources/deployables/war5/WEB-INF/geronimo-jetty.xml?rev=377136&r1=377135&r2=377136&view=diff
==============================================================================
--- geronimo/branches/configid/modules/jetty-builder/src/test-resources/deployables/war5/WEB-INF/geronimo-jetty.xml (original)
+++ geronimo/branches/configid/modules/jetty-builder/src/test-resources/deployables/war5/WEB-INF/geronimo-jetty.xml Sat Feb 11 21:51:39 2006
@@ -17,10 +17,18 @@
 -->
 
 <web-app
-    xmlns="http://geronimo.apache.org/xml/ns/j2ee/web/jetty-1.0"
-    xmlns:sec="http://geronimo.apache.org/xml/ns/security-1.1"
-    configId="org/apache/geronimo/test">
-
+    xmlns="http://geronimo.apache.org/xml/ns/j2ee/web/jetty-1.1"
+    xmlns:sec="http://geronimo.apache.org/xml/ns/security-1.1">
+    <environment>
+        <configId>
+            <groupId>foo</groupId>
+            <type>car</type>
+            <artifactId>bar</artifactId>
+            <version>1</version>
+        </configId>
+        <classloader></classloader>
+    </environment>
+                                                              
     <context-root>/test</context-root>
     <context-priority-classloader>false</context-priority-classloader>
     <resource-ref>

Modified: geronimo/branches/configid/modules/jetty-builder/src/test-resources/plans/plan1.xml
URL: http://svn.apache.org/viewcvs/geronimo/branches/configid/modules/jetty-builder/src/test-resources/plans/plan1.xml?rev=377136&r1=377135&r2=377136&view=diff
==============================================================================
--- geronimo/branches/configid/modules/jetty-builder/src/test-resources/plans/plan1.xml (original)
+++ geronimo/branches/configid/modules/jetty-builder/src/test-resources/plans/plan1.xml Sat Feb 11 21:51:39 2006
@@ -1,7 +1,16 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<web-app xmlns="http://geronimo.apache.org/xml/ns/j2ee/web-1.0"
-    configId="goodservlet"
-    parentId="org/apache/geronimo/DefaultDatabase">
+<web-app xmlns="http://geronimo.apache.org/xml/ns/j2ee/web-1.1">
+
+    <environment>
+        <configId>
+            <groupId>foo</groupId>
+            <type>car</type>
+            <artifactId>bar</artifactId>
+            <version>1</version>
+        </configId>
+        <classloader></classloader>
+    </environment>
+
     <context-priority-classloader>false</context-priority-classloader>
     <resource-ref>
         <ref-name>jdbc/DB1</ref-name>

Modified: geronimo/branches/configid/modules/jetty-builder/src/test-resources/plans/plan1A.xml
URL: http://svn.apache.org/viewcvs/geronimo/branches/configid/modules/jetty-builder/src/test-resources/plans/plan1A.xml?rev=377136&r1=377135&r2=377136&view=diff
==============================================================================
--- geronimo/branches/configid/modules/jetty-builder/src/test-resources/plans/plan1A.xml (original)
+++ geronimo/branches/configid/modules/jetty-builder/src/test-resources/plans/plan1A.xml Sat Feb 11 21:51:39 2006
@@ -1,7 +1,14 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<web-app xmlns="http://geronimo.apache.org/xml/ns/j2ee/web-1.0"
-    configId="goodservlet"
-    parentId="org/apache/geronimo/DefaultDatabase">
+<web-app xmlns="http://geronimo.apache.org/xml/ns/j2ee/web-1.1">
+    <environment>
+        <configId>
+            <groupId>foo</groupId>
+            <type>car</type>
+            <artifactId>bar</artifactId>
+            <version>1</version>
+        </configId>
+        <classloader></classloader>
+    </environment>
     <context-priority-classloader>false</context-priority-classloader>
     <security-realm-name>public-properties-realm</security-realm-name>
     <security default-role="UNASSIGNED" doas-current-caller="true">

Modified: geronimo/branches/configid/modules/jetty-builder/src/test-resources/plans/plan1B.xml
URL: http://svn.apache.org/viewcvs/geronimo/branches/configid/modules/jetty-builder/src/test-resources/plans/plan1B.xml?rev=377136&r1=377135&r2=377136&view=diff
==============================================================================
--- geronimo/branches/configid/modules/jetty-builder/src/test-resources/plans/plan1B.xml (original)
+++ geronimo/branches/configid/modules/jetty-builder/src/test-resources/plans/plan1B.xml Sat Feb 11 21:51:39 2006
@@ -1,7 +1,14 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<web-app xmlns="http://geronimo.apache.org/xml/ns/j2ee/web-1.0"
-    configId="goodservlet"
-    parentId="org/apache/geronimo/DefaultDatabase">
+<web-app xmlns="http://geronimo.apache.org/xml/ns/j2ee/web-1.1">
+    <environment>
+        <configId>
+            <groupId>foo</groupId>
+            <type>car</type>
+            <artifactId>bar</artifactId>
+            <version>1</version>
+        </configId>
+        <classloader></classloader>
+    </environment>
     <context-priority-classloader>false</context-priority-classloader>
     <security-realm-name>public-properties-realm</security-realm-name>
     <security default-role="UNASSIGNED" doas-current-caller="true">

Modified: geronimo/branches/configid/modules/jetty-builder/src/test-resources/plans/plan1C.xml
URL: http://svn.apache.org/viewcvs/geronimo/branches/configid/modules/jetty-builder/src/test-resources/plans/plan1C.xml?rev=377136&r1=377135&r2=377136&view=diff
==============================================================================
--- geronimo/branches/configid/modules/jetty-builder/src/test-resources/plans/plan1C.xml (original)
+++ geronimo/branches/configid/modules/jetty-builder/src/test-resources/plans/plan1C.xml Sat Feb 11 21:51:39 2006
@@ -1,7 +1,15 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<web-app xmlns="http://geronimo.apache.org/xml/ns/j2ee/web-1.0"
-    configId="goodservlet"
-    parentId="org/apache/geronimo/DefaultDatabase">
+<web-app xmlns="http://geronimo.apache.org/xml/ns/j2ee/web-1.1">
+    <environment>
+        <configId>
+            <groupId>foo</groupId>
+            <type>car</type>
+            <artifactId>bar</artifactId>
+            <version>1</version>
+        </configId>
+        <classloader></classloader>
+    </environment>
+
     <context-priority-classloader>false</context-priority-classloader>
     <security-realm-name>public-properties-realm</security-realm-name>
     <security default-role="UNASSIGNED" doas-current-caller="true">

Modified: geronimo/branches/configid/modules/jetty-builder/src/test-resources/plans/plan2.xml
URL: http://svn.apache.org/viewcvs/geronimo/branches/configid/modules/jetty-builder/src/test-resources/plans/plan2.xml?rev=377136&r1=377135&r2=377136&view=diff
==============================================================================
--- geronimo/branches/configid/modules/jetty-builder/src/test-resources/plans/plan2.xml (original)
+++ geronimo/branches/configid/modules/jetty-builder/src/test-resources/plans/plan2.xml Sat Feb 11 21:51:39 2006
@@ -1,7 +1,14 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<web-app xmlns="http://geronimo.apache.org/xml/ns/j2ee/web/jetty-1.0"
-    configId="goodservlet"
-    parentId="org/apache/geronimo/DefaultDatabase">
+<web-app xmlns="http://geronimo.apache.org/xml/ns/j2ee/web/jetty-1.1">
+    <environment>
+        <configId>
+            <groupId>foo</groupId>
+            <type>car</type>
+            <artifactId>bar</artifactId>
+            <version>1</version>
+        </configId>
+        <classloader></classloader>
+    </environment>
     <context-priority-classloader>false</context-priority-classloader>
     <resource-ref>
         <ref-name>jdbc/DB1</ref-name>

Modified: geronimo/branches/configid/modules/jetty-builder/src/test-resources/plans/plan3.xml
URL: http://svn.apache.org/viewcvs/geronimo/branches/configid/modules/jetty-builder/src/test-resources/plans/plan3.xml?rev=377136&r1=377135&r2=377136&view=diff
==============================================================================
--- geronimo/branches/configid/modules/jetty-builder/src/test-resources/plans/plan3.xml (original)
+++ geronimo/branches/configid/modules/jetty-builder/src/test-resources/plans/plan3.xml Sat Feb 11 21:51:39 2006
@@ -1,6 +1,14 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<web-app xmlns="http://geronimo.apache.org/xml/ns/j2ee/web/jetty-1.0"
-    configId="goodservlet"
-    parentId="org/apache/geronimo/DefaultDatabase">
+<web-app xmlns="http://geronimo.apache.org/xml/ns/j2ee/web/jetty-1.1">
+    <environment>
+        <configId>
+            <groupId>foo</groupId>
+            <type>car</type>
+            <artifactId>bar</artifactId>
+            <version>1</version>
+        </configId>
+        <classloader></classloader>
+    </environment>
+
 
 </web-app>

Modified: geronimo/branches/configid/modules/jetty-builder/src/test-resources/plans/plan4-converted.xml
URL: http://svn.apache.org/viewcvs/geronimo/branches/configid/modules/jetty-builder/src/test-resources/plans/plan4-converted.xml?rev=377136&r1=377135&r2=377136&view=diff
==============================================================================
--- geronimo/branches/configid/modules/jetty-builder/src/test-resources/plans/plan4-converted.xml (original)
+++ geronimo/branches/configid/modules/jetty-builder/src/test-resources/plans/plan4-converted.xml Sat Feb 11 21:51:39 2006
@@ -1,11 +1,19 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<web-app xmlns="http://geronimo.apache.org/xml/ns/j2ee/web/jetty-1.0"
-    configId="goodservlet"
-    parentId="org/apache/geronimo/DefaultDatabase">
+<web-app xmlns="http://geronimo.apache.org/xml/ns/j2ee/web/jetty-1.1"
+         xmlns:dep="http://geronimo.apache.org/xml/ns/deployment-1.1">
 
+    <dep:environment>
+        <dep:configId>
+            <dep:groupId>foo</dep:groupId>
+            <dep:type>car</dep:type>
+            <dep:artifactId>bar</dep:artifactId>
+            <dep:version>1</dep:version>
+        </dep:configId>
+        <dep:classloader/>
+    </dep:environment>
     <context-priority-classloader>true</context-priority-classloader>
 
-            <virtual-host>foo</virtual-host>
-            <virtual-host>bar</virtual-host>
+    <virtual-host>foo</virtual-host>
+    <virtual-host>bar</virtual-host>
 
 </web-app>

Modified: geronimo/branches/configid/modules/jetty-builder/src/test-resources/plans/plan4.xml
URL: http://svn.apache.org/viewcvs/geronimo/branches/configid/modules/jetty-builder/src/test-resources/plans/plan4.xml?rev=377136&r1=377135&r2=377136&view=diff
==============================================================================
--- geronimo/branches/configid/modules/jetty-builder/src/test-resources/plans/plan4.xml (original)
+++ geronimo/branches/configid/modules/jetty-builder/src/test-resources/plans/plan4.xml Sat Feb 11 21:51:39 2006
@@ -1,7 +1,14 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<web-app xmlns="http://geronimo.apache.org/xml/ns/j2ee/web-1.0"
-    configId="goodservlet"
-    parentId="org/apache/geronimo/DefaultDatabase">
+<web-app xmlns="http://geronimo.apache.org/xml/ns/j2ee/web-1.1">
+    <environment>
+        <configId>
+            <groupId>foo</groupId>
+            <type>car</type>
+            <artifactId>bar</artifactId>
+            <version>1</version>
+        </configId>
+        <classloader></classloader>
+    </environment>
 
     <context-priority-classloader>true</context-priority-classloader>
 

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=377136&r1=377135&r2=377136&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 Sat Feb 11 21:51:39 2006
@@ -30,6 +30,7 @@
 import java.util.List;
 import java.util.Map;
 import java.util.Set;
+import java.util.HashMap;
 import javax.management.MalformedObjectNameException;
 import javax.management.ObjectName;
 import javax.naming.Reference;
@@ -103,7 +104,8 @@
     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 List parentId = Arrays.asList(new URI[] {URI.create("org/apache/geronimo/Foo")});
+    private List parentId = Arrays.asList(new Artifact[] {Artifact.create("geronimo/Foo/1/car")});
+    private Environment defaultEnvironment = new Environment();
 
     public void testDeployWar4() throws Exception {
         File outputPath = new File(basedir, "target/test-resources/deployables/war4");
@@ -112,8 +114,7 @@
         File path = new File(basedir, "src/test-resources/deployables/war4");
         UnpackedJarFile jarFile = new UnpackedJarFile(path);
         Module module = builder.createModule(null, jarFile);
-        Environment id = new Environment();
-        EARContext earContext = createEARContext(outputPath, id);
+        EARContext earContext = createEARContext(outputPath, defaultEnvironment);
         ObjectName serverName = earContext.getServerObjectName();
         GBeanData server = new GBeanData(serverName, J2EEServerImpl.GBEAN_INFO);
         start(server);
@@ -132,14 +133,14 @@
         if (kernel.getGBeanState(configData.getName()) != State.RUNNING_INDEX) {
             fail("gbean not started: " + configData.getName());
         }
-        assertEquals(State.RUNNING_INDEX, kernel.getGBeanState(ObjectName.getInstance("test:J2EEApplication=null,J2EEServer=bar,j2eeType=WebModule,name=war4")));
+        assertEquals(State.RUNNING_INDEX, kernel.getGBeanState(ObjectName.getInstance("test:J2EEApplication=null,J2EEServer=server,j2eeType=WebModule,name=unknown/war4/1/car")));
         Set names = kernel.listGBeans(ObjectName.getInstance("test:J2EEApplication=null,J2EEServer=bar,WebModule=war4,*"));
         System.out.println("Object names: " + names);
         for (Iterator iterator = names.iterator(); iterator.hasNext();) {
             ObjectName objectName = (ObjectName) iterator.next();
             assertEquals(State.RUNNING_INDEX, kernel.getGBeanState(objectName));
         }
-        GBeanData filterMapping2Data = kernel.getGBeanData(ObjectName.getInstance("test:J2EEApplication=null,J2EEServer=bar,Servlet=Servlet1,WebFilter=Filter2,WebModule=war4,j2eeType=WebFilterMapping"));
+        GBeanData filterMapping2Data = kernel.getGBeanData(ObjectName.getInstance("test:J2EEApplication=null,J2EEServer=server,Servlet=Servlet1,WebFilter=Filter2,WebModule=unknown/war4/1/car,j2eeType=WebFilterMapping"));
 //        assertEquals(Collections.singleton(ObjectName.getInstance("test:J2EEApplication=null,J2EEServer=bar,Servlet=Servlet1,WebFilter=Filter1,WebModule=war4,j2eeType=WebFilterMapping")), filterMapping2Data.getReferencePatterns("Previous"));
 
         kernel.stopGBean(configName);
@@ -165,7 +166,8 @@
                 ctcName,
                 null,
                 null,
-                null, new RefContext(new EJBReferenceBuilder() {
+                null,
+                new RefContext(new EJBReferenceBuilder() {
 
                     public Reference createEJBLocalReference(String objectName, GBeanData gbeanData, boolean isSession, String localHome, String local) throws DeploymentException {
                         return null;
@@ -289,8 +291,10 @@
         securityServiceGBean.setAttribute("policyProvider", "org.apache.geronimo.security.jacc.GeronimoPolicy");
         start(securityServiceGBean);
 
-
-        builder = new JettyModuleBuilder(new URI[] {new URI("null")}, new Integer(1800), false, Collections.EMPTY_LIST, containerName, defaultServlets, defaultFilters, defaultFilterMappings, pojoWebServiceTemplate, webServiceBuilder, null, kernel);
+        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);
 
         container = new GBeanData(containerName, JettyContainerImpl.GBEAN_INFO);
 
@@ -362,8 +366,10 @@
             ObjectName configurationObjectName = Configuration.getConfigurationObjectName(configId);
             GBeanData configData = new GBeanData(configurationObjectName, Configuration.GBEAN_INFO);
             configData.setAttribute("id", configId);
-            configData.setAttribute("domain", "test");
-            configData.setAttribute("server", "bar");
+            Map nameKeys = new HashMap();
+            nameKeys.put("domain", "test");
+            nameKeys.put("J2EEServer", "server");
+            configData.setAttribute("nameKeys", nameKeys);
             configData.setAttribute("gBeanState", NO_OBJECTS_OS);
 
             try {

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=377136&r1=377135&r2=377136&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 Sat Feb 11 21:51:39 2006
@@ -13,6 +13,9 @@
 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.deployment.Environment;
 import org.apache.geronimo.j2ee.deployment.WebServiceBuilder;
 import org.apache.geronimo.kernel.jmx.JMXUtil;
 import org.apache.geronimo.schema.SchemaConversionUtils;
@@ -35,10 +38,11 @@
     ObjectName jettyContainerObjectName = JMXUtil.getObjectName("test:type=JettyContainer");
     ObjectName pojoWebServiceTemplate = null;
     WebServiceBuilder webServiceBuilder = null;
+    private Environment defaultEnvironment = new Environment();
     private JettyModuleBuilder builder;
 
     public PlanParsingTest() throws Exception {
-        builder = new JettyModuleBuilder(new URI[]{URI.create("defaultParent")}, 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, null);
     }
 
     public void testContents() throws Exception {
@@ -102,8 +106,7 @@
     public void testConstructPlan() throws Exception {
         JettyWebAppDocument jettyWebAppDoc = JettyWebAppDocument.Factory.newInstance();
         JettyWebAppType webApp = jettyWebAppDoc.addNewWebApp();
-        webApp.setConfigId("configId");
-        webApp.setParentId("parentId");
+        addEnvironment(webApp);
         webApp.setContextPriorityClassloader(false);
         GerResourceRefType ref = webApp.addNewResourceRef();
         ref.setRefName("ref");
@@ -113,6 +116,16 @@
         System.out.println(webApp.toString());
     }
 
+    private void addEnvironment(JettyWebAppType webApp) {
+        EnvironmentType environmentType = webApp.addNewEnvironment();
+        ArtifactType configId = environmentType.addNewConfigId();
+        configId.setGroupId("g");
+        configId.setArtifactId("a");
+        configId.setVersion("1");
+        configId.setType("car");
+        environmentType.addNewClassloader();
+    }
+
     public void testContextPriorityClassloader() throws Exception {
         URL resourcePlan = classLoader.getResource("plans/plan3.xml");
         assertTrue(resourcePlan != null);
@@ -140,7 +153,7 @@
 
         JettyWebAppDocument jettyWebAppDoc = JettyWebAppDocument.Factory.newInstance();
         JettyWebAppType webApp = jettyWebAppDoc.addNewWebApp();
-        webApp.setConfigId("myId");
+        addEnvironment(webApp);
         webApp.setContextRoot("myContextRoot");
         webApp.setContextPriorityClassloader(false);
 

Modified: geronimo/branches/configid/modules/naming-builder/src/test/org/apache/geronimo/naming/deployment/MessageDestinationTest.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/configid/modules/naming-builder/src/test/org/apache/geronimo/naming/deployment/MessageDestinationTest.java?rev=377136&r1=377135&r2=377136&view=diff
==============================================================================
--- geronimo/branches/configid/modules/naming-builder/src/test/org/apache/geronimo/naming/deployment/MessageDestinationTest.java (original)
+++ geronimo/branches/configid/modules/naming-builder/src/test/org/apache/geronimo/naming/deployment/MessageDestinationTest.java Sat Feb 11 21:51:39 2006
@@ -40,6 +40,7 @@
 import org.apache.geronimo.deployment.GBeanDataRegistry;
 import org.apache.geronimo.kernel.Kernel;
 import org.apache.geronimo.kernel.GBeanNotFoundException;
+import org.apache.geronimo.kernel.repository.Artifact;
 import org.apache.geronimo.xbeans.j2ee.MessageDestinationType;
 import org.apache.geronimo.xbeans.j2ee.MessageDestinationRefType;
 import org.apache.geronimo.xbeans.geronimo.naming.GerMessageDestinationType;
@@ -206,8 +207,8 @@
             return gbeans.getGBeanInstance(name);
         }
 
-        public URI getConfigID() {
-            return URI.create("MockNamingContextID");
+        public Artifact getConfigID() {
+            return new Artifact("groupId", "MockNamingContextID", "1", "car", true);
         }
     }
 

Modified: geronimo/branches/configid/modules/service-builder/src/java/org/apache/geronimo/deployment/service/EnvironmentBuilder.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/configid/modules/service-builder/src/java/org/apache/geronimo/deployment/service/EnvironmentBuilder.java?rev=377136&r1=377135&r2=377136&view=diff
==============================================================================
--- geronimo/branches/configid/modules/service-builder/src/java/org/apache/geronimo/deployment/service/EnvironmentBuilder.java (original)
+++ geronimo/branches/configid/modules/service-builder/src/java/org/apache/geronimo/deployment/service/EnvironmentBuilder.java Sat Feb 11 21:51:39 2006
@@ -23,7 +23,14 @@
 import org.apache.geronimo.deployment.xbeans.ClassloaderType;
 import org.apache.geronimo.deployment.xbeans.ClassFilterType;
 import org.apache.geronimo.deployment.xbeans.ArtifactType;
+import org.apache.geronimo.deployment.xbeans.EnvironmentDocument;
 import org.apache.geronimo.kernel.repository.Artifact;
+import org.apache.geronimo.common.DeploymentException;
+import org.apache.geronimo.schema.SchemaConversionUtils;
+import org.apache.geronimo.gbean.GBeanInfo;
+import org.apache.geronimo.gbean.GBeanInfoBuilder;
+import org.apache.xmlbeans.XmlObject;
+import org.apache.xmlbeans.XmlException;
 
 import java.util.Map;
 import java.util.HashMap;
@@ -34,7 +41,8 @@
 /**
  * @version $Rev:$ $Date:$
  */
-public class EnvironmentBuilder {
+public class EnvironmentBuilder implements XmlAttributeBuilder {
+    private final static String NAMESPACE = EnvironmentDocument.type.getDocumentElementName().getNamespaceURI();
 
 
     public static Environment buildEnvironment(EnvironmentType environmentType) {
@@ -58,7 +66,7 @@
             environment.setIncludes(toArtifacts(classloaderType.getIncludeArray()));
 
             environment.setInverseClassloading(classloaderType.isSetInverseClassloading());
-            environment.setSuppressDefaultParentId(classloaderType.isSetSuppressDefaultParentId());
+            environment.setSuppressDefaultEnvironment(classloaderType.isSetSuppressDefaultEnvironment());
             environment.setHiddenClasses(toFilters(classloaderType.getHiddenClassesArray()));
             environment.setNonOverrideableClasses(toFilters(classloaderType.getNonOverridableClassesArray()));
         }
@@ -67,6 +75,24 @@
         return environment;
     }
 
+    public static void mergeEnvironments(Environment environment, Environment additionalEnvironment) {
+        environment.addNameKeys(additionalEnvironment.getNameKeys());
+        environment.addImports(additionalEnvironment.getImports());
+        environment.addDependencies(additionalEnvironment.getDependencies());
+        environment.addIncludes(additionalEnvironment.getIncludes());
+        environment.setInverseClassloading(environment.isInverseClassloading() || additionalEnvironment.isInverseClassloading());
+        environment.setSuppressDefaultEnvironment(environment.isSuppressDefaultEnvironment() || additionalEnvironment.isSuppressDefaultEnvironment());
+        environment.addHiddenClasses(additionalEnvironment.getHiddenClasses());
+        environment.addNonOverrideableClasses(additionalEnvironment.getNonOverrideableClasses());
+        environment.addReferences(additionalEnvironment.getReferences());
+    }
+
+    public static Environment buildEnvironment(EnvironmentType environmentType, Environment defaultEnvironment) {
+        Environment environment = buildEnvironment(environmentType);
+        mergeEnvironments(environment, defaultEnvironment);
+        return environment;
+    }
+
     private static Set toFilters(ClassFilterType[] filterArray) {
         Set filters = new HashSet();
         for (int i = 0; i < filterArray.length; i++) {
@@ -78,7 +104,7 @@
     }
 
     //package level for testing
-     static LinkedHashSet toArtifacts(ArtifactType[] artifactTypes) {
+    static LinkedHashSet toArtifacts(ArtifactType[] artifactTypes) {
         LinkedHashSet artifacts = new LinkedHashSet();
         for (int i = 0; i < artifactTypes.length; i++) {
             ArtifactType artifactType = artifactTypes[i];
@@ -89,7 +115,7 @@
     }
 
     //TODO make private
-     static Artifact toArtifact(ArtifactType artifactType) {
+    static Artifact toArtifact(ArtifactType artifactType) {
         String groupId = artifactType.isSetGroupId() ? artifactType.getGroupId().trim() : null;
         String type = artifactType.isSetType() ? artifactType.getType().trim() : "jar";
         String artifactId = artifactType.getArtifactId().trim();
@@ -98,4 +124,26 @@
     }
 
 
+    public String getNamespace() {
+        return NAMESPACE;
+    }
+
+    public Object getValue(XmlObject xmlObject, String type, ClassLoader cl) throws DeploymentException {
+
+        EnvironmentType environmentType;
+        if (xmlObject instanceof EnvironmentType) {
+            environmentType = (EnvironmentType) xmlObject;
+        } else {
+            environmentType = (EnvironmentType) xmlObject.copy().changeType(EnvironmentType.type);
+        }
+        try {
+            SchemaConversionUtils.validateDD(environmentType);
+        } catch (XmlException e) {
+            throw new DeploymentException(e);
+        }
+
+        return buildEnvironment(environmentType);
+    }
+
+    //This is added by hand to the xmlAttributeBuilders since it is needed to bootstrap the ServiceConfigBuilder.
 }

Modified: geronimo/branches/configid/modules/service-builder/src/java/org/apache/geronimo/deployment/service/ServiceConfigBuilder.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/configid/modules/service-builder/src/java/org/apache/geronimo/deployment/service/ServiceConfigBuilder.java?rev=377136&r1=377135&r2=377136&view=diff
==============================================================================
--- geronimo/branches/configid/modules/service-builder/src/java/org/apache/geronimo/deployment/service/ServiceConfigBuilder.java (original)
+++ geronimo/branches/configid/modules/service-builder/src/java/org/apache/geronimo/deployment/service/ServiceConfigBuilder.java Sat Feb 11 21:51:39 2006
@@ -22,13 +22,10 @@
 import org.apache.geronimo.deployment.DeploymentContext;
 import org.apache.geronimo.deployment.Environment;
 import org.apache.geronimo.deployment.xbeans.AttributeType;
-import org.apache.geronimo.deployment.xbeans.ClassFilterType;
-import org.apache.geronimo.deployment.xbeans.ClassloaderType;
 import org.apache.geronimo.deployment.xbeans.ConfigurationDocument;
 import org.apache.geronimo.deployment.xbeans.ConfigurationType;
 import org.apache.geronimo.deployment.xbeans.EnvironmentType;
 import org.apache.geronimo.deployment.xbeans.GbeanType;
-import org.apache.geronimo.deployment.xbeans.NameKeyType;
 import org.apache.geronimo.deployment.xbeans.PatternType;
 import org.apache.geronimo.deployment.xbeans.ReferenceType;
 import org.apache.geronimo.deployment.xbeans.ReferencesType;
@@ -69,18 +66,14 @@
 import java.util.Collection;
 import java.util.Collections;
 import java.util.HashMap;
-import java.util.HashSet;
-import java.util.LinkedHashSet;
-import java.util.List;
 import java.util.Map;
-import java.util.Set;
 import java.util.jar.JarFile;
 
 /**
  * @version $Rev$ $Date$
  */
 public class ServiceConfigBuilder implements ConfigurationBuilder {
-    private final List defaultParentId;
+    private final Environment defaultEnvironment;
     private final Repository repository;
     private final Kernel kernel;
 
@@ -92,12 +85,14 @@
     private static final QName SERVICE_QNAME = new QName("http://geronimo.apache.org/xml/ns/deployment-1.0", "configuration");
 
 
-    public ServiceConfigBuilder(URI[] defaultParentId, Repository repository) {
-        this(defaultParentId, repository, null, null, null);
+    public ServiceConfigBuilder(Environment defaultEnvironment, Repository repository) {
+        this(defaultEnvironment, repository, null, null, null);
     }
 
-    public ServiceConfigBuilder(URI[] defaultParentId, Repository repository, Collection xmlAttributeBuilders, Collection xmlReferenceBuilders, Kernel kernel) {
-        this.defaultParentId = defaultParentId == null ? Collections.EMPTY_LIST : Arrays.asList(defaultParentId);
+    public ServiceConfigBuilder(Environment defaultEnvironment, Repository repository, Collection xmlAttributeBuilders, Collection xmlReferenceBuilders, Kernel kernel) {
+        EnvironmentBuilder environmentBuilder = new EnvironmentBuilder();
+        xmlAttributeBuilderMap.put(environmentBuilder.getNamespace(), environmentBuilder);
+        this.defaultEnvironment = defaultEnvironment;
 
         this.repository = repository;
         this.kernel = kernel;
@@ -158,7 +153,7 @@
     public URI getConfigurationID(Object plan, JarFile module) throws IOException, DeploymentException {
         ConfigurationType configType = (ConfigurationType) plan;
         EnvironmentType environmentType = configType.getEnvironment();
-        Environment environment = EnvironmentBuilder.buildEnvironment(environmentType);
+        Environment environment = EnvironmentBuilder.buildEnvironment(environmentType, defaultEnvironment);
         Artifact configId = environment.getConfigId();
         try {
             return configId.toURI();
@@ -175,7 +170,7 @@
 
     public ConfigurationData buildConfiguration(ConfigurationType configurationType, File outfile) throws DeploymentException, IOException {
 
-        Environment environment = EnvironmentBuilder.buildEnvironment(configurationType.getEnvironment());
+        Environment environment = EnvironmentBuilder.buildEnvironment(configurationType.getEnvironment(), defaultEnvironment);
 
 
         DeploymentContext context = new DeploymentContext(outfile, environment, ConfigurationModuleType.SERVICE, kernel);
@@ -213,10 +208,11 @@
         }
     }
 
+    //TODO this is part of Environment resolution
     public static void addDependencies(DeploymentContext context, ArtifactType[] deps, Repository repository) throws DeploymentException {
         for (int i = 0; i < deps.length; i++) {
             URI dependencyURI = getDependencyURI(deps[i], repository);
-            context.addDependency(dependencyURI);
+//            context.addDependency(dependencyURI);
 
             URL url;
             try {
@@ -368,13 +364,13 @@
 
         infoFactory.addInterface(ConfigurationBuilder.class);
 
-        infoFactory.addAttribute("defaultParentId", URI[].class, true);
+        infoFactory.addAttribute("defaultEnvironment", Environment.class, true);
         infoFactory.addReference("Repository", Repository.class, NameFactory.GERONIMO_SERVICE);
         infoFactory.addReference("XmlAttributeBuilders", XmlAttributeBuilder.class, "XmlAttributeBuilder");
         infoFactory.addReference("XmlReferenceBuilders", XmlReferenceBuilder.class, "XmlReferenceBuilder");
         infoFactory.addAttribute("kernel", Kernel.class, false);
 
-        infoFactory.setConstructor(new String[]{"defaultParentId", "Repository", "XmlAttributeBuilders", "XmlReferenceBuilders", "kernel"});
+        infoFactory.setConstructor(new String[]{"defaultEnvironment", "Repository", "XmlAttributeBuilders", "XmlReferenceBuilders", "kernel"});
 
         GBEAN_INFO = infoFactory.getBeanInfo();
     }

Modified: geronimo/branches/configid/modules/service-builder/src/java/org/apache/geronimo/deployment/xmlbeans/XmlBeansUtil.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/configid/modules/service-builder/src/java/org/apache/geronimo/deployment/xmlbeans/XmlBeansUtil.java?rev=377136&r1=377135&r2=377136&view=diff
==============================================================================
--- geronimo/branches/configid/modules/service-builder/src/java/org/apache/geronimo/deployment/xmlbeans/XmlBeansUtil.java (original)
+++ geronimo/branches/configid/modules/service-builder/src/java/org/apache/geronimo/deployment/xmlbeans/XmlBeansUtil.java Sat Feb 11 21:51:39 2006
@@ -37,20 +37,20 @@
     private static final Map NAMESPACE_UPDATES = new HashMap();
 
     static {
-        NAMESPACE_UPDATES.put("http://geronimo.apache.org/xml/ns/j2ee/application-client", "http://geronimo.apache.org/xml/ns/j2ee/application-client-1.0");
-        NAMESPACE_UPDATES.put("http://geronimo.apache.org/xml/ns/j2ee/application", "http://geronimo.apache.org/xml/ns/j2ee/application-1.0");
-        NAMESPACE_UPDATES.put("http://geronimo.apache.org/xml/ns/deployment", "http://geronimo.apache.org/xml/ns/deployment-1.0");
-        NAMESPACE_UPDATES.put("http://geronimo.apache.org/xml/ns/j2ee/connector", "http://geronimo.apache.org/xml/ns/j2ee/connector-1.0");
+        NAMESPACE_UPDATES.put("http://geronimo.apache.org/xml/ns/j2ee/application-client", "http://geronimo.apache.org/xml/ns/j2ee/application-client-1.1");
+        NAMESPACE_UPDATES.put("http://geronimo.apache.org/xml/ns/j2ee/application", "http://geronimo.apache.org/xml/ns/j2ee/application-1.1");
+        NAMESPACE_UPDATES.put("http://geronimo.apache.org/xml/ns/deployment", "http://geronimo.apache.org/xml/ns/deployment-1.1");
+        NAMESPACE_UPDATES.put("http://geronimo.apache.org/xml/ns/j2ee/connector", "http://geronimo.apache.org/xml/ns/j2ee/connector-1.1");
         NAMESPACE_UPDATES.put("http://geronimo.apache.org/xml/ns/deployment/javabean", "http://geronimo.apache.org/xml/ns/deployment/javabean-1.0");
         NAMESPACE_UPDATES.put("http://geronimo.apache.org/xml/ns/loginconfig", "http://geronimo.apache.org/xml/ns/loginconfig-1.0");
         NAMESPACE_UPDATES.put("http://geronimo.apache.org/xml/ns/naming", "http://geronimo.apache.org/xml/ns/naming-1.0");
         NAMESPACE_UPDATES.put("http://geronimo.apache.org/xml/ns/security", "http://geronimo.apache.org/xml/ns/security-1.1");
-        NAMESPACE_UPDATES.put("http://geronimo.apache.org/xml/ns/web", "http://geronimo.apache.org/xml/ns/j2ee/web-1.0");
-        NAMESPACE_UPDATES.put("http://geronimo.apache.org/xml/ns/web/jetty", "http://geronimo.apache.org/xml/ns/j2ee/web/jetty-1.0");
+        NAMESPACE_UPDATES.put("http://geronimo.apache.org/xml/ns/web", "http://geronimo.apache.org/xml/ns/j2ee/web-1.1");
+        NAMESPACE_UPDATES.put("http://geronimo.apache.org/xml/ns/web/jetty", "http://geronimo.apache.org/xml/ns/j2ee/web/jetty-1.1");
         NAMESPACE_UPDATES.put("http://geronimo.apache.org/xml/ns/web/jetty/config", "http://geronimo.apache.org/xml/ns/j2ee/web/jetty/config-1.0");
-        NAMESPACE_UPDATES.put("http://geronimo.apache.org/xml/ns/web/tomcat", "http://geronimo.apache.org/xml/ns/j2ee/web/tomcat-1.0");
+        NAMESPACE_UPDATES.put("http://geronimo.apache.org/xml/ns/web/tomcat", "http://geronimo.apache.org/xml/ns/j2ee/web/tomcat-1.1");
         NAMESPACE_UPDATES.put("http://geronimo.apache.org/xml/ns/web/tomcat/config", "http://geronimo.apache.org/xml/ns/j2ee/web/tomcat/config-1.0");
-        NAMESPACE_UPDATES.put("http://www.openejb.org/xml/ns/openejb-jar", "http://www.openejb.org/xml/ns/openejb-jar-2.0");
+        NAMESPACE_UPDATES.put("http://www.openejb.org/xml/ns/openejb-jar", "http://www.openejb.org/xml/ns/openejb-jar-2.1");
         NAMESPACE_UPDATES.put("http://www.openejb.org/xml/ns/pkgen", "http://www.openejb.org/xml/ns/pkgen-2.0");
         NAMESPACE_UPDATES.put("http://www.openejb.org/xml/ns/corba-css-config_1_0", "http://www.openejb.org/xml/ns/corba-css-config-2.0");
         NAMESPACE_UPDATES.put("http://www.openejb.org/xml/ns/corba-tss-config_1_0", "http://www.openejb.org/xml/ns/corba-tss-config-2.0");
@@ -109,7 +109,7 @@
         XmlOptions options = new XmlOptions();
         options.setLoadLineNumbers();
         options.setErrorListener(errors);
-        options.setLoadSubstituteNamespaces(NAMESPACE_UPDATES);
+//        options.setLoadSubstituteNamespaces(NAMESPACE_UPDATES);
         return options;
     }
 }

Modified: geronimo/branches/configid/modules/service-builder/src/schema/geronimo-config-1.1.xsd
URL: http://svn.apache.org/viewcvs/geronimo/branches/configid/modules/service-builder/src/schema/geronimo-config-1.1.xsd?rev=377136&r1=377135&r2=377136&view=diff
==============================================================================
--- geronimo/branches/configid/modules/service-builder/src/schema/geronimo-config-1.1.xsd (original)
+++ geronimo/branches/configid/modules/service-builder/src/schema/geronimo-config-1.1.xsd Sat Feb 11 21:51:39 2006
@@ -55,6 +55,8 @@
         </xs:key>
 -->
     </xs:element>
+    <xs:element name="client-environment" type="sys:environmentType"/>
+    <xs:element name="server-environment" type="sys:environmentType"/>
 
     <xs:complexType name="environmentType">
         <xs:sequence>
@@ -179,7 +181,7 @@
                 </xs:annotation>
             </xs:element>
             <xs:element name="inverse-classloading" type="sys:emptyType" minOccurs="0"/>
-            <xs:element name="suppress-default-parentId" type="sys:emptyType" minOccurs="0"/>
+            <xs:element name="suppress-default-environment" type="sys:emptyType" minOccurs="0"/>
         </xs:sequence>
     </xs:complexType>
 

Modified: geronimo/branches/configid/modules/service-builder/src/test/org/apache/geronimo/deployment/service/ServiceConfigBuilderTest.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/configid/modules/service-builder/src/test/org/apache/geronimo/deployment/service/ServiceConfigBuilderTest.java?rev=377136&r1=377135&r2=377136&view=diff
==============================================================================
--- geronimo/branches/configid/modules/service-builder/src/test/org/apache/geronimo/deployment/service/ServiceConfigBuilderTest.java (original)
+++ geronimo/branches/configid/modules/service-builder/src/test/org/apache/geronimo/deployment/service/ServiceConfigBuilderTest.java Sat Feb 11 21:51:39 2006
@@ -16,45 +16,40 @@
  */
 package org.apache.geronimo.deployment.service;
 
-import java.net.URI;
-import java.net.URL;
-import java.net.MalformedURLException;
-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.DeploymentContext;
+import org.apache.geronimo.deployment.Environment;
+import org.apache.geronimo.deployment.FooBarBean;
 import org.apache.geronimo.deployment.xbeans.ConfigurationDocument;
 import org.apache.geronimo.deployment.xbeans.ConfigurationType;
 import org.apache.geronimo.deployment.xbeans.GbeanType;
-import org.apache.geronimo.deployment.DeploymentContext;
-import org.apache.geronimo.deployment.FooBarBean;
-import org.apache.geronimo.deployment.Environment;
-import org.apache.geronimo.kernel.config.ConfigurationModuleType;
-import org.apache.geronimo.kernel.repository.Repository;
-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.gbean.GBeanData;
 import org.apache.geronimo.gbean.ReferenceCollection;
 import org.apache.geronimo.gbean.ReferenceCollectionListener;
+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.kernel.config.ConfigurationModuleType;
+
+import javax.management.ObjectName;
+import java.io.File;
+import java.net.URL;
+import java.util.ArrayList;
+import java.util.Set;
 
 /**
  * @version $Rev$ $Date$
  */
 public class ServiceConfigBuilderTest extends TestCase {
 
-    private URI[] parentIdArray = new URI[] {URI.create("test/foo")};
-    private List parentId = Arrays.asList(parentIdArray);
+    private Environment parentEnvironment = new Environment();
 
     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);
-        new ServiceConfigBuilder(parentIdArray, null, referenceCollection, null, null);
+        new ServiceConfigBuilder(parentEnvironment, null, referenceCollection, null, null);
         ClassLoader cl = Thread.currentThread().getContextClassLoader();
         final URL plan1 = cl.getResource("services/plan1.xml");
         ConfigurationDocument doc = ConfigurationDocument.Factory.parse(plan1);

Modified: geronimo/branches/configid/modules/system/src/java/org/apache/geronimo/system/main/CommandLine.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/configid/modules/system/src/java/org/apache/geronimo/system/main/CommandLine.java?rev=377136&r1=377135&r2=377136&view=diff
==============================================================================
--- geronimo/branches/configid/modules/system/src/java/org/apache/geronimo/system/main/CommandLine.java (original)
+++ geronimo/branches/configid/modules/system/src/java/org/apache/geronimo/system/main/CommandLine.java Sat Feb 11 21:51:39 2006
@@ -32,6 +32,7 @@
 import org.apache.geronimo.kernel.InternalKernelException;
 import org.apache.geronimo.kernel.KernelFactory;
 import org.apache.geronimo.kernel.Kernel;
+import org.apache.geronimo.kernel.repository.Artifact;
 import org.apache.geronimo.kernel.config.ConfigurationManager;
 import org.apache.geronimo.kernel.config.ConfigurationUtil;
 import org.apache.geronimo.kernel.config.Configuration;
@@ -129,10 +130,10 @@
         ConfigurationManager configurationManager = ConfigurationUtil.getConfigurationManager(kernel);
         try {
             for (Iterator i = configurations.iterator(); i.hasNext();) {
-                URI configID = (URI) i.next();
+                Artifact configID = (Artifact) i.next();
                 List list = configurationManager.loadRecursive(configID);
                 for (Iterator iterator = list.iterator(); iterator.hasNext();) {
-                    URI name = (URI) iterator.next();
+                    Artifact name = (Artifact) iterator.next();
                     configurationManager.loadGBeans(name);
                     configurationManager.start(name);
                 }

Modified: geronimo/branches/configid/modules/system/src/java/org/apache/geronimo/system/main/Daemon.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/configid/modules/system/src/java/org/apache/geronimo/system/main/Daemon.java?rev=377136&r1=377135&r2=377136&view=diff
==============================================================================
--- geronimo/branches/configid/modules/system/src/java/org/apache/geronimo/system/main/Daemon.java (original)
+++ geronimo/branches/configid/modules/system/src/java/org/apache/geronimo/system/main/Daemon.java Sat Feb 11 21:51:39 2006
@@ -39,6 +39,7 @@
 import org.apache.geronimo.gbean.GBeanQuery;
 import org.apache.geronimo.kernel.Kernel;
 import org.apache.geronimo.kernel.KernelFactory;
+import org.apache.geronimo.kernel.repository.Artifact;
 import org.apache.geronimo.kernel.config.Configuration;
 import org.apache.geronimo.kernel.config.ConfigurationManager;
 import org.apache.geronimo.kernel.config.ConfigurationUtil;
@@ -317,20 +318,20 @@
                 }
             }
 
-            monitor.foundConfigurations((URI[]) configs.toArray(new URI[configs.size()]));
+            monitor.foundConfigurations((Artifact[]) configs.toArray(new Artifact[configs.size()]));
 
             // load the rest of the configurations
             try {
                 ConfigurationManager configurationManager = ConfigurationUtil.getConfigurationManager(kernel);
                 try {
                     for (Iterator i = configs.iterator(); i.hasNext();) {
-                        URI configID = (URI) i.next();
+                        Artifact configID = (Artifact) i.next();
                         monitor.configurationLoading(configID);
                         List list = configurationManager.loadRecursive(configID);
                         monitor.configurationLoaded(configID);
                         monitor.configurationStarting(configID);
                         for (Iterator iterator = list.iterator(); iterator.hasNext();) {
-                            URI name = (URI) iterator.next();
+                            Artifact name = (Artifact) iterator.next();
                             configurationManager.loadGBeans(name);
                             configurationManager.start(name);
                         }

Modified: geronimo/branches/configid/modules/system/src/java/org/apache/geronimo/system/main/LongStartupMonitor.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/configid/modules/system/src/java/org/apache/geronimo/system/main/LongStartupMonitor.java?rev=377136&r1=377135&r2=377136&view=diff
==============================================================================
--- geronimo/branches/configid/modules/system/src/java/org/apache/geronimo/system/main/LongStartupMonitor.java (original)
+++ geronimo/branches/configid/modules/system/src/java/org/apache/geronimo/system/main/LongStartupMonitor.java Sat Feb 11 21:51:39 2006
@@ -2,13 +2,13 @@
 
 import java.io.PrintStream;
 import java.util.*;
-import java.net.URI;
 import java.net.InetSocketAddress;
 import javax.management.ObjectName;
 import javax.management.MalformedObjectNameException;
 import org.apache.geronimo.kernel.Kernel;
 import org.apache.geronimo.kernel.GBeanNotFoundException;
 import org.apache.geronimo.kernel.NoSuchAttributeException;
+import org.apache.geronimo.kernel.repository.Artifact;
 import org.apache.geronimo.kernel.management.State;
 import org.apache.geronimo.gbean.GBeanInfo;
 import org.apache.geronimo.gbean.GAttributeInfo;
@@ -60,27 +60,28 @@
         this.kernel = kernel;
     }
 
-    public synchronized void foundConfigurations(URI[] configurations) {
+    public synchronized void foundConfigurations(Artifact[] configurations) {
         numConfigs = configurations.length;
         numConfigsDigits = Integer.toString(numConfigs).length();
-        
     }
 
-    public synchronized void configurationLoading(URI configuration) {
+    public synchronized void configurationLoading(Artifact configuration) {
+        StringBuffer buf = new StringBuffer("Configuration ").append(configuration);
+        out.print(buf.toString());
         configNum++;
     }
 
-    public synchronized void configurationLoaded(URI configuration) {
+    public synchronized void configurationLoaded(Artifact configuration) {
     }
 
-    public synchronized void configurationStarting(URI configuration) {
+    public synchronized void configurationStarting(Artifact configuration) {
         configStarted = System.currentTimeMillis();        
     }
 
-    public synchronized void configurationStarted(URI configuration) {
+    public synchronized void configurationStarted(Artifact configuration) {
         int time = Math.round((float)(System.currentTimeMillis() - configStarted)/1000f);
         StringBuffer buf = new StringBuffer();
-        buf.append("Started configuration ");
+        buf.append(" started in ");
         // pad config index
         int configIndexDigits = Integer.toString(configNum).length();
         for(; configIndexDigits < numConfigsDigits; configIndexDigits++) {
@@ -92,7 +93,7 @@
         for(; timeDigits < MIN_TIME_WIDTH; timeDigits++) {
             buf.append(' ');
         }
-        buf.append(time+"s "+configuration);
+        buf.append(time).append("s ");
         out.println(buf.toString());
     }
 

Modified: geronimo/branches/configid/modules/system/src/java/org/apache/geronimo/system/main/ProgressBarStartupMonitor.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/configid/modules/system/src/java/org/apache/geronimo/system/main/ProgressBarStartupMonitor.java?rev=377136&r1=377135&r2=377136&view=diff
==============================================================================
--- geronimo/branches/configid/modules/system/src/java/org/apache/geronimo/system/main/ProgressBarStartupMonitor.java (original)
+++ geronimo/branches/configid/modules/system/src/java/org/apache/geronimo/system/main/ProgressBarStartupMonitor.java Sat Feb 11 21:51:39 2006
@@ -9,6 +9,7 @@
 import org.apache.geronimo.kernel.Kernel;
 import org.apache.geronimo.kernel.GBeanNotFoundException;
 import org.apache.geronimo.kernel.NoSuchAttributeException;
+import org.apache.geronimo.kernel.repository.Artifact;
 import org.apache.geronimo.kernel.management.State;
 import org.apache.geronimo.gbean.GBeanInfo;
 import org.apache.geronimo.gbean.GAttributeInfo;
@@ -38,7 +39,7 @@
     private final static int MAX_WIDTH=70;
     private PrintStream out;
     private String currentOperation;
-    private URI[] configurations;
+    private Artifact[] configurations;
     private char[] configStatus = new char[0];
     private long started;
     private int percent = 0;
@@ -59,7 +60,7 @@
         currentOperation = "Loading";
     }
 
-    public synchronized void foundConfigurations(URI[] configurations) {
+    public synchronized void foundConfigurations(Artifact[] configurations) {
         this.configurations = configurations;
         configStatus = new char[configurations.length];
         for (int i = 0; i < configStatus.length; i++) {
@@ -100,7 +101,7 @@
         this.percent = percent;
     }
 
-    public synchronized void configurationLoading(URI configuration) {
+    public synchronized void configurationLoading(Artifact configuration) {
         currentOperation = " Loading "+configuration;
         for (int i = 0; i < configurations.length; i++) {
             if(configurations[i].equals(configuration)) {
@@ -110,7 +111,7 @@
         repaint();
     }
 
-    public synchronized void configurationLoaded(URI configuration) {
+    public synchronized void configurationLoaded(Artifact configuration) {
         for (int i = 0; i < configurations.length; i++) {
             if(configurations[i].equals(configuration)) {
                 configStatus[i] = STATUS_LOADED;
@@ -120,11 +121,11 @@
         repaint();
     }
 
-    public synchronized void configurationStarting(URI configuration) {
+    public synchronized void configurationStarting(Artifact configuration) {
         currentOperation = "Starting "+configuration;
     }
 
-    public synchronized void configurationStarted(URI configuration) {
+    public synchronized void configurationStarted(Artifact configuration) {
         for (int i = 0; i < configurations.length; i++) {
             if(configurations[i].equals(configuration)) {
                 configStatus[i] = STATUS_STARTED;

Modified: geronimo/branches/configid/modules/system/src/java/org/apache/geronimo/system/main/SilentStartupMonitor.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/configid/modules/system/src/java/org/apache/geronimo/system/main/SilentStartupMonitor.java?rev=377136&r1=377135&r2=377136&view=diff
==============================================================================
--- geronimo/branches/configid/modules/system/src/java/org/apache/geronimo/system/main/SilentStartupMonitor.java (original)
+++ geronimo/branches/configid/modules/system/src/java/org/apache/geronimo/system/main/SilentStartupMonitor.java Sat Feb 11 21:51:39 2006
@@ -1,11 +1,11 @@
 package org.apache.geronimo.system.main;
 
-import java.net.URI;
 import java.util.Set;
 import java.util.Iterator;
 
 import org.apache.geronimo.kernel.Kernel;
 import org.apache.geronimo.kernel.GBeanNotFoundException;
+import org.apache.geronimo.kernel.repository.Artifact;
 import org.apache.geronimo.kernel.management.State;
 import org.apache.commons.logging.LogFactory;
 import org.apache.commons.logging.Log;
@@ -28,19 +28,19 @@
         this.kernel = kernel;
     }
 
-    public void foundConfigurations(URI[] configurations) {
+    public void foundConfigurations(Artifact[] configurations) {
     }
 
-    public void configurationLoading(URI configuration) {
+    public void configurationLoading(Artifact configuration) {
     }
 
-    public void configurationLoaded(URI configuration) {
+    public void configurationLoaded(Artifact configuration) {
     }
 
-    public void configurationStarting(URI configuration) {
+    public void configurationStarting(Artifact configuration) {
     }
 
-    public void configurationStarted(URI configuration) {
+    public void configurationStarted(Artifact configuration) {
     }
 
     public void startupFinished() {

Modified: geronimo/branches/configid/modules/system/src/java/org/apache/geronimo/system/main/StartupMonitor.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/configid/modules/system/src/java/org/apache/geronimo/system/main/StartupMonitor.java?rev=377136&r1=377135&r2=377136&view=diff
==============================================================================
--- geronimo/branches/configid/modules/system/src/java/org/apache/geronimo/system/main/StartupMonitor.java (original)
+++ geronimo/branches/configid/modules/system/src/java/org/apache/geronimo/system/main/StartupMonitor.java Sat Feb 11 21:51:39 2006
@@ -2,6 +2,7 @@
 
 import java.net.URI;
 import org.apache.geronimo.kernel.Kernel;
+import org.apache.geronimo.kernel.repository.Artifact;
 
 /**
  * An interface used by the Daemon to convey the status of the server
@@ -13,11 +14,11 @@
     // Normal calls, will generally occur in this order
     void systemStarting(long startTime);
     void systemStarted(Kernel kernel);
-    void foundConfigurations(URI[] configurations);
-    void configurationLoading(URI configuration);
-    void configurationLoaded(URI configuration);
-    void configurationStarting(URI configuration);
-    void configurationStarted(URI configuration);
+    void foundConfigurations(Artifact[] configurations);
+    void configurationLoading(Artifact configuration);
+    void configurationLoaded(Artifact configuration);
+    void configurationStarting(Artifact configuration);
+    void configurationStarted(Artifact configuration);
     void startupFinished();
 
     // Indicate failures during load

Modified: geronimo/branches/configid/modules/tomcat-builder/src/java/org/apache/geronimo/tomcat/deployment/TomcatModuleBuilder.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/configid/modules/tomcat-builder/src/java/org/apache/geronimo/tomcat/deployment/TomcatModuleBuilder.java?rev=377136&r1=377135&r2=377136&view=diff
==============================================================================
--- geronimo/branches/configid/modules/tomcat-builder/src/java/org/apache/geronimo/tomcat/deployment/TomcatModuleBuilder.java (original)
+++ geronimo/branches/configid/modules/tomcat-builder/src/java/org/apache/geronimo/tomcat/deployment/TomcatModuleBuilder.java Sat Feb 11 21:51:39 2006
@@ -51,11 +51,12 @@
 import org.apache.commons.logging.LogFactory;
 import org.apache.geronimo.common.DeploymentException;
 import org.apache.geronimo.deployment.service.ServiceConfigBuilder;
+import org.apache.geronimo.deployment.service.EnvironmentBuilder;
 import org.apache.geronimo.deployment.util.DeploymentUtil;
 import org.apache.geronimo.deployment.xmlbeans.XmlBeansUtil;
-import org.apache.geronimo.deployment.xbeans.ClassFilterType;
-import org.apache.geronimo.deployment.xbeans.DependencyType;
 import org.apache.geronimo.deployment.xbeans.GbeanType;
+import org.apache.geronimo.deployment.xbeans.EnvironmentType;
+import org.apache.geronimo.deployment.xbeans.ArtifactType;
 import org.apache.geronimo.deployment.Environment;
 import org.apache.geronimo.gbean.GBeanData;
 import org.apache.geronimo.gbean.GBeanInfo;
@@ -116,7 +117,7 @@
 
     private static final Log log = LogFactory.getLog(TomcatModuleBuilder.class);
 
-    private final List defaultParentId;
+    private final Environment defaultEnvironment;
     private final boolean defaultContextPriorityClassloader;
     private final ObjectName tomcatContainerObjectName;
 
@@ -125,12 +126,12 @@
     private final Repository repository;
     private static final String TOMCAT_NAMESPACE = TomcatWebAppDocument.type.getDocumentElementName().getNamespaceURI();
 
-    public TomcatModuleBuilder(URI[] defaultParentId,
+    public TomcatModuleBuilder(Environment defaultEnvironment,
                                boolean defaultContextPriorityClassloader,
                                ObjectName tomcatContainerObjectName,
                                WebServiceBuilder webServiceBuilder,
                                Repository repository) {
-        this.defaultParentId = defaultParentId == null ? Collections.EMPTY_LIST : Arrays.asList(defaultParentId);
+        this.defaultEnvironment = defaultEnvironment;
 
         this.defaultContextPriorityClassloader = defaultContextPriorityClassloader;
         this.tomcatContainerObjectName = tomcatContainerObjectName;
@@ -181,18 +182,8 @@
         // parse vendor dd
         TomcatWebAppType tomcatWebApp = getTomcatWebApp(plan, moduleFile, standAlone, targetPath, webApp);
 
-        // get the ids from either the application plan or for a stand alone module from the specific deployer
-        URI configId = null;
-        try {
-            configId = new URI(tomcatWebApp.getConfigId());
-        } catch (URISyntaxException e) {
-            throw new DeploymentException("Invalid configId " + tomcatWebApp.getConfigId(), e);
-        }
-
-        List parentId = ServiceConfigBuilder.toArtifacts(tomcatWebApp.getParentId(), tomcatWebApp.getImportArray());
-        if (parentId.isEmpty()) {
-            parentId = new ArrayList(defaultParentId);
-        }
+        EnvironmentType environmentType = tomcatWebApp.getEnvironment();
+        Environment environment = EnvironmentBuilder.buildEnvironment(environmentType, defaultEnvironment);
 
         if (contextRoot == null) {
             if (tomcatWebApp.isSetContextRoot()) {
@@ -214,7 +205,7 @@
             }
         }
 
-        WebModule module = new WebModule(standAlone, configId, moduleFile, targetPath, webApp, tomcatWebApp, specDD, contextRoot, portMap, TOMCAT_NAMESPACE);
+        WebModule module = new WebModule(standAlone, environment, moduleFile, targetPath, webApp, tomcatWebApp, specDD, contextRoot, portMap, TOMCAT_NAMESPACE);
         return module;
     }
 
@@ -224,7 +215,7 @@
      *
      * @param webApp
      * @param contextRoot
-     * @return
+     * @return map of servlet names to path mapped to them.  Possibly inaccurate except for web services.
      */
     private Map buildServletNameToPathMap(WebAppType webApp, String contextRoot) {
         contextRoot = "/" + contextRoot;
@@ -315,7 +306,13 @@
 
     private TomcatWebAppType createDefaultPlan(String path) {
         TomcatWebAppType tomcatWebApp = TomcatWebAppType.Factory.newInstance();
-        tomcatWebApp.setConfigId(path);
+        EnvironmentType environmentType = tomcatWebApp.addNewEnvironment();
+        ArtifactType artifact = environmentType.addNewConfigId();
+        //TODO this version is incomplete.
+        artifact.setGroupId("unknown");
+        artifact.setArtifactId(path);
+        artifact.setVersion("1");
+        artifact.setType("car");
         tomcatWebApp.setContextRoot("/" + path);
         tomcatWebApp.setContextPriorityClassloader(defaultContextPriorityClassloader);
         return tomcatWebApp;
@@ -324,7 +321,6 @@
     public void installModule(JarFile earFile, EARContext earContext, Module module) throws DeploymentException {
         TomcatWebAppType tomcatWebApp = (TomcatWebAppType) module.getVendorDD();
 
-        earContext.addParentId(defaultParentId);
         try {
             URI baseDir = URI.create(module.getTargetPath() + "/");
 
@@ -346,24 +342,12 @@
             // and the url class loader will not pick up a manifiest from an unpacked dir
             earContext.addManifestClassPath(warFile, URI.create(module.getTargetPath()));
 
-            // add the dependencies declared in the geronimo-web.xml file
-            DependencyType[] dependencies = tomcatWebApp.getDependencyArray();
-            ServiceConfigBuilder.addDependencies(earContext, dependencies, repository);
         } catch (IOException e) {
             throw new DeploymentException("Problem deploying war", e);
         } catch (URISyntaxException e) {
             throw new DeploymentException("Could not construct URI for location of war entry", e);
         }
 
-        if (tomcatWebApp.isSetInverseClassloading()) {
-            earContext.setInverseClassloading(tomcatWebApp.getInverseClassloading());
-        }
-
-        ClassFilterType[] filters = tomcatWebApp.getHiddenClassesArray();
-        ServiceConfigBuilder.addHiddenClasses(earContext, filters);
-
-        filters = tomcatWebApp.getNonOverridableClassesArray();
-        ServiceConfigBuilder.addNonOverridableClasses(earContext, filters);
     }
 
     public void initContext(EARContext earContext, Module module, ClassLoader cl) throws DeploymentException {
@@ -986,7 +970,7 @@
 
     static {
         GBeanInfoBuilder infoBuilder = GBeanInfoBuilder.createStatic(TomcatModuleBuilder.class, NameFactory.MODULE_BUILDER);
-        infoBuilder.addAttribute("defaultParentId", URI[].class, true, true);
+        infoBuilder.addAttribute("defaultEnvironment", Environment.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);
@@ -994,7 +978,7 @@
         infoBuilder.addInterface(ModuleBuilder.class);
 
         infoBuilder.setConstructor(new String[]{
-            "defaultParentId",
+            "defaultEnvironment",
             "defaultContextPriorityClassloader",
             "tomcatContainerObjectName",
             "WebServiceBuilder",

Modified: geronimo/branches/configid/modules/tomcat-builder/src/test-resources/deployables/war4/WEB-INF/geronimo-web.xml
URL: http://svn.apache.org/viewcvs/geronimo/branches/configid/modules/tomcat-builder/src/test-resources/deployables/war4/WEB-INF/geronimo-web.xml?rev=377136&r1=377135&r2=377136&view=diff
==============================================================================
--- geronimo/branches/configid/modules/tomcat-builder/src/test-resources/deployables/war4/WEB-INF/geronimo-web.xml (original)
+++ geronimo/branches/configid/modules/tomcat-builder/src/test-resources/deployables/war4/WEB-INF/geronimo-web.xml Sat Feb 11 21:51:39 2006
@@ -16,9 +16,17 @@
     limitations under the License.
 -->
 <web-app
-    xmlns="http://geronimo.apache.org/xml/ns/j2ee/web-1.0"
-    xmlns:sec="http://geronimo.apache.org/xml/ns/security-1.1"
-    configId="org/apache/geronimo/test">
+    xmlns="http://geronimo.apache.org/xml/ns/j2ee/web-1.1"
+    xmlns:sec="http://geronimo.apache.org/xml/ns/security-1.1">
+    <environment>
+        <configId>
+            <groupId>foo</groupId>
+            <type>car</type>
+            <artifactId>bar</artifactId>
+            <version>1</version>
+        </configId>
+        <classloader></classloader>
+    </environment>
 
     <context-root>/test</context-root>
     <context-priority-classloader>false</context-priority-classloader>

Modified: geronimo/branches/configid/modules/tomcat-builder/src/test-resources/plans/plan1.xml
URL: http://svn.apache.org/viewcvs/geronimo/branches/configid/modules/tomcat-builder/src/test-resources/plans/plan1.xml?rev=377136&r1=377135&r2=377136&view=diff
==============================================================================
--- geronimo/branches/configid/modules/tomcat-builder/src/test-resources/plans/plan1.xml (original)
+++ geronimo/branches/configid/modules/tomcat-builder/src/test-resources/plans/plan1.xml Sat Feb 11 21:51:39 2006
@@ -1,7 +1,14 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<web-app xmlns="http://geronimo.apache.org/xml/ns/j2ee/web-1.0"
-    configId="goodservlet"
-    parentId="org/apache/geronimo/DefaultDatabase">
+<web-app xmlns="http://geronimo.apache.org/xml/ns/j2ee/web-1.1">
+    <environment>
+        <configId>
+            <groupId>foo</groupId>
+            <type>car</type>
+            <artifactId>bar</artifactId>
+            <version>1</version>
+        </configId>
+        <classloader></classloader>
+    </environment>
     <context-priority-classloader>false</context-priority-classloader>
     <security-realm-name>public-properties-realm</security-realm-name>
     <security default-role="UNASSIGNED" doas-current-caller="true">

Modified: geronimo/branches/configid/modules/tomcat-builder/src/test/org/apache/geronimo/tomcat/deployment/PlanParsingTest.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/configid/modules/tomcat-builder/src/test/org/apache/geronimo/tomcat/deployment/PlanParsingTest.java?rev=377136&r1=377135&r2=377136&view=diff
==============================================================================
--- geronimo/branches/configid/modules/tomcat-builder/src/test/org/apache/geronimo/tomcat/deployment/PlanParsingTest.java (original)
+++ geronimo/branches/configid/modules/tomcat-builder/src/test/org/apache/geronimo/tomcat/deployment/PlanParsingTest.java Sat Feb 11 21:51:39 2006
@@ -1,6 +1,7 @@
 package org.apache.geronimo.tomcat.deployment;
 
 import java.io.File;
+import java.net.URL;
 import javax.management.ObjectName;
 
 import junit.framework.TestCase;
@@ -11,10 +12,13 @@
 import org.apache.geronimo.xbeans.geronimo.web.GerWebAppDocument;
 import org.apache.geronimo.xbeans.geronimo.web.GerWebAppType;
 import org.apache.geronimo.xbeans.geronimo.web.tomcat.TomcatWebAppType;
+import org.apache.geronimo.deployment.xbeans.EnvironmentType;
+import org.apache.geronimo.deployment.xbeans.ArtifactType;
 
 /**
  */
 public class PlanParsingTest extends TestCase {
+    private ClassLoader classLoader = this.getClass().getClassLoader();
     ObjectName tomcatContainerObjectName = JMXUtil.getObjectName("test:type=TomcatContainer");
     Kernel kernel = null;
     private TomcatModuleBuilder builder;
@@ -25,27 +29,28 @@
     }
 
     public void testResourceRef() throws Exception {
-        File resourcePlan = new File(basedir, "src/test-resources/plans/plan1.xml");
+        URL resourceURL = classLoader.getResource("plans/plan1.xml");
+        File resourcePlan = new File(resourceURL.getFile());
         assertTrue(resourcePlan.exists());
-        TomcatWebAppType jettyWebApp = builder.getTomcatWebApp(resourcePlan, null, true, null, null);
-        assertEquals(1, jettyWebApp.getResourceRefArray().length);
+        TomcatWebAppType tomcatWebApp = builder.getTomcatWebApp(resourcePlan, null, true, null, null);
+        assertEquals(1, tomcatWebApp.getResourceRefArray().length);
     }
 
     public void testConstructPlan() throws Exception {
         GerWebAppDocument tomcatWebAppDoc = GerWebAppDocument.Factory.newInstance();
         GerWebAppType tomcatWebAppType = tomcatWebAppDoc.addNewWebApp();
-        tomcatWebAppType.setConfigId("configId");
-        tomcatWebAppType.setParentId("parentId");
+        EnvironmentType environmentType = tomcatWebAppType.addNewEnvironment();
+        ArtifactType artifactType = environmentType.addNewConfigId();
+        artifactType.setArtifactId("foo");
+
+        environmentType.addNewClassloader();
         tomcatWebAppType.setContextPriorityClassloader(false);
         GerResourceRefType ref = tomcatWebAppType.addNewResourceRef();
         ref.setRefName("ref");
         ref.setTargetName("target");
 
         SchemaConversionUtils.validateDD(tomcatWebAppType);
-        System.out.println(tomcatWebAppType.toString());
+//        System.out.println(tomcatWebAppType.toString());
     }
 
-    public void testParseSpecDD() {
-
-    }
 }

Modified: geronimo/branches/configid/modules/tomcat-builder/src/test/org/apache/geronimo/tomcat/deployment/TomcatModuleBuilderTest.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/configid/modules/tomcat-builder/src/test/org/apache/geronimo/tomcat/deployment/TomcatModuleBuilderTest.java?rev=377136&r1=377135&r2=377136&view=diff
==============================================================================
--- geronimo/branches/configid/modules/tomcat-builder/src/test/org/apache/geronimo/tomcat/deployment/TomcatModuleBuilderTest.java (original)
+++ geronimo/branches/configid/modules/tomcat-builder/src/test/org/apache/geronimo/tomcat/deployment/TomcatModuleBuilderTest.java Sat Feb 11 21:51:39 2006
@@ -144,14 +144,15 @@
 
     private File basedir = new File(System.getProperty("basedir", "."));
 
-    private List parentId = Arrays.asList(new URI[] {URI.create("org/apache/geronimo/Foo")});
+    private List parentId = Arrays.asList(new Artifact[] {Artifact.create("geronimo/Foo/1/car")});
+    private Environment defaultEnvironment = new Environment();
 
     public void testDeployWar4() throws Exception {
-        deployWar("war4", "org/apache/geronimo/test");
+        deployWar("war4", "foo/bar/1/car");
     }
 
     public void testDeployWar5() throws Exception {
-        deployWar("war5", "hello");
+        deployWar("war5", "unknown/hello/1/car");
     }
 
     public void deployWar(String warName, String name) throws Exception {
@@ -165,7 +166,6 @@
         recursiveCopy(path, dest);
         UnpackedJarFile jarFile = new UnpackedJarFile(dest);
         Module module = builder.createModule(null, jarFile);
-        URI id = new URI(warName);
 
         ObjectName jaccBeanName = NameFactory.getComponentName(null, null, null, null, "foo", NameFactory.JACC_MANAGER, moduleContext);
         GBeanData jaccBeanData = new GBeanData(jaccBeanName, ApplicationPolicyConfigurationManager.GBEAN_INFO);
@@ -179,7 +179,7 @@
         jaccBeanData.setAttribute("roleDesignates", new HashMap());
         start(jaccBeanData);
 
-        EARContext earContext = createEARContext(outputPath, id);
+        EARContext earContext = createEARContext(outputPath, defaultEnvironment);
         earContext.setJaccManagerName(jaccBeanName);
         ObjectName serverName = earContext.getServerObjectName();
         GBeanData server = new GBeanData(serverName, J2EEServerImpl.GBEAN_INFO);
@@ -199,9 +199,9 @@
             fail("gbean not started: " + configName);
         }
 
-        assertEquals(State.RUNNING_INDEX, kernel.getGBeanState(ObjectName.getInstance("test:J2EEApplication=null,J2EEServer=bar,j2eeType=WebModule,name=" + name)));
+        assertEquals(State.RUNNING_INDEX, kernel.getGBeanState(ObjectName.getInstance("test:J2EEApplication=null,J2EEServer=server,j2eeType=WebModule,name=" + name)));
 
-        Set names = kernel.listGBeans(ObjectName.getInstance("test:J2EEApplication=null,J2EEServer=bar,*"));
+        Set names = kernel.listGBeans(ObjectName.getInstance("test:J2EEApplication=null,J2EEServer=server,*"));
         System.out.println("Object names: " + names);
         for (Iterator iterator = names.iterator(); iterator.hasNext();) {
             ObjectName objectName = (ObjectName) iterator.next();
@@ -335,6 +335,12 @@
     }
 
     protected void setUp() throws Exception {
+        Artifact artifact = Artifact.create("test/foo/1/car");
+        defaultEnvironment.setConfigId(artifact);
+        Map nameKeys = new HashMap();
+        nameKeys.put("domain", "test");
+        nameKeys.put("J2EEServer", "server");
+        defaultEnvironment.addNameKeys(nameKeys);
         cl = this.getClass().getClassLoader();
         containerName = NameFactory.getWebComponentName(null, null, null, null,
                 "tomcatContainer", "WebResource", moduleContext);
@@ -394,7 +400,7 @@
 
         WebServiceBuilder webServiceBuilder = new AxisBuilder();
 
-        builder = new TomcatModuleBuilder(new URI[] {new URI("null")}, true, containerName, webServiceBuilder, null);
+        builder = new TomcatModuleBuilder(defaultEnvironment, true, containerName, webServiceBuilder, null);
 
         // Default Realm
         Map initParams = new HashMap();
@@ -502,8 +508,10 @@
             ObjectName configurationObjectName = Configuration.getConfigurationObjectName(configId);
             GBeanData configData = new GBeanData(configurationObjectName, Configuration.GBEAN_INFO);
             configData.setAttribute("id", configId);
-            configData.setAttribute("domain", "test");
-            configData.setAttribute("server", "bar");
+            Map nameKeys = new HashMap();
+            nameKeys.put("domain", "test");
+            nameKeys.put("J2EEServer", "server");
+            configData.setAttribute("nameKeys", nameKeys);
             configData.setAttribute("gBeanState", NO_OBJECTS_OS);
 
             try {

Modified: geronimo/branches/configid/modules/web-builder/src/test-resources/plans/tomcat-post.xml
URL: http://svn.apache.org/viewcvs/geronimo/branches/configid/modules/web-builder/src/test-resources/plans/tomcat-post.xml?rev=377136&r1=377135&r2=377136&view=diff
==============================================================================
--- geronimo/branches/configid/modules/web-builder/src/test-resources/plans/tomcat-post.xml (original)
+++ geronimo/branches/configid/modules/web-builder/src/test-resources/plans/tomcat-post.xml Sat Feb 11 21:51:39 2006
@@ -1,5 +1,14 @@
 <?xml version="1.0"?>
-<xml-fragment configId="org/apache/jetspeed/web" xmlns:tom="http://geronimo.apache.org/xml/ns/j2ee/web/tomcat-1.0" xmlns:nam="http://geronimo.apache.org/xml/ns/naming-1.0" xmlns:sec="http://geronimo.apache.org/xml/ns/security-1.1" xmlns:dep="http://geronimo.apache.org/xml/ns/deployment-1.0">
+<xml-fragment xmlns:tom="http://geronimo.apache.org/xml/ns/j2ee/web/tomcat-1.1" xmlns:nam="http://geronimo.apache.org/xml/ns/naming-1.0" xmlns:sec="http://geronimo.apache.org/xml/ns/security-1.1" xmlns:dep="http://geronimo.apache.org/xml/ns/deployment-1.1">
+    <dep:environment>
+        <dep:configId>
+            <dep:groupId>test</dep:groupId>
+            <dep:type>car</dep:type>
+            <dep:artifactId>testclient</dep:artifactId>
+            <dep:version>1</dep:version>
+        </dep:configId>
+
+    </dep:environment>
     <tom:context-priority-classloader>false</tom:context-priority-classloader>
     <tom:cross-context/>
     <tom:tomcat-realm>TomcatJAASRealm</tom:tomcat-realm>

Modified: geronimo/branches/configid/modules/web-builder/src/test-resources/plans/tomcat-pre.xml
URL: http://svn.apache.org/viewcvs/geronimo/branches/configid/modules/web-builder/src/test-resources/plans/tomcat-pre.xml?rev=377136&r1=377135&r2=377136&view=diff
==============================================================================
--- geronimo/branches/configid/modules/web-builder/src/test-resources/plans/tomcat-pre.xml (original)
+++ geronimo/branches/configid/modules/web-builder/src/test-resources/plans/tomcat-pre.xml Sat Feb 11 21:51:39 2006
@@ -1,5 +1,14 @@
 <?xml version="1.0"?>
-<web-app xmlns="http://geronimo.apache.org/xml/ns/j2ee/web-1.0" configId="org/apache/jetspeed/web">
+<web-app xmlns="http://geronimo.apache.org/xml/ns/j2ee/web-1.1">
+    <dep:environment xmlns:dep="http://geronimo.apache.org/xml/ns/deployment-1.1">
+        <dep:configId>
+            <dep:groupId>test</dep:groupId>
+            <dep:type>car</dep:type>
+            <dep:artifactId>testclient</dep:artifactId>
+            <dep:version>1</dep:version>
+        </dep:configId>
+
+    </dep:environment>
     <context-priority-classloader>false</context-priority-classloader>
     <container-config>
         <tomcat xmlns="http://geronimo.apache.org/xml/ns/web/tomcat/config-1.0">

Modified: geronimo/branches/configid/modules/web-builder/src/test-resources/plans/tomcat-pre2.xml
URL: http://svn.apache.org/viewcvs/geronimo/branches/configid/modules/web-builder/src/test-resources/plans/tomcat-pre2.xml?rev=377136&r1=377135&r2=377136&view=diff
==============================================================================
--- geronimo/branches/configid/modules/web-builder/src/test-resources/plans/tomcat-pre2.xml (original)
+++ geronimo/branches/configid/modules/web-builder/src/test-resources/plans/tomcat-pre2.xml Sat Feb 11 21:51:39 2006
@@ -1,5 +1,13 @@
 <?xml version="1.0"?>
-<web-app xmlns="http://geronimo.apache.org/xml/ns/j2ee/web-1.0" configId="org/apache/jetspeed/web">
+<web-app xmlns="http://geronimo.apache.org/xml/ns/j2ee/web-1.1">
+    <dep:environment xmlns:dep="http://geronimo.apache.org/xml/ns/deployment-1.1">
+        <dep:configId>
+            <dep:groupId>test</dep:groupId>
+            <dep:type>car</dep:type>
+            <dep:artifactId>testclient</dep:artifactId>
+            <dep:version>1</dep:version>
+        </dep:configId>
+    </dep:environment>
     <context-priority-classloader>false</context-priority-classloader>
     <container-config>
         <tomcat xmlns="http://geronimo.apache.org/xml/ns/web/tomcat/config-1.0">
@@ -22,7 +30,7 @@
             </role>
         </role-mappings>
     </security>
-    <gbean name="jetspeed-realm" class="org.apache.geronimo.security.realm.GenericSecurityRealm" xmlns="http://geronimo.apache.org/xml/ns/deployment-1.0">
+    <gbean name="jetspeed-realm" class="org.apache.geronimo.security.realm.GenericSecurityRealm" xmlns="http://geronimo.apache.org/xml/ns/deployment-1.1">
         <attribute name="realmName">jetspeed-realm</attribute>
         <xml-reference name="LoginModuleConfiguration">
             <lc:login-config xmlns:lc="http://geronimo.apache.org/xml/ns/loginconfig-1.0">

Modified: geronimo/branches/configid/modules/web-builder/src/test-resources/plans/tomcat-pre3.xml
URL: http://svn.apache.org/viewcvs/geronimo/branches/configid/modules/web-builder/src/test-resources/plans/tomcat-pre3.xml?rev=377136&r1=377135&r2=377136&view=diff
==============================================================================
--- geronimo/branches/configid/modules/web-builder/src/test-resources/plans/tomcat-pre3.xml (original)
+++ geronimo/branches/configid/modules/web-builder/src/test-resources/plans/tomcat-pre3.xml Sat Feb 11 21:51:39 2006
@@ -1,5 +1,13 @@
 <?xml version="1.0"?>
-<web-app xmlns="http://geronimo.apache.org/xml/ns/web" configId="org/apache/jetspeed/web">
+<web-app xmlns="http://geronimo.apache.org/xml/ns/web">
+    <dep:environment xmlns:dep="http://geronimo.apache.org/xml/ns/deployment-1.1">
+        <dep:configId>
+            <dep:groupId>test</dep:groupId>
+            <dep:type>car</dep:type>
+            <dep:artifactId>testclient</dep:artifactId>
+            <dep:version>1</dep:version>
+        </dep:configId>
+    </dep:environment>
     <context-priority-classloader>false</context-priority-classloader>
     <container-config>
         <tomcat xmlns="http://geronimo.apache.org/xml/ns/web/tomcat/config-1.0">
@@ -22,7 +30,7 @@
             </role>
         </role-mappings>
     </security>
-    <gbean name="jetspeed-realm" class="org.apache.geronimo.security.realm.GenericSecurityRealm" xmlns="http://geronimo.apache.org/xml/ns/deployment-1.0">
+    <gbean name="jetspeed-realm" class="org.apache.geronimo.security.realm.GenericSecurityRealm" xmlns="http://geronimo.apache.org/xml/ns/deployment-1.1">
         <attribute name="realmName">jetspeed-realm</attribute>
         <xml-reference name="LoginModuleConfiguration">
             <lc:login-config xmlns:lc="http://geronimo.apache.org/xml/ns/loginconfig-1.0">

Modified: geronimo/branches/configid/modules/web-builder/src/test/org/apache/geronimo/web/deployment/GenericToSpecificPlanConverterTest.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/configid/modules/web-builder/src/test/org/apache/geronimo/web/deployment/GenericToSpecificPlanConverterTest.java?rev=377136&r1=377135&r2=377136&view=diff
==============================================================================
--- geronimo/branches/configid/modules/web-builder/src/test/org/apache/geronimo/web/deployment/GenericToSpecificPlanConverterTest.java (original)
+++ geronimo/branches/configid/modules/web-builder/src/test/org/apache/geronimo/web/deployment/GenericToSpecificPlanConverterTest.java Sat Feb 11 21:51:39 2006
@@ -47,12 +47,13 @@
         URL srcXml = classLoader.getResource(prePlanName);
         URL expectedOutputXml = classLoader.getResource("plans/tomcat-post.xml");
         XmlObject rawPlan = XmlBeansUtil.parse(srcXml);
+        System.out.println("RAW PLAN " + rawPlan.toString());
         XmlObject expected = XmlObject.Factory.parse(expectedOutputXml);
         XmlObject webPlan = new GenericToSpecificPlanConverter("http://geronimo.apache.org/xml/ns/web/tomcat/config-1.0",
-                "http://geronimo.apache.org/xml/ns/j2ee/web/tomcat-1.0", "tomcat").convertToSpecificPlan(rawPlan);
+                "http://geronimo.apache.org/xml/ns/j2ee/web/tomcat-1.1", "tomcat").convertToSpecificPlan(rawPlan);
 
-//        System.out.println(webPlan.toString());
-//        System.out.println(expected.toString());
+        System.out.println("PROCESSED: " + webPlan.toString());
+        System.out.println("EXPECTED: " + expected.toString());
         List problems = new ArrayList();
         boolean ok = compareXmlObjects(webPlan, expected, problems);
         assertTrue("Differences: " + problems, ok);

Modified: geronimo/branches/configid/plugins/geronimo-assembly-plugin/src/java/org/apache/geronimo/plugin/assembly/BaseConfigInstaller.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/configid/plugins/geronimo-assembly-plugin/src/java/org/apache/geronimo/plugin/assembly/BaseConfigInstaller.java?rev=377136&r1=377135&r2=377136&view=diff
==============================================================================
--- geronimo/branches/configid/plugins/geronimo-assembly-plugin/src/java/org/apache/geronimo/plugin/assembly/BaseConfigInstaller.java (original)
+++ geronimo/branches/configid/plugins/geronimo-assembly-plugin/src/java/org/apache/geronimo/plugin/assembly/BaseConfigInstaller.java Sat Feb 11 21:51:39 2006
@@ -28,6 +28,7 @@
 import org.apache.geronimo.kernel.config.InvalidConfigException;
 import org.apache.geronimo.kernel.repository.FileWriteMonitor;
 import org.apache.geronimo.kernel.repository.Repository;
+import org.apache.geronimo.kernel.repository.Artifact;
 import org.apache.geronimo.system.repository.FileSystemRepository;
 import org.apache.geronimo.gbean.GBeanData;
 
@@ -108,11 +109,11 @@
     }
 
     protected void execute(InstallAdapter installAdapter, Repository sourceRepo, FileSystemRepository targetRepo) throws IOException, InvalidConfigException {
-        URI configId = URI.create(artifact);
+        Artifact configId = Artifact.create(artifact);
         execute(configId, installAdapter, sourceRepo,  targetRepo);
     }
 
-    protected void execute(URI configId, InstallAdapter installAdapter, Repository sourceRepo, FileSystemRepository targetRepo) throws IOException, InvalidConfigException {
+    protected void execute(Artifact configId, InstallAdapter installAdapter, Repository sourceRepo, FileSystemRepository targetRepo) throws IOException, InvalidConfigException {
         if (installAdapter.containsConfiguration(configId)) {
             System.out.println("Configuration " + configId + " already present in configuration store");
             return;
@@ -134,10 +135,10 @@
                 targetRepo.copyToRepository(in, dependency, monitor);
             }
         }
-        URI[] parentId = (URI[]) config.getAttribute("parentId");
+        Artifact[] parentId = (Artifact[]) config.getAttribute("parentId");
         if (parentId != null) {
             for (int i = 0; i < parentId.length; i++) {
-                URI parent = parentId[i];
+                Artifact parent = parentId[i];
                 execute(parent, installAdapter, sourceRepo, targetRepo);
             }
         }
@@ -145,9 +146,9 @@
 
     protected interface InstallAdapter {
 
-        GBeanData install(Repository sourceRepo, URI configId) throws IOException, InvalidConfigException;
+        GBeanData install(Repository sourceRepo, Artifact configId) throws IOException, InvalidConfigException;
 
-        boolean containsConfiguration(URI configID);
+        boolean containsConfiguration(Artifact configID);
     }
 
     protected static class StartFileWriteMonitor implements FileWriteMonitor {
@@ -189,7 +190,7 @@
          * todo if the uri has a scheme, don't dissect it.
          *
          * @param uri
-         * @return
+         * @return uri 
          */
         private URI resolve(final URI uri) {
             String[] bits = uri.toString().split("/");

Modified: geronimo/branches/configid/plugins/geronimo-assembly-plugin/src/java/org/apache/geronimo/plugin/assembly/LocalConfigInstaller.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/configid/plugins/geronimo-assembly-plugin/src/java/org/apache/geronimo/plugin/assembly/LocalConfigInstaller.java?rev=377136&r1=377135&r2=377136&view=diff
==============================================================================
--- geronimo/branches/configid/plugins/geronimo-assembly-plugin/src/java/org/apache/geronimo/plugin/assembly/LocalConfigInstaller.java (original)
+++ geronimo/branches/configid/plugins/geronimo-assembly-plugin/src/java/org/apache/geronimo/plugin/assembly/LocalConfigInstaller.java Sat Feb 11 21:51:39 2006
@@ -17,19 +17,19 @@
 
 package org.apache.geronimo.plugin.assembly;
 
-import java.io.File;
-import java.io.IOException;
-import java.net.MalformedURLException;
-import java.net.URI;
-import java.net.URL;
-import java.util.List;
-
 import org.apache.geronimo.gbean.GBeanData;
 import org.apache.geronimo.kernel.config.InvalidConfigException;
+import org.apache.geronimo.kernel.repository.Artifact;
 import org.apache.geronimo.kernel.repository.Repository;
 import org.apache.geronimo.system.configuration.LocalConfigStore;
 import org.apache.geronimo.system.repository.FileSystemRepository;
 
+import java.io.File;
+import java.io.IOException;
+import java.net.URI;
+import java.net.URISyntaxException;
+import java.net.URL;
+
 /**
  * JellyBean that installs configuration artifacts into a LocalConfigurationStore,  It also copies all
  * configuration dependencies into the repository
@@ -43,13 +43,18 @@
         store.doStart();
         InstallAdapter installAdapter = new InstallAdapter() {
 
-            public GBeanData install(Repository sourceRepo, URI configId) throws IOException, InvalidConfigException {
-                URL artifact = sourceRepo.getURL(configId);
+            public GBeanData install(Repository sourceRepo, Artifact configId) throws IOException, InvalidConfigException {
+                URL artifact = null;
+                try {
+                    artifact = sourceRepo.getURL(configId.toURI());
+                } catch (URISyntaxException e) {
+                    throw new InvalidConfigException(e);
+                }
                 GBeanData config = store.install2(artifact);
                 return config;
             }
 
-            public boolean containsConfiguration(URI configID) {
+            public boolean containsConfiguration(Artifact configID) {
                 return store.containsConfiguration(configID);
             }
         };



Mime
View raw message