geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hogst...@apache.org
Subject svn commit: r474983 - in /geronimo/server/branches/1.1/modules/hot-deploy: project.xml src/java/org/apache/geronimo/deployment/hot/DirectoryHotDeployer.java
Date Tue, 14 Nov 2006 21:12:13 GMT
Author: hogstrom
Date: Tue Nov 14 13:12:12 2006
New Revision: 474983

URL: http://svn.apache.org/viewvc?view=rev&rev=474983
Log:
GERONIMO-1813 Applied enhancement for hot deployment

Modified:
    geronimo/server/branches/1.1/modules/hot-deploy/project.xml
    geronimo/server/branches/1.1/modules/hot-deploy/src/java/org/apache/geronimo/deployment/hot/DirectoryHotDeployer.java

Modified: geronimo/server/branches/1.1/modules/hot-deploy/project.xml
URL: http://svn.apache.org/viewvc/geronimo/server/branches/1.1/modules/hot-deploy/project.xml?view=diff&rev=474983&r1=474982&r2=474983
==============================================================================
--- geronimo/server/branches/1.1/modules/hot-deploy/project.xml (original)
+++ geronimo/server/branches/1.1/modules/hot-deploy/project.xml Tue Nov 14 13:12:12 2006
@@ -90,6 +90,12 @@
         </dependency>
 
         <dependency>
+            <groupId>geronimo</groupId>
+            <artifactId>geronimo-deployment</artifactId>
+            <version>${pom.currentVersion}</version>
+        </dependency>
+
+        <dependency>
             <groupId>commons-logging</groupId>
             <artifactId>commons-logging</artifactId>
             <version>${commons_logging_version}</version>

Modified: geronimo/server/branches/1.1/modules/hot-deploy/src/java/org/apache/geronimo/deployment/hot/DirectoryHotDeployer.java
URL: http://svn.apache.org/viewvc/geronimo/server/branches/1.1/modules/hot-deploy/src/java/org/apache/geronimo/deployment/hot/DirectoryHotDeployer.java?view=diff&rev=474983&r1=474982&r2=474983
==============================================================================
--- geronimo/server/branches/1.1/modules/hot-deploy/src/java/org/apache/geronimo/deployment/hot/DirectoryHotDeployer.java
(original)
+++ geronimo/server/branches/1.1/modules/hot-deploy/src/java/org/apache/geronimo/deployment/hot/DirectoryHotDeployer.java
Tue Nov 14 13:12:12 2006
@@ -35,7 +35,7 @@
 import org.apache.geronimo.kernel.repository.MissingDependencyException;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
-
+import org.apache.geronimo.deployment.util.DeploymentUtil;
 import javax.enterprise.deploy.spi.DeploymentManager;
 import javax.enterprise.deploy.spi.TargetModuleID;
 import javax.enterprise.deploy.spi.Target;
@@ -271,7 +271,24 @@
                     }
                 }
             } else {
-                log.error("Unable to deploy: " + po.getDeploymentStatus().getMessage());
+            	 //Try to delete the module , that failed to successfully hot-deploy  
+            	log.error("Unable to deploy: " + po.getDeploymentStatus().getMessage());
+            	String delfile=file.getAbsolutePath();
+                File fd = new File(delfile);
+                if(fd.isDirectory()){
+               	    log.info("Deleting the Directory: "+delfile);
+               	    if(DeploymentUtil.recursiveDelete(fd))
+               		    log.debug("Successfully deleted the Directory: "+delfile);
+               	    else
+               		    log.error("Couldn't delete the hot deployed directory"+delfile);
+                }else if(fd.isFile()){
+               	    log.info("Deleting the File: "+delfile);
+               	    if(fd.delete()){
+               		log.debug("Successfully deleted the File: "+delfile); 
+               	}else
+               		log.error("Couldn't delete the hot deployed directory"+delfile); 
+                }
+                            
                 return null;
             }
         } catch (DeploymentManagerCreationException e) {
@@ -294,7 +311,7 @@
             return null;
         }
     }
-
+    
     private DeploymentManager getDeploymentManager() throws DeploymentManagerCreationException
{
         DeploymentManager manager = factory.getDeploymentManager(deploymentURI, deploymentUser,
deploymentPassword);
         if (manager instanceof JMXDeploymentManager) {



Mime
View raw message