geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From djen...@apache.org
Subject svn commit: r394591 - in /geronimo/branches/1.1/modules: client-builder/src/java/org/apache/geronimo/client/builder/AppClientModuleBuilder.java connector-builder/src/java/org/apache/geronimo/connector/deployment/ConnectorModuleBuilder.java
Date Mon, 17 Apr 2006 00:33:30 GMT
Author: djencks
Date: Sun Apr 16 17:33:29 2006
New Revision: 394591

URL: http://svn.apache.org/viewcvs?rev=394591&view=rev
Log:
GERONIMO-1850 fix some environment merging problems

Modified:
    geronimo/branches/1.1/modules/client-builder/src/java/org/apache/geronimo/client/builder/AppClientModuleBuilder.java
    geronimo/branches/1.1/modules/connector-builder/src/java/org/apache/geronimo/connector/deployment/ConnectorModuleBuilder.java

Modified: geronimo/branches/1.1/modules/client-builder/src/java/org/apache/geronimo/client/builder/AppClientModuleBuilder.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/client-builder/src/java/org/apache/geronimo/client/builder/AppClientModuleBuilder.java?rev=394591&r1=394590&r2=394591&view=diff
==============================================================================
--- geronimo/branches/1.1/modules/client-builder/src/java/org/apache/geronimo/client/builder/AppClientModuleBuilder.java
(original)
+++ geronimo/branches/1.1/modules/client-builder/src/java/org/apache/geronimo/client/builder/AppClientModuleBuilder.java
Sun Apr 16 17:33:29 2006
@@ -120,17 +120,18 @@
     }
 
     public Module createModule(File plan, JarFile moduleFile, Naming naming) throws DeploymentException
{
-        return createModule(plan, moduleFile, "app-client", null, null, true, null, naming);
+        return createModule(plan, moduleFile, "app-client", null, null, null, naming);
     }
 
     public Module createModule(Object plan, JarFile moduleFile, String targetPath, URL specDDUrl,
Environment environment, Object moduleContextInfo, AbstractName earName, Naming naming) throws
DeploymentException {
-        return createModule(plan, moduleFile, targetPath, specDDUrl, environment, false,
earName, naming);
+        return createModule(plan, moduleFile, targetPath, specDDUrl, environment, earName,
naming);
     }
 
-    private Module createModule(Object plan, JarFile moduleFile, String targetPath, URL specDDUrl,
Environment environment, boolean standAlone, AbstractName earName, Naming naming) throws DeploymentException
{
+    private Module createModule(Object plan, JarFile moduleFile, String targetPath, URL specDDUrl,
Environment earEnvironment, AbstractName earName, Naming naming) throws DeploymentException
{
         assert moduleFile != null: "moduleFile is null";
         assert targetPath != null: "targetPath is null";
         assert !targetPath.endsWith("/"): "targetPath must not end with a '/'";
+        assert (earName == null) == (earEnvironment == null): "if earName is not null you
must supply earEnvironment as well";
 
         String specDD;
         ApplicationClientType appClient;
@@ -157,18 +158,23 @@
         }
 
         // parse vendor dd
-        GerApplicationClientType gerAppClient = getGeronimoAppClient(plan, moduleFile, standAlone,
targetPath, appClient, environment);
+        boolean standAlone = earEnvironment == null;
+        GerApplicationClientType gerAppClient = getGeronimoAppClient(plan, moduleFile, standAlone,
targetPath, appClient, earEnvironment);
 
 
         EnvironmentType clientEnvironmentType = gerAppClient.getClientEnvironment();
         Environment clientEnvironment = EnvironmentBuilder.buildEnvironment(clientEnvironmentType,
defaultClientEnvironment);
         EnvironmentType serverEnvironmentType = gerAppClient.getServerEnvironment();
         Environment serverEnvironment = EnvironmentBuilder.buildEnvironment(serverEnvironmentType,
defaultServerEnvironment);
+        if (earEnvironment != null) {
+            EnvironmentBuilder.mergeEnvironments(earEnvironment, serverEnvironment);
+            serverEnvironment = earEnvironment;
+        }
 
         AbstractName moduleName;
         if (earName == null) {
-            earName = naming.createRootName(environment.getConfigId(), NameFactory.NULL,
NameFactory.J2EE_APPLICATION);
-            moduleName = naming.createChildName(earName, environment.getConfigId().toString(),
NameFactory.APP_CLIENT_MODULE);
+            earName = naming.createRootName(earEnvironment.getConfigId(), NameFactory.NULL,
NameFactory.J2EE_APPLICATION);
+            moduleName = naming.createChildName(earName, earEnvironment.getConfigId().toString(),
NameFactory.APP_CLIENT_MODULE);
         } else {
             moduleName = naming.createChildName(earName, targetPath, NameFactory.APP_CLIENT_MODULE);
         }
@@ -413,7 +419,7 @@
                                 }
                             }
                             XmlObject connectorPlan = resource.getConnector();
-                            Module connectorModule = connectorModuleBuilder.createModule(connectorPlan,
connectorFile, path, null, null, null, appClientDeploymentContext.getModuleName(), earContext.getNaming());
+                            Module connectorModule = connectorModuleBuilder.createModule(connectorPlan,
connectorFile, path, null, appClientModule.getClientEnvironment(), null, appClientDeploymentContext.getModuleName(),
earContext.getNaming());
                             resourceModules.add(connectorModule);
                             //TODO configStore == null is fishy, consider moving these stages
for connectors into the corresponding stages for this module.
                             connectorModuleBuilder.installModule(connectorFile, appClientDeploymentContext,
connectorModule, null, null, repositories);

Modified: geronimo/branches/1.1/modules/connector-builder/src/java/org/apache/geronimo/connector/deployment/ConnectorModuleBuilder.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/connector-builder/src/java/org/apache/geronimo/connector/deployment/ConnectorModuleBuilder.java?rev=394591&r1=394590&r2=394591&view=diff
==============================================================================
--- geronimo/branches/1.1/modules/connector-builder/src/java/org/apache/geronimo/connector/deployment/ConnectorModuleBuilder.java
(original)
+++ geronimo/branches/1.1/modules/connector-builder/src/java/org/apache/geronimo/connector/deployment/ConnectorModuleBuilder.java
Sun Apr 16 17:33:29 2006
@@ -147,14 +147,14 @@
     }
 
     public Module createModule(File plan, JarFile moduleFile, Naming naming) throws DeploymentException
{
-        return createModule(plan, moduleFile, "rar", null, true, null, naming);
+        return createModule(plan, moduleFile, "rar", null, null, null, naming);
     }
 
     public Module createModule(Object plan, JarFile moduleFile, String targetPath, URL specDDUrl,
Environment environment, Object moduleContextInfo, AbstractName earName, Naming naming) throws
DeploymentException {
-        return createModule(plan, moduleFile, targetPath, specDDUrl, false, earName, naming);
+        return createModule(plan, moduleFile, targetPath, specDDUrl, environment, earName,
naming);
     }
 
-    private Module createModule(Object plan, JarFile moduleFile, String targetPath, URL specDDUrl,
boolean standAlone, AbstractName earName, Naming naming) throws DeploymentException {
+    private Module createModule(Object plan, JarFile moduleFile, String targetPath, URL specDDUrl,
Environment earEnvironment, AbstractName earName, Naming naming) throws DeploymentException
{
         assert moduleFile != null: "moduleFile is null";
         assert targetPath != null: "targetPath is null";
         assert !targetPath.endsWith("/"): "targetPath must not end with a '/'";
@@ -230,7 +230,11 @@
 
         EnvironmentType environmentType = gerConnector.getEnvironment();
         Environment environment = EnvironmentBuilder.buildEnvironment(environmentType, defaultEnvironment);
-
+        if (earEnvironment != null) {
+            EnvironmentBuilder.mergeEnvironments(earEnvironment, environment);
+            environment = earEnvironment;
+        }
+                                    
         AbstractName moduleName;
         if (earName == null) {
             earName = naming.createRootName(environment.getConfigId(), NameFactory.NULL,
NameFactory.J2EE_APPLICATION);
@@ -239,6 +243,7 @@
             moduleName = naming.createChildName(earName, targetPath, NameFactory.RESOURCE_ADAPTER_MODULE);
         }
 
+        boolean standAlone = earEnvironment == null;
         return new ConnectorModule(standAlone, moduleName, environment, moduleFile, targetPath,
connector, gerConnector, specDD);
     }
 



Mime
View raw message