You are viewing a plain text version of this content. The canonical link for it is here.
Posted to scm@geronimo.apache.org by dj...@apache.org on 2006/05/22 22:39:18 UTC

svn commit: r408760 - in /geronimo/branches/1.1/modules/deployment/src: java/org/apache/geronimo/deployment/SingleFileHotDeployer.java test/org/apache/geronimo/deployment/SingleFileHotDeployerTest.java

Author: djencks
Date: Mon May 22 13:39:18 2006
New Revision: 408760

URL: http://svn.apache.org/viewvc?rev=408760&view=rev
Log:
GERONIMO-2036 bug fix to SingleFileHotDeployer for when you relocate the server

Modified:
    geronimo/branches/1.1/modules/deployment/src/java/org/apache/geronimo/deployment/SingleFileHotDeployer.java
    geronimo/branches/1.1/modules/deployment/src/test/org/apache/geronimo/deployment/SingleFileHotDeployerTest.java

Modified: geronimo/branches/1.1/modules/deployment/src/java/org/apache/geronimo/deployment/SingleFileHotDeployer.java
URL: http://svn.apache.org/viewvc/geronimo/branches/1.1/modules/deployment/src/java/org/apache/geronimo/deployment/SingleFileHotDeployer.java?rev=408760&r1=408759&r2=408760&view=diff
==============================================================================
--- geronimo/branches/1.1/modules/deployment/src/java/org/apache/geronimo/deployment/SingleFileHotDeployer.java (original)
+++ geronimo/branches/1.1/modules/deployment/src/java/org/apache/geronimo/deployment/SingleFileHotDeployer.java Mon May 22 13:39:18 2006
@@ -152,14 +152,22 @@
                 configurationId = resolve(configurationId);
             }
 
+            // If we didn't find a previous configuration based upon the path then check one more time to
+            // see if one exists by the same configurationID.   This will catch situations where the target
+            // path was renamed or moved such that the path associated with the previous configuration no longer
+            // matches the patch associated with the new configuration.
+            if ((existingConfigurationId == null) && configurationManager.isInstalled(configurationId)) {
+                log.info("Existing Module found by moduleId");
+                existingConfigurationId = configurationId;
+            }
+
             // if we are deploying over the exisitng version we need to uninstall first
             if(configurationId.equals(existingConfigurationId)) {
-                log.info("Undeploying " + configurationId);
+                log.info("Undeploying " + existingConfigurationId);
                 configurationManager.uninstallConfiguration(existingConfigurationId);
             }
 
             // deploy it
-            log.info("Deploying " + configurationId + " in location " + dir);
             deployConfiguration(builder, store, configurationId, plan, module, Arrays.asList(configurationManager.getStores()), configurationManager.getArtifactResolver());
             wasDeployed = true;
 

Modified: geronimo/branches/1.1/modules/deployment/src/test/org/apache/geronimo/deployment/SingleFileHotDeployerTest.java
URL: http://svn.apache.org/viewvc/geronimo/branches/1.1/modules/deployment/src/test/org/apache/geronimo/deployment/SingleFileHotDeployerTest.java?rev=408760&r1=408759&r2=408760&view=diff
==============================================================================
--- geronimo/branches/1.1/modules/deployment/src/test/org/apache/geronimo/deployment/SingleFileHotDeployerTest.java (original)
+++ geronimo/branches/1.1/modules/deployment/src/test/org/apache/geronimo/deployment/SingleFileHotDeployerTest.java Mon May 22 13:39:18 2006
@@ -78,6 +78,7 @@
     private boolean shouldLoad;
     private boolean shouldStart;
     private boolean isConfigurationAlreadyLoaded;
+    private boolean isConfigurationInstalled;
 
     private File watchFile1;
     private File watchFile2;
@@ -114,6 +115,7 @@
         shouldLoad = true;
         shouldStart = true;
         isConfigurationAlreadyLoaded = true;
+        isConfigurationInstalled = false;
 
         SingleFileHotDeployer singleFileHotDeployer = new SingleFileHotDeployer(dir,
                 watchPaths,
@@ -133,6 +135,7 @@
         shouldLoad = true;
         shouldStart = true;
         isConfigurationAlreadyLoaded = true;
+        isConfigurationInstalled = false;
 
         touch(watchFile1, NOW);
         touch(watchFile2, NOW);
@@ -157,6 +160,7 @@
         shouldLoad = true;
         shouldStart = true;
         isConfigurationAlreadyLoaded = true;
+        isConfigurationInstalled = false;
 
         touch(watchFile1, NOW);
         touch(watchFile2, NOW);
@@ -181,6 +185,7 @@
         shouldLoad = true;
         shouldStart = true;
         isConfigurationAlreadyLoaded = true;
+        isConfigurationInstalled = false;
 
         touch(watchFile1, NOW);
         touch(watchFile2, NOW);
@@ -205,6 +210,7 @@
         shouldLoad = true;
         shouldStart = true;
         isConfigurationAlreadyLoaded = true;
+        isConfigurationInstalled = false;
 
         touch(watchFile1, PAST);
         touch(watchFile2, PAST);
@@ -229,6 +235,7 @@
         shouldLoad = true;
         shouldStart = true;
         isConfigurationAlreadyLoaded = true;
+        isConfigurationInstalled = false;
 
         touch(watchFile1, PAST);
         touch(watchFile2, PAST);
@@ -315,7 +322,7 @@
         private ConfigurationData loadedConfigurationData;
 
         public boolean isInstalled(Artifact configurationId) {
-            throw new UnsupportedOperationException();
+            return isConfigurationInstalled;
         }
 
         public boolean isLoaded(Artifact configurationId) {