geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From xuhaih...@apache.org
Subject svn commit: r1151363 - in /geronimo/server/trunk/framework/modules/geronimo-deployment/src/main/java/org/apache/geronimo/deployment: DeploymentConfigurationManager.java DeploymentContext.java
Date Wed, 27 Jul 2011 07:26:47 GMT
Author: xuhaihong
Date: Wed Jul 27 07:26:46 2011
New Revision: 1151363

URL: http://svn.apache.org/viewvc?rev=1151363&view=rev
Log:
GERONIMO-6092 Use DeploymentConfigurationManager for application deployment, also merge the
repository from parent configuration manager to the DeploymentConfigurationManager

Modified:
    geronimo/server/trunk/framework/modules/geronimo-deployment/src/main/java/org/apache/geronimo/deployment/DeploymentConfigurationManager.java
    geronimo/server/trunk/framework/modules/geronimo-deployment/src/main/java/org/apache/geronimo/deployment/DeploymentContext.java

Modified: geronimo/server/trunk/framework/modules/geronimo-deployment/src/main/java/org/apache/geronimo/deployment/DeploymentConfigurationManager.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/framework/modules/geronimo-deployment/src/main/java/org/apache/geronimo/deployment/DeploymentConfigurationManager.java?rev=1151363&r1=1151362&r2=1151363&view=diff
==============================================================================
--- geronimo/server/trunk/framework/modules/geronimo-deployment/src/main/java/org/apache/geronimo/deployment/DeploymentConfigurationManager.java
(original)
+++ geronimo/server/trunk/framework/modules/geronimo-deployment/src/main/java/org/apache/geronimo/deployment/DeploymentConfigurationManager.java
Wed Jul 27 07:26:46 2011
@@ -17,6 +17,7 @@
 package org.apache.geronimo.deployment;
 
 import java.io.IOException;
+import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.Collection;
 import java.util.Collections;
@@ -53,7 +54,7 @@ public class DeploymentConfigurationMana
     private final ConfigurationManager configurationManager;
 
     public DeploymentConfigurationManager(ConfigurationManager configurationManager, Collection<?
extends Repository> repositories, BundleContext bundleContext) {
-        super(Arrays.asList(configurationManager.getStores()), configurationManager.getArtifactResolver(),
repositories, Collections.<DeploymentWatcher>emptySet(), bundleContext, getConfigurationModel(configurationManager));
+        super(Arrays.asList(configurationManager.getStores()), configurationManager.getArtifactResolver(),
mergeRepositories(repositories, configurationManager), Collections.<DeploymentWatcher>emptySet(),
bundleContext, getConfigurationModel(configurationManager));
         this.configurationManager = configurationManager;
     }
 
@@ -64,6 +65,17 @@ public class DeploymentConfigurationMana
         return new ConfigurationModel();
     }
 
+    private static Collection<? extends Repository> mergeRepositories(Collection<?
extends Repository> repositories, ConfigurationManager configurationManager) {
+        List<Repository> mergedRepositories = new ArrayList<Repository>();  
     
+        if (repositories != null) {
+            mergedRepositories.addAll(repositories);
+        }
+        if (configurationManager.getRepositories() != null) {
+            mergedRepositories.addAll(configurationManager.getRepositories());
+        }
+        return mergedRepositories;
+    }
+
     //
     // GENERAL DATA
     //

Modified: geronimo/server/trunk/framework/modules/geronimo-deployment/src/main/java/org/apache/geronimo/deployment/DeploymentContext.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/framework/modules/geronimo-deployment/src/main/java/org/apache/geronimo/deployment/DeploymentContext.java?rev=1151363&r1=1151362&r2=1151363&view=diff
==============================================================================
--- geronimo/server/trunk/framework/modules/geronimo-deployment/src/main/java/org/apache/geronimo/deployment/DeploymentContext.java
(original)
+++ geronimo/server/trunk/framework/modules/geronimo-deployment/src/main/java/org/apache/geronimo/deployment/DeploymentContext.java
Wed Jul 27 07:26:46 2011
@@ -146,7 +146,7 @@ public class DeploymentContext {
         this.naming = naming;
         this.moduleType = moduleType;
         this.environment = environment;
-        this.configurationManager = configurationManager;
+        this.configurationManager = createConfigurationManager(configurationManager, Collections.<Repository>
emptyList(), bundleContext);
         this.bundleContext = bundleContext;
 
         if (null == inPlaceConfigurationDir) {
@@ -175,12 +175,15 @@ public class DeploymentContext {
         this.naming = naming;
         this.moduleType = moduleType;
         this.environment = environment;
-        this.configurationManager = configurationManager;
+        this.configurationManager = createConfigurationManager(configurationManager, Collections.<Repository>
emptyList(), bundleContext);
         this.resourceContext = resourceContext;
         this.bundleContext = bundleContext;
     }
 
     private static ConfigurationManager createConfigurationManager(ConfigurationManager configurationManager,
Collection<Repository> repositories, BundleContext bundleContext) {
+        if (configurationManager instanceof DeploymentConfigurationManager) {
+            return configurationManager;
+        }
         return new DeploymentConfigurationManager(configurationManager, repositories, bundleContext);
     }
 



Mime
View raw message