geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d...@apache.org
Subject svn commit: rev 47606 - in geronimo/trunk/modules: client-builder/src/java/org/apache/geronimo/client/builder client-builder/src/test/org/apache/geronimo/client/builder connector/src/java/org/apache/geronimo/connector/deployment connector/src/test/org/apache/geronimo/connector/deployment j2ee/src/java/org/apache/geronimo/j2ee/deployment j2ee/src/test/org/apache/geronimo/j2ee/deployment jetty/src/java/org/apache/geronimo/jetty/deployment
Date Thu, 30 Sep 2004 19:21:06 GMT
Author: dain
Date: Thu Sep 30 12:21:06 2004
New Revision: 47606

Modified:
   geronimo/trunk/modules/client-builder/src/java/org/apache/geronimo/client/builder/AppClientModuleBuilder.java
   geronimo/trunk/modules/client-builder/src/test/org/apache/geronimo/client/builder/PlanParsingTest.java
   geronimo/trunk/modules/connector/src/java/org/apache/geronimo/connector/deployment/ConnectorModuleBuilder.java
   geronimo/trunk/modules/connector/src/test/org/apache/geronimo/connector/deployment/RAR_1_0ConfigBuilderTest.java
   geronimo/trunk/modules/j2ee/src/java/org/apache/geronimo/j2ee/deployment/EARConfigBuilder.java
   geronimo/trunk/modules/j2ee/src/java/org/apache/geronimo/j2ee/deployment/ModuleBuilder.java
   geronimo/trunk/modules/j2ee/src/test/org/apache/geronimo/j2ee/deployment/MockConnectorConfigBuilder.java
   geronimo/trunk/modules/j2ee/src/test/org/apache/geronimo/j2ee/deployment/MockEJBConfigBuilder.java
   geronimo/trunk/modules/j2ee/src/test/org/apache/geronimo/j2ee/deployment/MockWARConfigBuilder.java
   geronimo/trunk/modules/jetty/src/java/org/apache/geronimo/jetty/deployment/JettyModuleBuilder.java
Log:
Changed default app client clientConfigId generation

For stand alone app client:
clientConfigId=filename without .jar
confidId=${clientConfigId}/server

For app client in an ear:
clientConfigId=${ear configId}/filename without .jar
confidId= <unused>



Modified: geronimo/trunk/modules/client-builder/src/java/org/apache/geronimo/client/builder/AppClientModuleBuilder.java
==============================================================================
--- geronimo/trunk/modules/client-builder/src/java/org/apache/geronimo/client/builder/AppClientModuleBuilder.java
(original)
+++ geronimo/trunk/modules/client-builder/src/java/org/apache/geronimo/client/builder/AppClientModuleBuilder.java
Thu Sep 30 12:21:06 2004
@@ -101,14 +101,14 @@
     }
 
     public Module createModule(File plan, JarFile moduleFile) throws DeploymentException
{
-        return createModule(plan, moduleFile, "app-client", null, true);
+        return createModule(plan, moduleFile, "app-client", null, null, true);
     }
 
-    public Module createModule(Object plan, JarFile moduleFile, String targetPath, URL specDDUrl)
throws DeploymentException {
-        return createModule(plan, moduleFile, targetPath, specDDUrl, false);
+    public Module createModule(Object plan, JarFile moduleFile, String targetPath, URL specDDUrl,
URI earConfigId) throws DeploymentException {
+        return createModule(plan, moduleFile, targetPath, specDDUrl, earConfigId, false);
     }
 
-    private Module createModule(Object plan, JarFile moduleFile, String targetPath, URL specDDUrl,
boolean standAlone) throws DeploymentException {
+    private Module createModule(Object plan, JarFile moduleFile, String targetPath, URL specDDUrl,
URI earConfigId, boolean standAlone) throws DeploymentException {
         assert moduleFile != null: "moduleFile is null";
         assert targetPath != null: "targetPath is null";
         assert !targetPath.endsWith("/"): "targetPath must not end with a '/'";
@@ -135,7 +135,7 @@
         }
 
         // parse vendor dd
-        GerApplicationClientType gerAppClient = getGeronimoAppClient(plan, moduleFile, standAlone,
targetPath, appClient);
+        GerApplicationClientType gerAppClient = getGeronimoAppClient(plan, moduleFile, standAlone,
targetPath, appClient, earConfigId);
 
         // get the ids from either the application plan or for a stand alone module from
the specific deployer
         URI configId = null;
@@ -157,7 +157,7 @@
         return new AppClientModule(standAlone, configId, parentId, moduleFile, targetPath,
appClient, gerAppClient, specDD);
     }
 
-    GerApplicationClientType getGeronimoAppClient(Object plan, JarFile moduleFile, boolean
standAlone, String targetPath, ApplicationClientType appClient) throws DeploymentException
{
+    GerApplicationClientType getGeronimoAppClient(Object plan, JarFile moduleFile, boolean
standAlone, String targetPath, ApplicationClientType appClient, URI earConfigId) throws DeploymentException
{
         GerApplicationClientType gerAppClient = null;
         try {
             // load the geronimo-application-client.xml from either the supplied plan or
from the earFile
@@ -195,7 +195,7 @@
                     // default configId is based on the module uri from the application.xml
                     path = targetPath;
                 }
-                gerAppClient = createDefaultPlan(path, appClient);
+                gerAppClient = createDefaultPlan(path, appClient, standAlone, earConfigId);
             }
         } catch (XmlException e) {
             throw new DeploymentException(e);
@@ -203,7 +203,7 @@
         return gerAppClient;
     }
 
-    private GerApplicationClientType createDefaultPlan(String name, ApplicationClientType
appClient) {
+    private GerApplicationClientType createDefaultPlan(String name, ApplicationClientType
appClient, boolean standAlone, URI earConfigId) {
         String id = appClient.getId();
         if (id == null) {
             id = name;
@@ -217,12 +217,15 @@
 
         GerApplicationClientType geronimoAppClient = GerApplicationClientType.Factory.newInstance();
 
-        // set the parentId, configId and context root
-        if (null != appClient.getId()) {
-            id = appClient.getId();
+        // set the parentId and configId
+        if (standAlone) {
+            geronimoAppClient.setClientConfigId(id);
+            geronimoAppClient.setConfigId(id + "/server");
+        } else {
+            geronimoAppClient.setClientConfigId(earConfigId.getPath() + "/" + id);
+            // not used but we need to have a value
+            geronimoAppClient.setConfigId(id);
         }
-        geronimoAppClient.setConfigId(id);
-        geronimoAppClient.setClientConfigId(id + "-client");
         return geronimoAppClient;
     }
 
@@ -411,7 +414,7 @@
                         connectorFile = new NestedJarFile(appClientModule.getEarFile(), path);
                     }
                     XmlObject connectorPlan = resource.getConnector();
-                    Module connectorModule = connectorModuleBuilder.createModule(connectorPlan,
connectorFile, path, null);
+                    Module connectorModule = connectorModuleBuilder.createModule(connectorPlan,
connectorFile, path, null, null);
                     resourceModules.add(connectorModule);
                     connectorModuleBuilder.installModule(connectorFile, appClientDeploymentContext,
connectorModule);
                 }

Modified: geronimo/trunk/modules/client-builder/src/test/org/apache/geronimo/client/builder/PlanParsingTest.java
==============================================================================
--- geronimo/trunk/modules/client-builder/src/test/org/apache/geronimo/client/builder/PlanParsingTest.java
(original)
+++ geronimo/trunk/modules/client-builder/src/test/org/apache/geronimo/client/builder/PlanParsingTest.java
Thu Sep 30 12:21:06 2004
@@ -18,7 +18,7 @@
     public void testResourceRef() throws Exception {
         File resourcePlan = new File(basedir, "src/test-resources/plans/plan1.xml");
         assertTrue(resourcePlan.exists());
-        GerApplicationClientType appClient = builder.getGeronimoAppClient(resourcePlan, null,
true, null, null);
+        GerApplicationClientType appClient = builder.getGeronimoAppClient(resourcePlan, null,
true, null, null, null);
         assertEquals(1, appClient.getResourceRefArray().length);
     }
 
@@ -39,7 +39,7 @@
     public void testConnectorInclude() throws Exception {
         File resourcePlan = new File(basedir, "src/test-resources/plans/plan2.xml");
         assertTrue(resourcePlan.exists());
-        GerApplicationClientType appClient = builder.getGeronimoAppClient(resourcePlan, null,
true, null, null);
+        GerApplicationClientType appClient = builder.getGeronimoAppClient(resourcePlan, null,
true, null, null, null);
         assertEquals(1, appClient.getResourceRefArray().length);
         assertEquals(1, appClient.getResourceArray().length);
     }

Modified: geronimo/trunk/modules/connector/src/java/org/apache/geronimo/connector/deployment/ConnectorModuleBuilder.java
==============================================================================
--- geronimo/trunk/modules/connector/src/java/org/apache/geronimo/connector/deployment/ConnectorModuleBuilder.java
(original)
+++ geronimo/trunk/modules/connector/src/java/org/apache/geronimo/connector/deployment/ConnectorModuleBuilder.java
Thu Sep 30 12:21:06 2004
@@ -100,7 +100,7 @@
         return createModule(plan, moduleFile, "war", null, true);
     }
 
-    public Module createModule(Object plan, JarFile moduleFile, String targetPath, URL specDDUrl)
throws DeploymentException {
+    public Module createModule(Object plan, JarFile moduleFile, String targetPath, URL specDDUrl,
URI earConfigId) throws DeploymentException {
         return createModule(plan, moduleFile, targetPath, specDDUrl, false);
     }
 

Modified: geronimo/trunk/modules/connector/src/test/org/apache/geronimo/connector/deployment/RAR_1_0ConfigBuilderTest.java
==============================================================================
--- geronimo/trunk/modules/connector/src/test/org/apache/geronimo/connector/deployment/RAR_1_0ConfigBuilderTest.java
(original)
+++ geronimo/trunk/modules/connector/src/test/org/apache/geronimo/connector/deployment/RAR_1_0ConfigBuilderTest.java
Thu Sep 30 12:21:06 2004
@@ -181,7 +181,7 @@
         Thread.currentThread().setContextClassLoader(cl);
 
         JarFile rarJarFile = JarUtil.createJarFile(rarFile);
-        Module module = moduleBuilder.createModule(action.getVendorDD(), rarJarFile, j2eeModuleName,
action.getSpecDD());
+        Module module = moduleBuilder.createModule(action.getVendorDD(), rarJarFile, j2eeModuleName,
action.getSpecDD(), null);
         if (module == null) {
             throw new DeploymentException("Was not a connector module");
         }

Modified: geronimo/trunk/modules/j2ee/src/java/org/apache/geronimo/j2ee/deployment/EARConfigBuilder.java
==============================================================================
--- geronimo/trunk/modules/j2ee/src/java/org/apache/geronimo/j2ee/deployment/EARConfigBuilder.java
(original)
+++ geronimo/trunk/modules/j2ee/src/java/org/apache/geronimo/j2ee/deployment/EARConfigBuilder.java
Thu Sep 30 12:21:06 2004
@@ -432,7 +432,8 @@
             Module module = builder.createModule(altVendorDDs.get(modulePath),
                     new NestedJarFile(earFile, modulePath),
                     modulePath,
-                    altSpecDD);
+                    altSpecDD,
+                    URI.create(gerApplication.getConfigId()));
 
             if (module == null) {
                 throw new DeploymentException("Module was not " + moduleTypeName + ": " +
modulePath);

Modified: geronimo/trunk/modules/j2ee/src/java/org/apache/geronimo/j2ee/deployment/ModuleBuilder.java
==============================================================================
--- geronimo/trunk/modules/j2ee/src/java/org/apache/geronimo/j2ee/deployment/ModuleBuilder.java
(original)
+++ geronimo/trunk/modules/j2ee/src/java/org/apache/geronimo/j2ee/deployment/ModuleBuilder.java
Thu Sep 30 12:21:06 2004
@@ -18,6 +18,7 @@
 
 import java.io.File;
 import java.net.URL;
+import java.net.URI;
 import java.util.jar.JarFile;
 
 import org.apache.geronimo.deployment.DeploymentException;
@@ -28,7 +29,7 @@
 public interface ModuleBuilder {
     Module createModule(File plan, JarFile moduleFile) throws DeploymentException;
 
-    Module createModule(Object plan, JarFile moduleFile, String targetPath, URL specDDUrl)
throws DeploymentException;
+    Module createModule(Object plan, JarFile moduleFile, String targetPath, URL specDDUrl,
URI earConfigId) throws DeploymentException;
 
     void installModule(JarFile earFile, EARContext earContext, Module module) throws DeploymentException;
 

Modified: geronimo/trunk/modules/j2ee/src/test/org/apache/geronimo/j2ee/deployment/MockConnectorConfigBuilder.java
==============================================================================
--- geronimo/trunk/modules/j2ee/src/test/org/apache/geronimo/j2ee/deployment/MockConnectorConfigBuilder.java
(original)
+++ geronimo/trunk/modules/j2ee/src/test/org/apache/geronimo/j2ee/deployment/MockConnectorConfigBuilder.java
Thu Sep 30 12:21:06 2004
@@ -18,6 +18,7 @@
 
 import java.io.File;
 import java.net.URL;
+import java.net.URI;
 import java.util.jar.JarFile;
 
 import junit.framework.Assert;
@@ -35,7 +36,7 @@
         return new ConnectorModule(true, null, null, moduleFile, "connector", null, null,
null);
     }
 
-    public Module createModule(Object plan, JarFile moduleFile, String targetPath, URL specDDUrl)
throws DeploymentException {
+    public Module createModule(Object plan, JarFile moduleFile, String targetPath, URL specDDUrl,
URI earConfigId) throws DeploymentException {
         return new ConnectorModule(false, null, null, moduleFile, targetPath, null, null,
null);
     }
 

Modified: geronimo/trunk/modules/j2ee/src/test/org/apache/geronimo/j2ee/deployment/MockEJBConfigBuilder.java
==============================================================================
--- geronimo/trunk/modules/j2ee/src/test/org/apache/geronimo/j2ee/deployment/MockEJBConfigBuilder.java
(original)
+++ geronimo/trunk/modules/j2ee/src/test/org/apache/geronimo/j2ee/deployment/MockEJBConfigBuilder.java
Thu Sep 30 12:21:06 2004
@@ -18,6 +18,7 @@
 
 import java.io.File;
 import java.net.URL;
+import java.net.URI;
 import java.util.jar.JarFile;
 
 import junit.framework.Assert;
@@ -35,7 +36,7 @@
         return new EJBModule(true, null, null, moduleFile, "ejb.jar", null, null, null);
     }
 
-    public Module createModule(Object plan, JarFile moduleFile, String targetPath, URL specDDUrl)
throws DeploymentException {
+    public Module createModule(Object plan, JarFile moduleFile, String targetPath, URL specDDUrl,
URI earConfigId) throws DeploymentException {
         return new EJBModule(false, null, null, moduleFile, targetPath, null, null, null);
     }
 

Modified: geronimo/trunk/modules/j2ee/src/test/org/apache/geronimo/j2ee/deployment/MockWARConfigBuilder.java
==============================================================================
--- geronimo/trunk/modules/j2ee/src/test/org/apache/geronimo/j2ee/deployment/MockWARConfigBuilder.java
(original)
+++ geronimo/trunk/modules/j2ee/src/test/org/apache/geronimo/j2ee/deployment/MockWARConfigBuilder.java
Thu Sep 30 12:21:06 2004
@@ -18,6 +18,7 @@
 
 import java.io.File;
 import java.net.URL;
+import java.net.URI;
 import java.util.jar.JarFile;
 
 import javax.management.ObjectName;
@@ -38,7 +39,7 @@
         return new WebModule(true, null, null, moduleFile, "war", null, null, null);
     }
 
-    public Module createModule(Object plan, JarFile moduleFile, String targetPath, URL specDDUrl)
throws DeploymentException {
+    public Module createModule(Object plan, JarFile moduleFile, String targetPath, URL specDDUrl,
URI earConfigId) throws DeploymentException {
         return new WebModule(false, null, null, moduleFile, targetPath, null, null, null);
     }
 

Modified: geronimo/trunk/modules/jetty/src/java/org/apache/geronimo/jetty/deployment/JettyModuleBuilder.java
==============================================================================
--- geronimo/trunk/modules/jetty/src/java/org/apache/geronimo/jetty/deployment/JettyModuleBuilder.java
(original)
+++ geronimo/trunk/modules/jetty/src/java/org/apache/geronimo/jetty/deployment/JettyModuleBuilder.java
Thu Sep 30 12:21:06 2004
@@ -89,7 +89,7 @@
         return createModule(plan, moduleFile, "war", null, true);
     }
 
-    public Module createModule(Object plan, JarFile moduleFile, String targetPath, URL specDDUrl)
throws DeploymentException {
+    public Module createModule(Object plan, JarFile moduleFile, String targetPath, URL specDDUrl,
URI earConfigId) throws DeploymentException {
         return createModule(plan, moduleFile, targetPath, specDDUrl, false);
     }
 

Mime
View raw message