geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gdam...@apache.org
Subject cvs commit: incubator-geronimo/modules/j2ee maven.xml
Date Sat, 07 Aug 2004 11:22:13 GMT
gdamour     2004/08/07 04:22:13

  Modified:    modules/j2ee/src/test/org/apache/geronimo/j2ee/deployment
                        MockConnectorConfigBuilder.java
                        EARConfigBuilderTest.java MockEJBConfigBuilder.java
                        MockWARConfigBuilder.java
               modules/j2ee/src/java/org/apache/geronimo/j2ee/deployment
                        EARConfigBuilder.java ModuleBuilder.java
               modules/connector/src/java/org/apache/geronimo/connector/deployment
                        ConnectorModuleBuilder.java
               modules/jetty/src/java/org/apache/geronimo/jetty/deployment
                        JettyModuleBuilder.java
               modules/j2ee maven.xml
  Added:       modules/j2ee/src/test-unpacked-ear/META-INF
                        geronimo-application.xml application.xml
  Removed:     modules/j2ee/src/java/org/apache/geronimo/j2ee/deployment
                        ModuleBuilderWithUnpack.java
  Log:
  o Supports deployment of unpacked EARs. An unpacked EAR can contain either (standard) packed
or unpacked
  WAR, EJB JAR and RAR.
  
  o Gets rid of the ModuleBuilderWithUnpack interface as OpenEJB supports by now deployment
of unpacked EJB JAR.
  
  Revision  Changes    Path
  1.4       +2 -2      incubator-geronimo/modules/j2ee/src/test/org/apache/geronimo/j2ee/deployment/MockConnectorConfigBuilder.java
  
  Index: MockConnectorConfigBuilder.java
  ===================================================================
  RCS file: /home/cvs/incubator-geronimo/modules/j2ee/src/test/org/apache/geronimo/j2ee/deployment/MockConnectorConfigBuilder.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- MockConnectorConfigBuilder.java	23 Jul 2004 06:06:19 -0000	1.3
  +++ MockConnectorConfigBuilder.java	7 Aug 2004 11:22:12 -0000	1.4
  @@ -30,7 +30,7 @@
   /**
    * @version $Revision$ $Date$
    */
  -public class MockConnectorConfigBuilder extends Assert implements ModuleBuilderWithUnpack
{
  +public class MockConnectorConfigBuilder extends Assert implements ModuleBuilder {
       public EARContext earContext;
       public Module connectorModule;
       public ClassLoader cl;
  
  
  
  1.8       +81 -45    incubator-geronimo/modules/j2ee/src/test/org/apache/geronimo/j2ee/deployment/EARConfigBuilderTest.java
  
  Index: EARConfigBuilderTest.java
  ===================================================================
  RCS file: /home/cvs/incubator-geronimo/modules/j2ee/src/test/org/apache/geronimo/j2ee/deployment/EARConfigBuilderTest.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- EARConfigBuilderTest.java	6 Aug 2004 22:44:37 -0000	1.7
  +++ EARConfigBuilderTest.java	7 Aug 2004 11:22:12 -0000	1.8
  @@ -35,7 +35,11 @@
   public class EARConfigBuilderTest extends TestCase {
   
       private static String EAR_BASE_DIR;
  -
  +    private static String EAR_PATH;
  +    private static MockEJBConfigBuilder ejbConfigBuilder = new MockEJBConfigBuilder();
  +    private static MockWARConfigBuilder webConfigBuilder = new MockWARConfigBuilder();
  +    private static MockConnectorConfigBuilder connectorConfigBuilder = new MockConnectorConfigBuilder();
  +    
       private static final String j2eeServerName = "someDomain";
       private static final ObjectName j2eeServer = JMXUtil.getObjectName(j2eeServerName +
":j2eeType=J2EEServer,name=J2EEServerName");
       private static final ObjectName transactionManagerObjectName = JMXUtil.getObjectName(j2eeServerName
+ ":type=TransactionManager");
  @@ -47,7 +51,25 @@
           TestSuite inner = new TestSuite(EARConfigBuilderTest.class);
           TestSetup setup14 = new TestSetup(inner) {
               protected void setUp() {
  -                EARConfigBuilderTest.EAR_BASE_DIR = "target/test-ear14";
  +                EAR_BASE_DIR = "target/test-ear14";
  +                EAR_PATH = "test-ear.ear";
  +                ejbConfigBuilder.ejbModule = new EJBModule("test-ejb-jar.jar", URI.create("test-ejb-jar.jar"));
  +                webConfigBuilder.contextRoot = "test";
  +                webConfigBuilder.webModule = new WebModule("test-war.war", URI.create("test-war.war"),
"test");
  +                connectorConfigBuilder.connectorModule = new ConnectorModule("test-rar.rar",
URI.create("test-rar.rar"));
  +            }
  +
  +            protected void tearDown() {
  +            }
  +        };
  +        TestSetup setupNaked14 = new TestSetup(inner) {
  +            protected void setUp() {
  +                EAR_BASE_DIR = "target/test-ear14";
  +                EAR_PATH = "test-naked-ear.ear";
  +                ejbConfigBuilder.ejbModule = new EJBModule("test-ejb-jar.jar", URI.create("test-ejb-jar.jar"));
  +                webConfigBuilder.contextRoot = "test";
  +                webConfigBuilder.webModule = new WebModule("test-war.war", URI.create("test-war.war"),
"test");
  +                connectorConfigBuilder.connectorModule = new ConnectorModule("test-rar.rar",
URI.create("test-rar.rar"));
               }
   
               protected void tearDown() {
  @@ -55,53 +77,73 @@
           };
           TestSetup setup13 = new TestSetup(inner) {
               protected void setUp() {
  -                EARConfigBuilderTest.EAR_BASE_DIR = "target/test-ear13";
  +                EAR_BASE_DIR = "target/test-ear13";
  +                EAR_PATH = "test-ear.ear";
  +                ejbConfigBuilder.ejbModule = new EJBModule("test-ejb-jar.jar", URI.create("test-ejb-jar.jar"));
  +                webConfigBuilder.contextRoot = "test";
  +                webConfigBuilder.webModule = new WebModule("test-war.war", URI.create("test-war.war"),
"test");
  +                connectorConfigBuilder.connectorModule = new ConnectorModule("test-rar.rar",
URI.create("test-rar.rar"));
  +            }
  +
  +            protected void tearDown() {
  +            }
  +        };
  +        TestSetup setupNaked13 = new TestSetup(inner) {
  +            protected void setUp() {
  +                EAR_BASE_DIR = "target/test-ear13";
  +                EAR_PATH = "test-naked-ear.ear";
  +                ejbConfigBuilder.ejbModule = new EJBModule("test-ejb-jar.jar", URI.create("test-ejb-jar.jar"));
  +                webConfigBuilder.contextRoot = "test";
  +                webConfigBuilder.webModule = new WebModule("test-war.war", URI.create("test-war.war"),
"test");
  +                connectorConfigBuilder.connectorModule = new ConnectorModule("test-rar.rar",
URI.create("test-rar.rar"));
  +            }
  +
  +            protected void tearDown() {
  +            }
  +        };
  +        TestSetup setupUnpacked = new TestSetup(inner) {
  +            protected void setUp() {
  +                EAR_BASE_DIR = "target/test-unpacked-ear";
  +                EAR_PATH = "full/";
  +                ejbConfigBuilder.ejbModule = new EJBModule("test-ejb-jar/", URI.create("test-ejb-jar/"));
  +                webConfigBuilder.contextRoot = "test";
  +                webConfigBuilder.webModule = new WebModule("test-war/", URI.create("test-war/"),
"test");
  +                connectorConfigBuilder.connectorModule = new ConnectorModule("test-rar.rar",
URI.create("test-rar.rar"));
               }
   
               protected void tearDown() {
               }
           };
  +        TestSetup setupUnpackedNaked = new TestSetup(inner) {
  +            protected void setUp() {
  +                EAR_BASE_DIR = "target/test-unpacked-ear";
  +                EAR_PATH = "naked/";
  +                ejbConfigBuilder.ejbModule = new EJBModule("test-ejb-jar/", URI.create("test-ejb-jar/"));
  +                webConfigBuilder.contextRoot = "test";
  +                webConfigBuilder.webModule = new WebModule("test-war/", URI.create("test-war/"),
"test");
  +                connectorConfigBuilder.connectorModule = new ConnectorModule("test-rar.rar",
URI.create("test-rar.rar"));
  +            }
  +
  +            protected void tearDown() {
  +            }
  +        };
  +        
           TestSuite suite = new TestSuite();
           suite.addTest(setup14);
  +        suite.addTest(setupNaked14);
           suite.addTest(setup13);
  +        suite.addTest(setupNaked13);
  +        suite.addTest(setupUnpacked);
  +        suite.addTest(setupUnpackedNaked);
           return suite;
       }
   
       public void testBuildConfiguration() throws Exception {
  -        MockEJBConfigBuilder ejbConfigBuilder = new MockEJBConfigBuilder();
  -        MockWARConfigBuilder webConfigBuilder = new MockWARConfigBuilder();
  -        MockConnectorConfigBuilder connectorConfigBuilder = new MockConnectorConfigBuilder();
           EARConfigBuilder configBuilder = new EARConfigBuilder(j2eeServer, transactionManagerObjectName,
connectionTrackerObjectName, transactionalTimerObjectName, nonTransactionalTimerObjectName,
null, ejbConfigBuilder, null, webConfigBuilder, connectorConfigBuilder, null);
  -        File earFile = new File(EAR_BASE_DIR + "/test-ear.ear");
  +        File earFile = new File(EAR_BASE_DIR + "/" + EAR_PATH);
   
           File carFile = File.createTempFile("EARTest", ".car");
           try {
  -            ejbConfigBuilder.ejbModule = new EJBModule("test-ejb-jar.jar", URI.create("test-ejb-jar.jar"));
  -            webConfigBuilder.contextRoot = "test";
  -            webConfigBuilder.webModule = new WebModule("test-war.war", URI.create("test-war.war"),
"test");
  -            connectorConfigBuilder.connectorModule = new ConnectorModule("test-rar.rar",
URI.create("test-rar.rar"));
  -
  -            XmlObject plan = configBuilder.getDeploymentPlan(earFile.toURL());
  -            configBuilder.buildConfiguration(carFile, null, earFile, plan);
  -        } finally {
  -            carFile.delete();
  -        }
  -    }
  -
  -    public void testNakedEarBuildConfiguration() throws Exception {
  -        MockEJBConfigBuilder ejbConfigBuilder = new MockEJBConfigBuilder();
  -        MockWARConfigBuilder webConfigBuilder = new MockWARConfigBuilder();
  -        MockConnectorConfigBuilder connectorConfigBuilder = new MockConnectorConfigBuilder();
  -        EARConfigBuilder configBuilder = new EARConfigBuilder(j2eeServer, transactionManagerObjectName,
connectionTrackerObjectName, transactionalTimerObjectName, nonTransactionalTimerObjectName,
null, ejbConfigBuilder, null, webConfigBuilder, connectorConfigBuilder, null);
  -        File earFile = new File(EAR_BASE_DIR + "/test-naked-ear.ear");
  -
  -        File carFile = File.createTempFile("EARTest", ".car");
  -        try {
  -            ejbConfigBuilder.ejbModule = new EJBModule("test-ejb-jar.jar", URI.create("test-ejb-jar.jar"));
  -            webConfigBuilder.contextRoot = "test";
  -            webConfigBuilder.webModule = new WebModule("test-war.war", URI.create("test-war.war"),
"test");
  -            connectorConfigBuilder.connectorModule = new ConnectorModule("test-rar.rar",
URI.create("test-rar.rar"));
  -
               XmlObject plan = configBuilder.getDeploymentPlan(earFile.toURL());
               configBuilder.buildConfiguration(carFile, null, earFile, plan);
           } finally {
  @@ -110,10 +152,8 @@
       }
   
       public void testNoEJBDeployer() throws Exception {
  -        MockWARConfigBuilder warConfigBuilder = new MockWARConfigBuilder();
  -        MockConnectorConfigBuilder connectorConfigBuilder = new MockConnectorConfigBuilder();
  -        EARConfigBuilder configBuilder = new EARConfigBuilder(j2eeServer, transactionManagerObjectName,
connectionTrackerObjectName, transactionalTimerObjectName, nonTransactionalTimerObjectName,
null, null, null, warConfigBuilder, connectorConfigBuilder, null);
  -        File earFile = new File(EAR_BASE_DIR + "/test-ear.ear");
  +        EARConfigBuilder configBuilder = new EARConfigBuilder(j2eeServer, transactionManagerObjectName,
connectionTrackerObjectName, transactionalTimerObjectName, nonTransactionalTimerObjectName,
null, null, null, webConfigBuilder, connectorConfigBuilder, null);
  +        File earFile = new File(EAR_BASE_DIR + "/" + EAR_PATH);
   
           File carFile = File.createTempFile("EARTest", ".car");
           try {
  @@ -128,10 +168,8 @@
       }
   
       public void testNoWARDeployer() throws Exception {
  -        MockEJBConfigBuilder ejbConfigBuilder = new MockEJBConfigBuilder();
  -        MockConnectorConfigBuilder connectorConfigBuilder = new MockConnectorConfigBuilder();
           EARConfigBuilder configBuilder = new EARConfigBuilder(j2eeServer, transactionManagerObjectName,
connectionTrackerObjectName, transactionalTimerObjectName, nonTransactionalTimerObjectName,
null, ejbConfigBuilder, null, null, connectorConfigBuilder, null);
  -        File earFile = new File(EAR_BASE_DIR + "/test-ear.ear");
  +        File earFile = new File(EAR_BASE_DIR + "/" + EAR_PATH);
   
           File carFile = File.createTempFile("EARTest", ".car");
           try {
  @@ -146,10 +184,8 @@
       }
   
       public void testNoConnectorDeployer() throws Exception {
  -        MockWARConfigBuilder warConfigBuilder = new MockWARConfigBuilder();
  -        MockEJBConfigBuilder ejbConfigBuilder = new MockEJBConfigBuilder();
  -        EARConfigBuilder configBuilder = new EARConfigBuilder(j2eeServer, transactionManagerObjectName,
connectionTrackerObjectName, transactionalTimerObjectName, nonTransactionalTimerObjectName,
null, ejbConfigBuilder, null, warConfigBuilder, null, null);
  -        File earFile = new File(EAR_BASE_DIR + "/test-ear.ear");
  +        EARConfigBuilder configBuilder = new EARConfigBuilder(j2eeServer, transactionManagerObjectName,
connectionTrackerObjectName, transactionalTimerObjectName, nonTransactionalTimerObjectName,
null, ejbConfigBuilder, null, webConfigBuilder, null, null);
  +        File earFile = new File(EAR_BASE_DIR + "/" + EAR_PATH);
   
           File carFile = File.createTempFile("EARTest", ".car");
           try {
  
  
  
  1.3       +10 -1     incubator-geronimo/modules/j2ee/src/test/org/apache/geronimo/j2ee/deployment/MockEJBConfigBuilder.java
  
  Index: MockEJBConfigBuilder.java
  ===================================================================
  RCS file: /home/cvs/incubator-geronimo/modules/j2ee/src/test/org/apache/geronimo/j2ee/deployment/MockEJBConfigBuilder.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- MockEJBConfigBuilder.java	18 Jul 2004 22:04:27 -0000	1.2
  +++ MockEJBConfigBuilder.java	7 Aug 2004 11:22:12 -0000	1.3
  @@ -16,11 +16,13 @@
    */
   package org.apache.geronimo.j2ee.deployment;
   
  +import java.io.File;
   import java.net.URI;
   import java.net.URL;
   import java.util.jar.JarFile;
   
   import junit.framework.Assert;
  +
   import org.apache.xmlbeans.XmlObject;
   import org.apache.xmlbeans.SchemaTypeLoader;
   
  @@ -50,6 +52,13 @@
   
       public Module createModule(String name, XmlObject plan) {
           return null;
  +    }
  +
  +    public void installModule(File earFolder, EARContext earContext, Module module) {
  +        assertNotNull(earFolder);
  +        assertNotNull(earContext);
  +        this.earContext = earContext;
  +        assertEquals(this.ejbModule, ejbModule);
       }
   
       public void installModule(JarFile earFile, EARContext earContext, Module ejbModule)
{
  
  
  
  1.4       +2 -2      incubator-geronimo/modules/j2ee/src/test/org/apache/geronimo/j2ee/deployment/MockWARConfigBuilder.java
  
  Index: MockWARConfigBuilder.java
  ===================================================================
  RCS file: /home/cvs/incubator-geronimo/modules/j2ee/src/test/org/apache/geronimo/j2ee/deployment/MockWARConfigBuilder.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- MockWARConfigBuilder.java	23 Jul 2004 06:06:19 -0000	1.3
  +++ MockWARConfigBuilder.java	7 Aug 2004 11:22:12 -0000	1.4
  @@ -29,7 +29,7 @@
   /**
    * @version $Revision$ $Date$
    */
  -public class MockWARConfigBuilder extends Assert implements ModuleBuilderWithUnpack {
  +public class MockWARConfigBuilder extends Assert implements ModuleBuilder {
       public EARContext earContext;
       public WebModule webModule;
       public ClassLoader cl;
  
  
  
  1.1                  incubator-geronimo/modules/j2ee/src/test-unpacked-ear/META-INF/geronimo-application.xml
  
  Index: geronimo-application.xml
  ===================================================================
  <?xml version="1.0" encoding="UTF-8"?>
  <!--
  
      Copyright 2004 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.
  -->
  
  <application xmlns="http://geronimo.apache.org/xml/ns/j2ee/application"
      configId="org/apache/geronimo/j2ee/deployment/test"
      parentId="org/apache/geronimo/Server">
  
      <!-- a random gbean just to verify that the deployer doesn't die because of it -->
      <gbean name="foo:j2eeType=J2EEDomain,name=foo" class="org.apache.geronimo.j2ee.management.impl.J2EEDomainImpl"/>
  
  </application>
  
  
  1.1                  incubator-geronimo/modules/j2ee/src/test-unpacked-ear/META-INF/application.xml
  
  Index: application.xml
  ===================================================================
  <?xml version="1.0" encoding="UTF-8"?>
  <!--
  
      Copyright 2004 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.
  -->
  <application xmlns="http://java.sun.com/xml/ns/j2ee"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/application_1_4.xsd"
      version="1.4">
      <description>description</description>
      <display-name>display-name</display-name>
      <icon>
        <small-icon>url/to/small/icon</small-icon>
        <large-icon>url/to/large/icon</large-icon>
      </icon>
      <module>
          <web>
              <!-- supports an exploded WAR within an exploded EAR -->
              <web-uri>test-war/</web-uri>
              <context-root>test</context-root>
          </web>
      </module>
      <module>
          <ejb>test-ejb-jar/</ejb>
      </module>
      <module>
          <!-- supports a standard RAR within an exploded RAR -->
          <connector>test-rar.rar</connector>
      </module>
  </application>
  
  
  
  1.19      +21 -14    incubator-geronimo/modules/j2ee/src/java/org/apache/geronimo/j2ee/deployment/EARConfigBuilder.java
  
  Index: EARConfigBuilder.java
  ===================================================================
  RCS file: /home/cvs/incubator-geronimo/modules/j2ee/src/java/org/apache/geronimo/j2ee/deployment/EARConfigBuilder.java,v
  retrieving revision 1.18
  retrieving revision 1.19
  diff -u -r1.18 -r1.19
  --- EARConfigBuilder.java	6 Aug 2004 22:44:36 -0000	1.18
  +++ EARConfigBuilder.java	7 Aug 2004 11:22:12 -0000	1.19
  @@ -70,8 +70,8 @@
       private final Kernel kernel;
       private final Repository repository;
       private final ModuleBuilder ejbConfigBuilder;
  -    private final ModuleBuilderWithUnpack webConfigBuilder;
  -    private final ModuleBuilderWithUnpack connectorConfigBuilder;
  +    private final ModuleBuilder webConfigBuilder;
  +    private final ModuleBuilder connectorConfigBuilder;
       private final EJBReferenceBuilder ejbReferenceBuilder;
       private final String j2eeServerName;
       private final String j2eeDomainName;
  @@ -82,7 +82,7 @@
       private final ObjectName nonTransactionalTimerObjectName;
   
   
  -    public EARConfigBuilder(ObjectName j2eeServer, ObjectName transactionContextManagerObjectName,
ObjectName connectionTrackerObjectName, ObjectName transactionalTimerObjectName, ObjectName
nonTransactionalTimerObjectName, Repository repository, ModuleBuilder ejbConfigBuilder, EJBReferenceBuilder
ejbReferenceBuilder, ModuleBuilderWithUnpack webConfigBuilder, ModuleBuilderWithUnpack connectorConfigBuilder,
Kernel kernel) {
  +    public EARConfigBuilder(ObjectName j2eeServer, ObjectName transactionContextManagerObjectName,
ObjectName connectionTrackerObjectName, ObjectName transactionalTimerObjectName, ObjectName
nonTransactionalTimerObjectName, Repository repository, ModuleBuilder ejbConfigBuilder, EJBReferenceBuilder
ejbReferenceBuilder, ModuleBuilder webConfigBuilder, ModuleBuilder connectorConfigBuilder,
Kernel kernel) {
           this.kernel = kernel;
           this.repository = repository;
           this.j2eeServer = j2eeServer;
  @@ -213,6 +213,9 @@
               if (id.endsWith(".ear")) {
                   id = id.substring(0, id.length() - 4);
               }
  +            if ( id.endsWith("/") ) {
  +                id = id.substring(0, id.length() - 1);
  +            }
               id = id.substring(id.lastIndexOf('/') + 1);
           }
   
  @@ -251,7 +254,16 @@
                   for (Iterator iter = files.iterator(); iter.hasNext();) {
                       File file = (File) iter.next();
                       URI path = baseURI.relativize(file.toURI());
  -                    if (moduleLocations.contains(path.toString())) {
  +                    boolean isNestedModuleFile = false;
  +                    // skips the files contained by a nested module.
  +                    for (Iterator iter2 = moduleLocations.iterator(); iter2.hasNext();)
{
  +                        String moduleLocation = (String) iter2.next();
  +                        if ( path.toString().startsWith(moduleLocation) ) {
  +                            isNestedModuleFile = true;
  +                            break;
  +                        }
  +                    }
  +                    if ( isNestedModuleFile ) {
                           continue;
                       }
                       earContext.addFile(path, file);
  @@ -259,13 +271,7 @@
               }
   
               public void installModule(ModuleBuilder moduleBuilder, EARContext earContext,
Module module) throws IOException, DeploymentException {
  -                if (false == module instanceof ConnectorModule &&
  -                        false == module instanceof WebModule) {
  -                    throw new DeploymentException("Only unpacked RARs and WARs (in unpacked
EAR) are supported.");
  -                }
  -                // TODO gets rid of this cast when all the ModuleBuilder will
  -                // support unpacked deployments.
  -                ((ModuleBuilderWithUnpack) moduleBuilder).installModule(earFolder, earContext,
module);
  +                moduleBuilder.installModule(earFolder, earContext, module);
               }
   
               public void release() {
  @@ -452,6 +458,7 @@
                       if (webConfigBuilder == null) {
                           throw new DeploymentException("Can not deploy web application;
No war deployer defined: " + webModule.getURI());
                       }
  +
                       moduleLocations.add(uri.toString());
                       webModules.add(webModule);
                   } else if (module.isSetConnector()) {
  @@ -648,8 +655,8 @@
           infoFactory.addReference("Repository", Repository.class);
           infoFactory.addReference("EJBConfigBuilder", ModuleBuilder.class);
           infoFactory.addReference("EJBReferenceBuilder", EJBReferenceBuilder.class);
  -        infoFactory.addReference("WebConfigBuilder", ModuleBuilderWithUnpack.class);
  -        infoFactory.addReference("ConnectorConfigBuilder", ModuleBuilderWithUnpack.class);
  +        infoFactory.addReference("WebConfigBuilder", ModuleBuilder.class);
  +        infoFactory.addReference("ConnectorConfigBuilder", ModuleBuilder.class);
   
           infoFactory.addAttribute("kernel", Kernel.class, false);
   
  
  
  
  1.3       +4 -1      incubator-geronimo/modules/j2ee/src/java/org/apache/geronimo/j2ee/deployment/ModuleBuilder.java
  
  Index: ModuleBuilder.java
  ===================================================================
  RCS file: /home/cvs/incubator-geronimo/modules/j2ee/src/java/org/apache/geronimo/j2ee/deployment/ModuleBuilder.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- ModuleBuilder.java	18 Jul 2004 22:04:27 -0000	1.2
  +++ ModuleBuilder.java	7 Aug 2004 11:22:12 -0000	1.3
  @@ -16,6 +16,7 @@
    */
   package org.apache.geronimo.j2ee.deployment;
   
  +import java.io.File;
   import java.net.URI;
   import java.net.URL;
   import java.util.jar.JarFile;
  @@ -38,6 +39,8 @@
       URI getParentId(XmlObject plan) throws DeploymentException;
   
       URI getConfigId(XmlObject plan) throws DeploymentException;
  +
  +    void installModule(File earFolder, EARContext earContext, Module module) throws DeploymentException;
   
       void installModule(JarFile earFile, EARContext earContext, Module module) throws DeploymentException;
   
  
  
  
  1.12      +5 -4      incubator-geronimo/modules/connector/src/java/org/apache/geronimo/connector/deployment/ConnectorModuleBuilder.java
  
  Index: ConnectorModuleBuilder.java
  ===================================================================
  RCS file: /home/cvs/incubator-geronimo/modules/connector/src/java/org/apache/geronimo/connector/deployment/ConnectorModuleBuilder.java,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- ConnectorModuleBuilder.java	4 Aug 2004 12:05:34 -0000	1.11
  +++ ConnectorModuleBuilder.java	7 Aug 2004 11:22:12 -0000	1.12
  @@ -68,7 +68,6 @@
   import org.apache.geronimo.j2ee.deployment.EARContext;
   import org.apache.geronimo.j2ee.deployment.Module;
   import org.apache.geronimo.j2ee.deployment.ModuleBuilder;
  -import org.apache.geronimo.j2ee.deployment.ModuleBuilderWithUnpack;
   import org.apache.geronimo.xbeans.geronimo.GerAdminobjectInstanceType;
   import org.apache.geronimo.xbeans.geronimo.GerAdminobjectType;
   import org.apache.geronimo.xbeans.geronimo.GerConfigPropertySettingType;
  @@ -102,7 +101,7 @@
   /**
    * @version $Revision$ $Date$
    */
  -public class ConnectorModuleBuilder implements ModuleBuilderWithUnpack {
  +public class ConnectorModuleBuilder implements ModuleBuilder {
   
       private static final SchemaTypeLoader SCHEMA_TYPE_LOADER = XmlBeans.typeLoaderUnion(new
SchemaTypeLoader[]{
           XmlBeans.typeLoaderForClassLoader(org.apache.geronimo.xbeans.j2ee.String.class.getClassLoader()),
  @@ -196,6 +195,9 @@
           try {
               if (!module.getURI().equals(URI.create("/"))) {
                   ZipEntry rarEntry = earFile.getEntry(module.getURI().toString());
  +                if ( null == rarEntry ) {
  +                    throw new DeploymentException("Can not find RAR file " + module.getURI());
  +                }
                   // Unpack the nested RAR.
                   File tempFile = FileUtil.toTempFile(earFile.getInputStream(rarEntry));
                   rarFile = new JarFile(tempFile);
  @@ -922,7 +924,6 @@
       static {
           GBeanInfoFactory infoFactory = new GBeanInfoFactory(ConnectorModuleBuilder.class);
           infoFactory.addInterface(ModuleBuilder.class);
  -        infoFactory.addInterface(ModuleBuilderWithUnpack.class);
           GBEAN_INFO = infoFactory.getBeanInfo();
       }
   
  
  
  
  1.21      +5 -10     incubator-geronimo/modules/jetty/src/java/org/apache/geronimo/jetty/deployment/JettyModuleBuilder.java
  
  Index: JettyModuleBuilder.java
  ===================================================================
  RCS file: /home/cvs/incubator-geronimo/modules/jetty/src/java/org/apache/geronimo/jetty/deployment/JettyModuleBuilder.java,v
  retrieving revision 1.20
  retrieving revision 1.21
  diff -u -r1.20 -r1.21
  --- JettyModuleBuilder.java	6 Aug 2004 22:44:37 -0000	1.20
  +++ JettyModuleBuilder.java	7 Aug 2004 11:22:13 -0000	1.21
  @@ -42,7 +42,6 @@
   import javax.management.MalformedObjectNameException;
   import javax.management.ObjectName;
   import javax.management.ReflectionException;
  -import javax.naming.NamingException;
   import javax.transaction.UserTransaction;
   
   import org.apache.geronimo.common.xml.XmlBeansUtil;
  @@ -55,14 +54,11 @@
   import org.apache.geronimo.j2ee.deployment.EARContext;
   import org.apache.geronimo.j2ee.deployment.Module;
   import org.apache.geronimo.j2ee.deployment.ModuleBuilder;
  -import org.apache.geronimo.j2ee.deployment.ModuleBuilderWithUnpack;
   import org.apache.geronimo.j2ee.deployment.WebModule;
   import org.apache.geronimo.jetty.JettyWebAppContext;
   import org.apache.geronimo.jetty.JettyWebAppJACCContext;
   import org.apache.geronimo.naming.deployment.ENCConfigBuilder;
  -import org.apache.geronimo.naming.java.ComponentContextBuilder;
   import org.apache.geronimo.naming.java.ReadOnlyContext;
  -import org.apache.geronimo.naming.jmx.JMXReferenceFactory;
   import org.apache.geronimo.schema.SchemaConversionUtils;
   import org.apache.geronimo.security.deploy.DefaultPrincipal;
   import org.apache.geronimo.security.deploy.Principal;
  @@ -71,9 +67,6 @@
   import org.apache.geronimo.security.deploy.Security;
   import org.apache.geronimo.transaction.UserTransactionImpl;
   import org.apache.geronimo.xbeans.geronimo.jetty.*;
  -import org.apache.geronimo.xbeans.j2ee.EjbLocalRefType;
  -import org.apache.geronimo.xbeans.j2ee.EjbRefType;
  -import org.apache.geronimo.xbeans.j2ee.EnvEntryType;
   import org.apache.geronimo.xbeans.j2ee.ResourceRefType;
   import org.apache.geronimo.xbeans.j2ee.WebAppDocument;
   import org.apache.geronimo.xbeans.j2ee.WebAppType;
  @@ -86,7 +79,7 @@
   /**
    * @version $Revision$ $Date$
    */
  -public class JettyModuleBuilder implements ModuleBuilderWithUnpack {
  +public class JettyModuleBuilder implements ModuleBuilder {
       static final SchemaTypeLoader SCHEMA_TYPE_LOADER = XmlBeans.typeLoaderUnion(new SchemaTypeLoader[]{
           XmlBeans.typeLoaderForClassLoader(org.apache.geronimo.xbeans.j2ee.String.class.getClassLoader()),
           XmlBeans.typeLoaderForClassLoader(JettyWebAppDocument.class.getClassLoader())
  @@ -220,6 +213,9 @@
           try {
               if (!webModule.getURI().equals(URI.create("/"))) {
                   ZipEntry warEntry = earFile.getEntry(webModule.getURI().toString());
  +                if ( null == warEntry ) {
  +                    throw new DeploymentException("Can not find WAR file " + webModule.getURI());
  +                }
                   // Unpack the nested JAR.
                   File tempFile = FileUtil.toTempFile(earFile.getInputStream(warEntry));
                   webAppFile = new JarFile(tempFile);
  @@ -650,7 +646,6 @@
       static {
           GBeanInfoFactory infoFactory = new GBeanInfoFactory(JettyModuleBuilder.class);
           infoFactory.addInterface(ModuleBuilder.class);
  -        infoFactory.addInterface(ModuleBuilderWithUnpack.class);
           GBEAN_INFO = infoFactory.getBeanInfo();
       }
   
  
  
  
  1.5       +29 -1     incubator-geronimo/modules/j2ee/maven.xml
  
  Index: maven.xml
  ===================================================================
  RCS file: /home/cvs/incubator-geronimo/modules/j2ee/maven.xml,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- maven.xml	1 Aug 2004 20:14:19 -0000	1.4
  +++ maven.xml	7 Aug 2004 11:22:13 -0000	1.5
  @@ -45,10 +45,14 @@
           <j:set var="ear.target.base.dir" value="${basedir}/target/test-ear13"/>
   
           <attainGoal name="setupEar"/>
  +        
  +        <attainGoal name="setupUnpackedEar"/>
       </preGoal>
   
       <goal name="setupEar">
           <ant:mkdir dir="${ear.target.base.dir}/test-ejb-jar/META-INF"/>
  +        
  +        <ant:mkdir dir="${ear.target.base.dir}/test-ejb-jar/META-INF"/>
           <copy todir="${ear.target.base.dir}/test-ejb-jar/META-INF">
               <fileset dir="${ear.src.base.dir}/test-ejb-jar/META-INF"/>
           </copy>
  @@ -96,4 +100,28 @@
               </fileset>
           </ant:jar>
       </goal>
  +
  +    <goal name="setupUnpackedEar">
  +        <j:set var="ear.unpacked.relative" value="full"/>
  +        <attainGoal name="setupBaseUnpackedEar"/>
  +        <copy todir="${basedir}/target/test-unpacked-ear/${ear.unpacked.relative}/META-INF">
  +            <fileset dir="${basedir}/src/test-unpacked-ear/META-INF"/>
  +        </copy>
  +        
  +        <j:set var="ear.unpacked.relative" value="naked"/>
  +        <attainGoal name="setupBaseUnpackedEar"/>
  +        <copy todir="${basedir}/target/test-unpacked-ear/${ear.unpacked.relative}/META-INF">
  +            <fileset dir="${basedir}/src/test-unpacked-ear/META-INF">
  +                <include name="application.xml"/>
  +            </fileset>
  +        </copy>
  +    </goal>
  +    
  +    <goal name="setupBaseUnpackedEar">
  +        <ant:mkdir dir="${basedir}/target/test-unpacked-ear/${ear.unpacked.relative}/META-INF"/>
  +        <ant:mkdir dir="${basedir}/target/test-unpacked-ear/${ear.unpacked.relative}/test-ejb-jar"/>
  +        <ant:mkdir dir="${basedir}/target/test-unpacked-ear/${ear.unpacked.relative}/test-war"/>
  +        <ant:touch file="${basedir}/target/test-unpacked-ear/${ear.unpacked.relative}/test-rar.rar"/>
  +    </goal>
  +
   </project>
  
  
  

Mime
View raw message