geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From djen...@apache.org
Subject svn commit: r374958 [2/2] - in /geronimo/branches/configid: ./ modules/client-builder/ modules/client-builder/src/java/org/apache/geronimo/client/builder/ modules/client-builder/src/schema/ modules/connector-builder/ modules/connector-builder/src/java/...
Date Sun, 05 Feb 2006 02:16:01 GMT
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=374958&r1=374957&r2=374958&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  4 18:14:29 2006
@@ -17,43 +17,24 @@
 
 package org.apache.geronimo.deployment.service;
 
-import java.io.File;
-import java.io.IOException;
-import java.io.InputStream;
-import java.net.MalformedURLException;
-import java.net.URI;
-import java.net.URISyntaxException;
-import java.net.URL;
-import java.net.URLClassLoader;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-import java.util.jar.JarFile;
-
-import javax.management.MalformedObjectNameException;
-import javax.management.ObjectName;
-import javax.xml.namespace.QName;
-
 import org.apache.geronimo.common.DeploymentException;
 import org.apache.geronimo.deployment.ConfigurationBuilder;
 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.DependencyType;
+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;
 import org.apache.geronimo.deployment.xbeans.ServiceDocument;
 import org.apache.geronimo.deployment.xbeans.XmlAttributeType;
-import org.apache.geronimo.deployment.xbeans.PatternType;
+import org.apache.geronimo.deployment.xbeans.ArtifactType;
 import org.apache.geronimo.deployment.xmlbeans.XmlBeansUtil;
 import org.apache.geronimo.gbean.GBeanData;
 import org.apache.geronimo.gbean.GBeanInfo;
@@ -65,12 +46,36 @@
 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.repository.Artifact;
 import org.apache.geronimo.kernel.repository.MissingDependencyException;
 import org.apache.geronimo.kernel.repository.Repository;
 import org.apache.xmlbeans.XmlCursor;
 import org.apache.xmlbeans.XmlException;
 import org.apache.xmlbeans.XmlObject;
 
+import javax.management.MalformedObjectNameException;
+import javax.management.ObjectName;
+import javax.xml.namespace.QName;
+import java.io.File;
+import java.io.IOException;
+import java.io.InputStream;
+import java.net.MalformedURLException;
+import java.net.URI;
+import java.net.URISyntaxException;
+import java.net.URL;
+import java.net.URLClassLoader;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.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$
  */
@@ -92,7 +97,7 @@
     }
 
     public ServiceConfigBuilder(URI[] defaultParentId, Repository repository, Collection
xmlAttributeBuilders, Collection xmlReferenceBuilders, Kernel kernel) {
-        this.defaultParentId = defaultParentId == null? Collections.EMPTY_LIST: Arrays.asList(defaultParentId);
+        this.defaultParentId = defaultParentId == null ? Collections.EMPTY_LIST : Arrays.asList(defaultParentId);
 
         this.repository = repository;
         this.kernel = kernel;
@@ -152,108 +157,45 @@
 
     public URI getConfigurationID(Object plan, JarFile module) throws IOException, DeploymentException
{
         ConfigurationType configType = (ConfigurationType) plan;
+        EnvironmentType environmentType = configType.getEnvironment();
+        Environment environment = EnvironmentBuilder.buildEnvironment(environmentType);
+        Artifact configId = environment.getConfigId();
         try {
-            return new URI(configType.getConfigId());
+            return configId.toURI();
         } catch (URISyntaxException e) {
-            throw new DeploymentException("Invalid configId " + configType.getConfigId(),
e);
+            throw new DeploymentException("Invalid configId " + configId, e);
         }
     }
 
     public ConfigurationData buildConfiguration(Object plan, JarFile unused, File outfile)
throws IOException, DeploymentException {
         ConfigurationType configType = (ConfigurationType) plan;
-        String domain = null;
-        String server = null;
 
-        return buildConfiguration(configType, domain, server, outfile);
+        return buildConfiguration(configType, outfile);
     }
 
-    public ConfigurationData buildConfiguration(ConfigurationType configType, String domain,
String server, File outfile) throws DeploymentException, IOException {
-        List parentID = getParentID(configType.getParentId(), configType.getImportArray());
-        if (parentID == null || parentID.size() == 0) {
-            if (configType.isSetDomain()) {
-                if (!configType.isSetServer()) {
-                    throw new DeploymentException("You must set both domain and server");
-                }
-                domain = configType.getDomain();
-                server = configType.getServer();
-            } else {
-                parentID = defaultParentId;
-            }
-        }
+    public ConfigurationData buildConfiguration(ConfigurationType configurationType, File
outfile) throws DeploymentException, IOException {
 
-        if (domain == null) {
-            //get from parent id
-            if (kernel == null) {
-                throw new DeploymentException("You must supply a kernel or the domain and
server names");
-            }
-        }
+        Environment environment = EnvironmentBuilder.buildEnvironment(configurationType.getEnvironment());
 
-        URI configID;
+
+        DeploymentContext context = new DeploymentContext(outfile, environment, ConfigurationModuleType.SERVICE,
kernel);
+        ClassLoader cl = context.getClassLoader(repository);
+
+
+        J2eeContext j2eeContext = null;
         try {
-            configID = new URI(configType.getConfigId());
+            j2eeContext = new J2eeContextImpl(context.getDomain(), context.getServer(), NameFactory.NULL,
NameFactory.J2EE_MODULE, environment.getConfigId().toURI().toString(), null, null);
         } catch (URISyntaxException e) {
-            throw new DeploymentException("Invalid configId " + configType.getConfigId(),
e);
+            throw new DeploymentException(e);
         }
-
-        DeploymentContext context = null;
-        context = new DeploymentContext(outfile, configID, ConfigurationModuleType.SERVICE,
parentID, domain, server, kernel);
-
-        J2eeContext j2eeContext = new J2eeContextImpl(context.getDomain(), context.getServer(),
NameFactory.NULL, NameFactory.J2EE_MODULE, configID.toString(), null, null);
-        DependencyType[] includes = configType.getIncludeArray();
-        addIncludes(context, includes, repository);
-        addDependencies(context, configType.getDependencyArray(), repository);
-        ClassLoader cl = context.getClassLoader(repository);
-        GbeanType[] gbeans = configType.getGbeanArray();
+        GbeanType[] gbeans = configurationType.getGbeanArray();
         addGBeans(gbeans, cl, j2eeContext, context);
-        if (configType.isSetInverseClassloading()) {
-            context.setInverseClassloading(configType.getInverseClassloading());
-        }
-        ClassFilterType[] filters = configType.getHiddenClassesArray();
-        addHiddenClasses(context, filters);
-        filters = configType.getNonOverridableClassesArray();
-        addNonOverridableClasses(context, filters);
         context.close();
         return context.getConfigurationData();
     }
-
-    public static void addHiddenClasses(DeploymentContext context, ClassFilterType[] filters)
throws DeploymentException {
-        Set tmpFilters = new HashSet();
-        for (int i = 0; i < filters.length; i++) {
-            tmpFilters.add(filters[i].getFilter());
-        }
-        context.addHiddenClasses(tmpFilters);
-    }
-
-    public static void addNonOverridableClasses(DeploymentContext context, ClassFilterType[]
filters) throws DeploymentException {
-        Set tmpFilters = new HashSet();
-        for (int i = 0; i < filters.length; i++) {
-            tmpFilters.add(filters[i].getFilter());
-        }
-        context.addNonOverridableClasses(tmpFilters);
-    }
-
-    public static List getParentID(String parentIDString, DependencyType[] imports) throws
DeploymentException {
-        List uris = new ArrayList();
-        if (parentIDString != null) {
-            try {
-                uris.add(new URI(parentIDString));
-            } catch (URISyntaxException e) {
-                throw new DeploymentException("Invalid parentId " + parentIDString, e);
-            }
-        } else if (imports.length == 0) {
-            return new ArrayList();
-        }
-        for (int i = 0; i < imports.length; i++) {
-            DependencyType anImport = imports[i];
-            URI parentURI = getDependencyURI(anImport);
-            uris.add(parentURI);
-        }
-        return uris;
-    }
-
-    public static void addIncludes(DeploymentContext context, DependencyType[] includes,
Repository repository) throws DeploymentException {
+    public static void addIncludes(DeploymentContext context, ArtifactType[] includes, Repository
repository) throws DeploymentException {
         for (int i = 0; i < includes.length; i++) {
-            DependencyType include = includes[i];
+            ArtifactType include = includes[i];
             URI uri = getDependencyURI(include, repository);
             String name = getDependencyFileName(include);
             URI path;
@@ -271,7 +213,7 @@
         }
     }
 
-    public static void addDependencies(DeploymentContext context, DependencyType[] deps,
Repository repository) throws DeploymentException {
+    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);
@@ -298,7 +240,7 @@
                 } catch (IOException e) {
                     throw new DeploymentException("Unable to parse geronimo-service.xml file
in " + url, e);
                 }
-                DependencyType[] dependencyDeps = serviceDoc.getService().getDependencyArray();
+                ArtifactType[] dependencyDeps = serviceDoc.getService().getDependencyArray();
                 if (dependencyDeps != null) {
                     addDependencies(context, dependencyDeps, repository);
                 }
@@ -396,48 +338,26 @@
         return objectName;
     }
 
-    private static URI getDependencyURI(DependencyType dep, Repository repository) throws
DeploymentException {
-        URI uri = getDependencyURI(dep);
+    private static URI getDependencyURI(ArtifactType dep, Repository repository) throws DeploymentException
{
+        URI uri = null;
+        try {
+            uri = EnvironmentBuilder.toArtifact(dep).toURI();
+        } catch (URISyntaxException e) {
+            throw new DeploymentException(e);
+        }
         if (!repository.hasURI(uri)) {
             throw new DeploymentException(new MissingDependencyException("uri " + uri + "
not found in repository"));
         }
         return uri;
     }
 
-    private static URI getDependencyURI(DependencyType dep) throws DeploymentException {
-        URI uri;
-        if (dep.isSetUri()) {
-            try {
-                uri = new URI(dep.getUri().trim());
-            } catch (URISyntaxException e) {
-                throw new DeploymentException("Invalid dependency URI " + dep.getUri().trim(),
e);
-            }
-        } else {
-            String groupId = dep.getGroupId().trim();
-            String type = dep.isSetType() ? dep.getType().trim() : "jar";
-            String artifactId = dep.getArtifactId().trim();
-            String version = dep.getVersion().trim();
-            String id = groupId + "/" + artifactId + "/" + version + "/" + type;
-            try {
-                uri = new URI(id);
-            } catch (URISyntaxException e) {
-                throw new DeploymentException("Unable to construct URI for groupId=" + groupId
+ ", artifactId=" + artifactId + ", version=" + version + ", type=" + type, e);
-            }
-        }
-        return uri;
-    }
-    
-    private static String getDependencyFileName(DependencyType dep) throws DeploymentException
{
+    private static String getDependencyFileName(ArtifactType dep) throws DeploymentException
{
         String name;
-        if (dep.isSetUri()) {
-        	name = dep.getUri().trim();
-        } else {
             String groupId = dep.getGroupId().trim();
             String type = dep.isSetType() ? dep.getType().trim() : "jar";
             String artifactId = dep.getArtifactId().trim();
             String version = dep.getVersion().trim();
             name = artifactId + "-" + version + "." + type;
-        }
         return name;
     }
 

Modified: geronimo/branches/configid/modules/service-builder/src/schema/xmlconfig.xml
URL: http://svn.apache.org/viewcvs/geronimo/branches/configid/modules/service-builder/src/schema/xmlconfig.xml?rev=374958&r1=374957&r2=374958&view=diff
==============================================================================
--- geronimo/branches/configid/modules/service-builder/src/schema/xmlconfig.xml (original)
+++ geronimo/branches/configid/modules/service-builder/src/schema/xmlconfig.xml Sat Feb  4
18:14:29 2006
@@ -1,6 +1,11 @@
 <xb:config xmlns:xb="http://www.bea.com/2002/09/xbean/config">
 
+<!--
     <xb:namespace uri="http://geronimo.apache.org/xml/ns/deployment-1.0">
+        <xb:package>org.apache.geronimo.deployment.xbeans</xb:package>
+    </xb:namespace>
+-->
+    <xb:namespace uri="http://geronimo.apache.org/xml/ns/deployment-1.1">
         <xb:package>org.apache.geronimo.deployment.xbeans</xb:package>
     </xb:namespace>
 

Modified: geronimo/branches/configid/modules/service-builder/src/test-resources/services/plan1.xml
URL: http://svn.apache.org/viewcvs/geronimo/branches/configid/modules/service-builder/src/test-resources/services/plan1.xml?rev=374958&r1=374957&r2=374958&view=diff
==============================================================================
--- geronimo/branches/configid/modules/service-builder/src/test-resources/services/plan1.xml
(original)
+++ geronimo/branches/configid/modules/service-builder/src/test-resources/services/plan1.xml
Sat Feb  4 18:14:29 2006
@@ -18,48 +18,52 @@
 
 
 <configuration
-    xmlns="http://geronimo.apache.org/xml/ns/deployment-1.0"
-    configId="test/plan1"
-    >
-    <import>
-        <groupId>geronimo</groupId>
-        <type>car</type>
-        <artifactId>foo4</artifactId>
-        <version>DEV</version>
-    </import>
+        xmlns="http://geronimo.apache.org/xml/ns/deployment-1.1"
+        >
 
-    <import>
-        <uri>geronimo/foo5/DEV/car</uri>
-    </import>
-
-    <dependency>
-        <groupId>geronimo</groupId>
-        <artifactId>foo1</artifactId>
-        <version>DEV</version>
-    </dependency>
-
-    <dependency>
-        <groupId>
-           geronimo
-        </groupId>
-        <artifactId>
-            foo2
-        </artifactId>
-        <version>
-            DEV
-        </version>
-    </dependency>
-
-    <dependency>
-        <uri>geronimo/foo3/DEV</uri>
-    </dependency>
-
-    <dependency>
-        <uri>
-           geronimo/foo4/DEV
-        </uri>
-    </dependency>
+    <environment>
+        <configid>
+            <groupId>geronimo</groupId>
+            <type>car</type>
+            <artifactId>foo4</artifactId>
+            <version>DEV</version>
+        </configid>
+        <name-key>
+            <key>domain</key>
+            <value>geronimo.server</value>
+        </name-key>
+        <name-key>
+            <key>J2EEServer</key>
+            <value>geronimo</value>
+        </name-key>
+        <classloader>
+            <import>
+                <groupId>geronimo</groupId>
+                <type>car</type>
+                <artifactId>foo4</artifactId>
+                <version>DEV</version>
+            </import>
+
+            <dependency>
+                <groupId>geronimo</groupId>
+                <artifactId>foo1</artifactId>
+                <version>DEV</version>
+            </dependency>
+
+            <dependency>
+                <groupId>
+                    geronimo
+                </groupId>
+                <artifactId>
+                    foo2
+                </artifactId>
+                <version>
+                    DEV
+                </version>
+            </dependency>
 
+        </classloader>
+    </environment>
     <gbean gbeanName="geronimo.test:name=MyMockGMBean" class="org.apache.geronimo.deployment.MockGBean">
         <attribute name="value">1234</attribute>
         <attribute name="intValue">1234</attribute>

Modified: geronimo/branches/configid/modules/service-builder/src/test/org/apache/geronimo/deployment/service/ParentIDTest.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/configid/modules/service-builder/src/test/org/apache/geronimo/deployment/service/ParentIDTest.java?rev=374958&r1=374957&r2=374958&view=diff
==============================================================================
--- geronimo/branches/configid/modules/service-builder/src/test/org/apache/geronimo/deployment/service/ParentIDTest.java
(original)
+++ geronimo/branches/configid/modules/service-builder/src/test/org/apache/geronimo/deployment/service/ParentIDTest.java
Sat Feb  4 18:14:29 2006
@@ -18,9 +18,12 @@
 
 import java.net.URI;
 import java.util.List;
+import java.util.LinkedHashSet;
 
 import junit.framework.TestCase;
-import org.apache.geronimo.deployment.xbeans.DependencyType;
+import org.apache.geronimo.deployment.xbeans.ArtifactType;
+import org.apache.geronimo.deployment.xbeans.ArtifactType;
+import org.apache.geronimo.kernel.repository.Artifact;
 
 /**
  * @version $Rev$ $Date$
@@ -28,45 +31,19 @@
 public class ParentIDTest extends TestCase {
 
     public void testNoParents() throws Exception {
-        List parentId = ServiceConfigBuilder.getParentID(null, new DependencyType[] {});
+        LinkedHashSet parentId = EnvironmentBuilder.toArtifacts(new ArtifactType[] {});
         assertEquals(0, parentId.size());
     }
 
-    public void testAttributeParent() throws Exception {
-        List parentId = ServiceConfigBuilder.getParentID("attribute", new DependencyType[]
{});
-        assertEquals(1, parentId.size());
-    }
-
     public void testImportParent1() throws Exception {
-        DependencyType anImport = DependencyType.Factory.newInstance();
-        anImport.setUri("import");
-        List parentId = ServiceConfigBuilder.getParentID(null, new DependencyType[] {anImport});
-        assertEquals(1, parentId.size());
-        assertEquals("import", ((URI)parentId.get(0)).getPath());
-    }
-
-    public void testImportParent2() throws Exception {
-        DependencyType anImport = DependencyType.Factory.newInstance();
+        ArtifactType anImport = ArtifactType.Factory.newInstance();
         anImport.setGroupId("groupId");
         anImport.setType("type");
         anImport.setArtifactId("artifactId");
         anImport.setVersion("version");
-        List parentId = ServiceConfigBuilder.getParentID(null, new DependencyType[] {anImport});
+        LinkedHashSet parentId = EnvironmentBuilder.toArtifacts(new ArtifactType[] {anImport});
         assertEquals(1, parentId.size());
-        assertEquals("groupId/artifactId/version/type", ((URI)parentId.get(0)).getPath());
-    }
-
-    public void testBothParent() throws Exception {
-        DependencyType import1 = DependencyType.Factory.newInstance();
-        import1.setUri("import1");
-        DependencyType import2 = DependencyType.Factory.newInstance();
-        import2.setUri("import2");
-        List parentId = ServiceConfigBuilder.getParentID("attribute", new DependencyType[]
{import1, import2});
-        assertEquals(3, parentId.size());
-        assertEquals("attribute", ((URI)parentId.get(0)).getPath());
-        assertEquals("import1", ((URI)parentId.get(1)).getPath());
-        assertEquals("import2", ((URI)parentId.get(2)).getPath());
+        assertEquals("groupId/artifactId/version/type", ((Artifact)parentId.iterator().next()).toURI().getPath());
     }
-
 
 }

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=374958&r1=374957&r2=374958&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  4 18:14:29 2006
@@ -31,6 +31,7 @@
 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;
@@ -64,18 +65,20 @@
             fail("could not create temp dir");
         }
         try {
-            DeploymentContext context = new DeploymentContext(outFile, URI.create("foo/bar"),
ConfigurationModuleType.SERVICE, parentId, "domain", "server", null);
-            J2eeContext j2eeContext = new J2eeContextImpl("domain", "server", "null", "test",
"configtest", "foo", NameFactory.J2EE_MODULE);
-            ServiceConfigBuilder.addDependencies(context, plan.getDependencyArray(), new
Repository() {
-
-                public boolean hasURI(URI uri) {
-                    return true;
-                }
 
-                public URL getURL(URI uri) throws MalformedURLException {
-                    return plan1;
-                }
-            });
+            Environment environment = EnvironmentBuilder.buildEnvironment(plan.getEnvironment());
+            DeploymentContext context = new DeploymentContext(outFile, environment, ConfigurationModuleType.SERVICE,
null);
+            J2eeContext j2eeContext = new J2eeContextImpl("domain", "server", "null", "test",
"configtest", "foo", NameFactory.J2EE_MODULE);
+//            ServiceConfigBuilder.addDependencies(context, plan.getDependencyArray(), new
Repository() {
+//
+//                public boolean hasURI(URI uri) {
+//                    return true;
+//                }
+//
+//                public URL getURL(URI uri) throws MalformedURLException {
+//                    return plan1;
+//                }
+//            });
             GbeanType[] gbeans = plan.getGbeanArray();
             ServiceConfigBuilder.addGBeans(gbeans, cl, j2eeContext, context);
             Set beanDatas = context.listGBeans(new ObjectName("*:*"));

Modified: geronimo/branches/configid/modules/system/src/java/org/apache/geronimo/system/configuration/ExecutableConfigurationUtil.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/configid/modules/system/src/java/org/apache/geronimo/system/configuration/ExecutableConfigurationUtil.java?rev=374958&r1=374957&r2=374958&view=diff
==============================================================================
--- geronimo/branches/configid/modules/system/src/java/org/apache/geronimo/system/configuration/ExecutableConfigurationUtil.java
(original)
+++ geronimo/branches/configid/modules/system/src/java/org/apache/geronimo/system/configuration/ExecutableConfigurationUtil.java
Sat Feb  4 18:14:29 2006
@@ -30,6 +30,7 @@
 import java.util.LinkedList;
 import java.util.List;
 import java.util.Set;
+import java.util.Map;
 import java.util.jar.JarOutputStream;
 import java.util.jar.Manifest;
 import java.util.zip.ZipEntry;
@@ -155,8 +156,10 @@
             GBeanData config = new GBeanData(Configuration.getConfigurationObjectName(id),
Configuration.GBEAN_INFO);
             config.setAttribute("id", id);
             config.setAttribute("type", configurationData.getModuleType());
-            config.setAttribute("domain", configurationData.getDomain());
-            config.setAttribute("server", configurationData.getServer());
+            //TODO configid this needs improvmement
+            Map nameKeys = configurationData.getNameKeys();
+            config.setAttribute("domain", nameKeys.get("domain"));
+            config.setAttribute("server", nameKeys.get("J2EEServer"));
 
             List parentId = configurationData.getParentId();
             if (parentId.size() > 0) {

Modified: geronimo/branches/configid/modules/tomcat-builder/maven.xml
URL: http://svn.apache.org/viewcvs/geronimo/branches/configid/modules/tomcat-builder/maven.xml?rev=374958&r1=374957&r2=374958&view=diff
==============================================================================
--- geronimo/branches/configid/modules/tomcat-builder/maven.xml (original)
+++ geronimo/branches/configid/modules/tomcat-builder/maven.xml Sat Feb  4 18:14:29 2006
@@ -28,7 +28,7 @@
 
     <preGoal name="java:compile">
         <xmlbeans:schema2java
-            maven.xmlbeans2.sourceschema="schema/geronimo-tomcat-1.0.xsd,schema/geronimo-tomcat-config-1.0.xsd"/>
+            maven.xmlbeans2.sourceschema="schema/geronimo-tomcat-1.1.xsd,schema/geronimo-tomcat-config-1.0.xsd"/>
         <mkdir dir="${basedir}/target/xmlbeans-classes"/>
         <mkdir dir="${basedir}/target/xmlbeans-classes/schemaorg_apache_xmlbeans"/>
         <copy todir="${basedir}/target/xmlbeans-classes/schemaorg_apache_xmlbeans">

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=374958&r1=374957&r2=374958&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  4 18:14:29 2006
@@ -46,7 +46,6 @@
 import javax.security.jacc.WebRoleRefPermission;
 import javax.security.jacc.WebUserDataPermission;
 import javax.transaction.UserTransaction;
-import javax.xml.namespace.QName;
 
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
@@ -57,7 +56,6 @@
 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.xmlbeans.XmlBeansUtil;
 import org.apache.geronimo.gbean.GBeanData;
 import org.apache.geronimo.gbean.GBeanInfo;
 import org.apache.geronimo.gbean.GBeanInfoBuilder;
@@ -69,7 +67,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.kernel.Kernel;
 import org.apache.geronimo.kernel.StoredObject;
 import org.apache.geronimo.kernel.repository.Repository;
 import org.apache.geronimo.naming.deployment.ENCConfigBuilder;
@@ -107,7 +104,6 @@
 import org.apache.geronimo.xbeans.j2ee.WebAppDocument;
 import org.apache.geronimo.xbeans.j2ee.WebAppType;
 import org.apache.geronimo.xbeans.j2ee.WebResourceCollectionType;
-import org.apache.xmlbeans.XmlCursor;
 import org.apache.xmlbeans.XmlException;
 import org.apache.xmlbeans.XmlObject;
 
@@ -192,7 +188,7 @@
             throw new DeploymentException("Invalid configId " + tomcatWebApp.getConfigId(),
e);
         }
 
-        List parentId = ServiceConfigBuilder.getParentID(tomcatWebApp.getParentId(), tomcatWebApp.getImportArray());
+        List parentId = ServiceConfigBuilder.toArtifacts(tomcatWebApp.getParentId(), tomcatWebApp.getImportArray());
         if (parentId.isEmpty()) {
             parentId = new ArrayList(defaultParentId);
         }

Added: geronimo/branches/configid/modules/tomcat-builder/src/schema/geronimo-tomcat-1.1.xsd
URL: http://svn.apache.org/viewcvs/geronimo/branches/configid/modules/tomcat-builder/src/schema/geronimo-tomcat-1.1.xsd?rev=374958&view=auto
==============================================================================
--- geronimo/branches/configid/modules/tomcat-builder/src/schema/geronimo-tomcat-1.1.xsd (added)
+++ geronimo/branches/configid/modules/tomcat-builder/src/schema/geronimo-tomcat-1.1.xsd Sat
Feb  4 18:14:29 2006
@@ -0,0 +1,73 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+    Copyright 2004-2005 The Apache Software Foundation
+
+    Licensed under the Apache License, Version 2.0 (the "License");
+    you may not use this file except in compliance with the License.
+    You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+    Unless required by applicable law or agreed to in writing, software
+    distributed under the License is distributed on an "AS IS" BASIS,
+    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+    See the License for the specific language governing permissions and
+    limitations under the License.
+-->
+
+<xs:schema
+    xmlns:tomcat="http://geronimo.apache.org/xml/ns/j2ee/web/tomcat-1.1"
+    targetNamespace="http://geronimo.apache.org/xml/ns/j2ee/web/tomcat-1.1"
+    xmlns:naming="http://geronimo.apache.org/xml/ns/naming-1.0"
+    xmlns:security="http://geronimo.apache.org/xml/ns/security-1.1"
+    xmlns:sys="http://geronimo.apache.org/xml/ns/deployment-1.1"
+    xmlns:xs="http://www.w3.org/2001/XMLSchema"
+    elementFormDefault="qualified"
+    attributeFormDefault="unqualified"
+    version="1.0">
+
+    <xs:import namespace="http://geronimo.apache.org/xml/ns/naming-1.0" schemaLocation="geronimo-naming-1.0.xsd"/>
+    <xs:import namespace="http://geronimo.apache.org/xml/ns/security-1.1" schemaLocation="geronimo-security-1.1.xsd"/>
+    <xs:import namespace="http://geronimo.apache.org/xml/ns/deployment-1.1" schemaLocation="geronimo-config-1.1.xsd"/>
+
+    <xs:element name="web-app" type="tomcat:web-appType"/>
+
+
+    <xs:complexType name="web-appType">
+        <xs:sequence>
+<!--            <xs:element ref="sys:parent" minOccurs="0" maxOccurs="unbounded"/>-->
+<!--            <xs:element ref="sys:dependency" minOccurs="0" maxOccurs="unbounded"/>-->
+<!--            <xs:element ref="sys:hidden-classes" minOccurs="0" maxOccurs="unbounded"/>-->
+<!--            <xs:element ref="sys:non-overridable-classes" minOccurs="0" maxOccurs="unbounded"/>-->
+            <xs:group ref="sys:classloader-infoGroup"/>
+
+            <xs:element name="context-root" type="xs:string" minOccurs="0"/>
+            <xs:element name="context-priority-classloader" type="xs:boolean" minOccurs="0"/>
+
+            <xs:element name="host" type="xs:string" minOccurs="0"/>
+            <xs:element name="cross-context" type="tomcat:emptyType" minOccurs="0"/>
+            <xs:element name="valve-chain" type="xs:string" minOccurs="0"/>
+            <xs:element name="tomcat-realm" type="xs:string" minOccurs="0"/>
+            <xs:element name="manager" type="xs:string" minOccurs="0"/>
+            <xs:element name="cluster" type="xs:string" minOccurs="0"/>
+
+            <xs:group ref="naming:jndiEnvironmentRefsGroup"/>
+            <xs:element ref="naming:message-destination" minOccurs="0" maxOccurs="unbounded"/>
+
+            <xs:sequence minOccurs="0">
+                 <xs:element name="security-realm-name" type="xs:string"/>
+                 <xs:element ref="security:security" minOccurs="0"/>
+             </xs:sequence>
+
+            <xs:element ref="sys:gbean" minOccurs="0" maxOccurs="unbounded"/>
+
+        </xs:sequence>
+        <xs:attribute name="configId" type="xs:string" use="required"/>
+        <xs:attribute name="parentId" type="xs:string" use="optional"/>
+        <xs:attribute name="inverseClassloading" type="xs:boolean" use="optional"/>
+    </xs:complexType>
+
+    <xs:complexType name="emptyType"/>
+
+</xs:schema>

Modified: geronimo/branches/configid/modules/tomcat-builder/src/schema/xmlconfig.xml
URL: http://svn.apache.org/viewcvs/geronimo/branches/configid/modules/tomcat-builder/src/schema/xmlconfig.xml?rev=374958&r1=374957&r2=374958&view=diff
==============================================================================
--- geronimo/branches/configid/modules/tomcat-builder/src/schema/xmlconfig.xml (original)
+++ geronimo/branches/configid/modules/tomcat-builder/src/schema/xmlconfig.xml Sat Feb  4
18:14:29 2006
@@ -17,7 +17,7 @@
 -->
 <!-- @version $Rev$ $Date$ -->
 <xb:config xmlns:xb="http://www.bea.com/2002/09/xbean/config">
-    <xb:namespace uri="http://geronimo.apache.org/xml/ns/j2ee/web/tomcat-1.0">
+    <xb:namespace uri="http://geronimo.apache.org/xml/ns/j2ee/web/tomcat-1.1">
         <xb:package>org.apache.geronimo.xbeans.geronimo.web.tomcat</xb:package>
         <xb:prefix>Tomcat</xb:prefix>
     </xb:namespace>

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=374958&r1=374957&r2=374958&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  4 18:14:29 2006
@@ -77,6 +77,7 @@
 import org.apache.geronimo.security.jacc.ApplicationPolicyConfigurationManager;
 import org.apache.geronimo.security.jacc.ComponentPermissions;
 import org.apache.geronimo.system.serverinfo.BasicServerInfo;
+import org.apache.geronimo.system.configuration.ExecutableConfigurationUtil;
 import org.apache.geronimo.tomcat.ConnectorGBean;
 import org.apache.geronimo.tomcat.EngineGBean;
 import org.apache.geronimo.tomcat.HostGBean;
@@ -185,7 +186,7 @@
         builder.addGBeans(earContext, module, cl);
         earContext.close();
         module.close();
-        GBeanData configData = earContext.getConfigurationGBeanData();
+        GBeanData configData = ExecutableConfigurationUtil.getConfigurationGBeanData(earContext.getConfigurationData());
         configData.setAttribute("baseURL", outputPath.toURL());
         kernel.loadGBean(configData, cl);
         ObjectName configName = configData.getName();

Modified: geronimo/branches/configid/modules/web-builder/maven.xml
URL: http://svn.apache.org/viewcvs/geronimo/branches/configid/modules/web-builder/maven.xml?rev=374958&r1=374957&r2=374958&view=diff
==============================================================================
--- geronimo/branches/configid/modules/web-builder/maven.xml (original)
+++ geronimo/branches/configid/modules/web-builder/maven.xml Sat Feb  4 18:14:29 2006
@@ -27,7 +27,7 @@
     >
     <preGoal name="java:compile">
         <xmlbeans:schema2java
-            maven.xmlbeans2.sourceschema="schema/geronimo-web-1.0.xsd"/>
+            maven.xmlbeans2.sourceschema="schema/geronimo-web-1.1.xsd"/>
         <mkdir dir="${basedir}/target/xmlbeans-classes"/>
         <mkdir dir="${basedir}/target/xmlbeans-classes/schemaorg_apache_xmlbeans"/>
         <copy todir="${basedir}/target/xmlbeans-classes/schemaorg_apache_xmlbeans">

Added: geronimo/branches/configid/modules/web-builder/src/schema/geronimo-web-1.1.xsd
URL: http://svn.apache.org/viewcvs/geronimo/branches/configid/modules/web-builder/src/schema/geronimo-web-1.1.xsd?rev=374958&view=auto
==============================================================================
--- geronimo/branches/configid/modules/web-builder/src/schema/geronimo-web-1.1.xsd (added)
+++ geronimo/branches/configid/modules/web-builder/src/schema/geronimo-web-1.1.xsd Sat Feb
 4 18:14:29 2006
@@ -0,0 +1,70 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+    Copyright 2004-2005 The Apache Software Foundation
+
+    Licensed under the Apache License, Version 2.0 (the "License");
+    you may not use this file except in compliance with the License.
+    You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+    Unless required by applicable law or agreed to in writing, software
+    distributed under the License is distributed on an "AS IS" BASIS,
+    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+    See the License for the specific language governing permissions and
+    limitations under the License.
+-->
+
+<xs:schema
+    xmlns:web="http://geronimo.apache.org/xml/ns/j2ee/web-1.1"
+    targetNamespace="http://geronimo.apache.org/xml/ns/j2ee/web-1.1"
+    xmlns:naming="http://geronimo.apache.org/xml/ns/naming-1.0"
+    xmlns:security="http://geronimo.apache.org/xml/ns/security-1.1"
+    xmlns:sys="http://geronimo.apache.org/xml/ns/deployment-1.1"
+    xmlns:xs="http://www.w3.org/2001/XMLSchema"
+    elementFormDefault="qualified"
+    attributeFormDefault="unqualified"
+    version="1.0">
+
+    <xs:import namespace="http://geronimo.apache.org/xml/ns/naming-1.0" schemaLocation="geronimo-naming-1.0.xsd"/>
+    <xs:import namespace="http://geronimo.apache.org/xml/ns/security-1.1" schemaLocation="geronimo-security-1.1.xsd"/>
+    <xs:import namespace="http://geronimo.apache.org/xml/ns/deployment-1.1" schemaLocation="geronimo-config-1.1.xsd"/>
+
+    <xs:element name="web-app" type="web:web-appType"/>
+
+
+    <xs:complexType name="web-appType">
+        <xs:sequence>
+<!--            <xs:element ref="sys:parent" minOccurs="0" maxOccurs="unbounded"/>-->
+<!--            <xs:element ref="sys:dependency" minOccurs="0" maxOccurs="unbounded"/>-->
+<!--            <xs:element ref="sys:hidden-classes" minOccurs="0" maxOccurs="unbounded"/>-->
+<!--            <xs:element ref="sys:non-overridable-classes" minOccurs="0" maxOccurs="unbounded"/>-->
+            <xs:group ref="sys:classloader-infoGroup"/>
+
+            <xs:element name="context-root" type="xs:string" minOccurs="0"/>
+            <xs:element name="context-priority-classloader" type="xs:boolean" minOccurs="0"/>
+            <xs:element name="container-config" type="web:container-configType" minOccurs="0"/>
+
+            <xs:group ref="naming:jndiEnvironmentRefsGroup"/>
+            <xs:element ref="naming:message-destination" minOccurs="0" maxOccurs="unbounded"/>
+
+            <xs:sequence minOccurs="0">
+                <xs:element name="security-realm-name" type="xs:string"/>
+                <xs:element ref="security:security" minOccurs="0"/>
+            </xs:sequence>
+
+            <xs:element ref="sys:gbean" minOccurs="0" maxOccurs="unbounded"/>
+
+        </xs:sequence>
+        <xs:attribute name="configId" type="xs:string" use="required"/>
+        <xs:attribute name="parentId" type="xs:string" use="optional"/>
+    </xs:complexType>
+
+    <xs:complexType name="container-configType">
+        <xs:sequence>
+            <xs:any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded"/>
+        </xs:sequence>
+    </xs:complexType>
+
+</xs:schema>

Modified: geronimo/branches/configid/modules/web-builder/src/schema/xmlconfig.xml
URL: http://svn.apache.org/viewcvs/geronimo/branches/configid/modules/web-builder/src/schema/xmlconfig.xml?rev=374958&r1=374957&r2=374958&view=diff
==============================================================================
--- geronimo/branches/configid/modules/web-builder/src/schema/xmlconfig.xml (original)
+++ geronimo/branches/configid/modules/web-builder/src/schema/xmlconfig.xml Sat Feb  4 18:14:29
2006
@@ -17,7 +17,7 @@
 -->
 <!-- @version $Rev$ $Date$ -->
 <xb:config xmlns:xb="http://www.bea.com/2002/09/xbean/config">
-    <xb:namespace uri="http://geronimo.apache.org/xml/ns/j2ee/web-1.0">
+    <xb:namespace uri="http://geronimo.apache.org/xml/ns/j2ee/web-1.1">
         <xb:package>org.apache.geronimo.xbeans.geronimo.web</xb:package>
         <xb:prefix>Ger</xb:prefix>
     </xb:namespace>

Modified: geronimo/branches/configid/plugins/geronimo-dependency-plugin/src/java/org/apache/geronimo/plugin/dependency/GenerateServiceXml.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/configid/plugins/geronimo-dependency-plugin/src/java/org/apache/geronimo/plugin/dependency/GenerateServiceXml.java?rev=374958&r1=374957&r2=374958&view=diff
==============================================================================
--- geronimo/branches/configid/plugins/geronimo-dependency-plugin/src/java/org/apache/geronimo/plugin/dependency/GenerateServiceXml.java
(original)
+++ geronimo/branches/configid/plugins/geronimo-dependency-plugin/src/java/org/apache/geronimo/plugin/dependency/GenerateServiceXml.java
Sat Feb  4 18:14:29 2006
@@ -71,7 +71,7 @@
                 String artifactId = dependency.getArtifactId();
                 String version = dependency.getVersion();
                 String type = dependency.getType();
-                org.apache.geronimo.deployment.xbeans.DependencyType dependencyType = serviceType.addNewDependency();
+                org.apache.geronimo.deployment.xbeans.ArtifactType dependencyType = serviceType.addNewDependency();
                 dependencyType.setGroupId(groupId);
                 dependencyType.setArtifactId(artifactId);
                 dependencyType.setVersion(version);

Modified: geronimo/branches/configid/project.properties
URL: http://svn.apache.org/viewcvs/geronimo/branches/configid/project.properties?rev=374958&r1=374957&r2=374958&view=diff
==============================================================================
--- geronimo/branches/configid/project.properties (original)
+++ geronimo/branches/configid/project.properties Sat Feb  4 18:14:29 2006
@@ -34,12 +34,12 @@
 modules/*/project.xml,\
 #configs/*/project.xml,\
 #assemblies/*/project.xml,\
-openejb/modules/*/project.xml,\
+openejb/openejb2/modules/*/project.xml,\
 tranql/*/project.xml
 
 maven.multiproject.excludes=\
-openejb/modules/connector/project.xml,\
-openejb/modules/webadmin/project.xml,\
+openejb/openejb2/modules/connector/project.xml,\
+openejb/openejb2/modules/webadmin/project.xml,\
 activemq/modules/*/project.xml,\
 sandbox/*/project.xml
 



Mime
View raw message