geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hogst...@apache.org
Subject svn commit: r474972 - /geronimo/server/trunk/modules/geronimo-hot-deploy/src/main/java/org/apache/geronimo/deployment/hot/DirectoryHotDeployer.java
Date Tue, 14 Nov 2006 20:47:05 GMT
Author: hogstrom
Date: Tue Nov 14 12:47:04 2006
New Revision: 474972

URL: http://svn.apache.org/viewvc?view=rev&rev=474972
Log:
GERONIMO-1813 - Applied HotDeployer patch

Modified:
    geronimo/server/trunk/modules/geronimo-hot-deploy/src/main/java/org/apache/geronimo/deployment/hot/DirectoryHotDeployer.java

Modified: geronimo/server/trunk/modules/geronimo-hot-deploy/src/main/java/org/apache/geronimo/deployment/hot/DirectoryHotDeployer.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-hot-deploy/src/main/java/org/apache/geronimo/deployment/hot/DirectoryHotDeployer.java?view=diff&rev=474972&r1=474971&r2=474972
==============================================================================
--- geronimo/server/trunk/modules/geronimo-hot-deploy/src/main/java/org/apache/geronimo/deployment/hot/DirectoryHotDeployer.java
(original)
+++ geronimo/server/trunk/modules/geronimo-hot-deploy/src/main/java/org/apache/geronimo/deployment/hot/DirectoryHotDeployer.java
Tue Nov 14 12:47:04 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;
@@ -272,7 +272,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) {
@@ -295,7 +312,7 @@
             return null;
         }
     }
-
+    
     private DeploymentManager getDeploymentManager() throws DeploymentManagerCreationException
{
         DeploymentManager manager = factory.getDeploymentManager(deploymentURI, deploymentUser,
deploymentPassword);
         if (manager instanceof JMXDeploymentManager) {



Mime
View raw message