[jboss-cvs] JBossAS SVN: r60132 - in branches/Branch_4_2/deployment/src: main/org/jboss/deployment/services and 1 other directory.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Wed Jan 31 07:43:12 EST 2007
Author: thomas.diesler at jboss.com
Date: 2007-01-31 07:43:12 -0500 (Wed, 31 Jan 2007)
New Revision: 60132
Modified:
branches/Branch_4_2/deployment/src/etc/jsr88-service.xml
branches/Branch_4_2/deployment/src/main/org/jboss/deployment/services/DeploymentManagerService.java
branches/Branch_4_2/deployment/src/main/org/jboss/deployment/services/DeploymentManagerServiceMBean.java
Log:
Merge the failOnCollision, deleteOnUndeploy changes from trunk
Modified: branches/Branch_4_2/deployment/src/etc/jsr88-service.xml
===================================================================
--- branches/Branch_4_2/deployment/src/etc/jsr88-service.xml 2007-01-31 09:44:59 UTC (rev 60131)
+++ branches/Branch_4_2/deployment/src/etc/jsr88-service.xml 2007-01-31 12:43:12 UTC (rev 60132)
@@ -11,5 +11,9 @@
<attribute name="CARDeployer">jboss.j2ee:service=ClientDeployer</attribute>
<attribute name="UploadDir">${jboss.server.temp.dir}/jsr88</attribute>
<depends optional-attribute-name="MainDeployer">jboss.system:service=MainDeployer</depends>
+ <!-- If false, the an existing deployment may exist in the upload dir -->
+ <attribute name="FailOnCollision">false</attribute>
+ <!-- If false, the deployment is retained in the upload dir -->
+ <attribute name="DeleteOnUndeploy">false</attribute>
</mbean>
</server>
Modified: branches/Branch_4_2/deployment/src/main/org/jboss/deployment/services/DeploymentManagerService.java
===================================================================
--- branches/Branch_4_2/deployment/src/main/org/jboss/deployment/services/DeploymentManagerService.java 2007-01-31 09:44:59 UTC (rev 60131)
+++ branches/Branch_4_2/deployment/src/main/org/jboss/deployment/services/DeploymentManagerService.java 2007-01-31 12:43:12 UTC (rev 60132)
@@ -70,6 +70,8 @@
* The local directory for uploaded content.
*/
File uploadDir;
+ private boolean failOnCollision;
+ private boolean deleteOnUndeploy;
public ObjectName getMainDeployer()
{
@@ -181,6 +183,26 @@
this.uploadDir = uploadDir;
}
+ public boolean isDeleteOnUndeploy()
+ {
+ return deleteOnUndeploy;
+ }
+
+ public void setDeleteOnUndeploy(boolean deleteOnUndeploy)
+ {
+ this.deleteOnUndeploy = deleteOnUndeploy;
+ }
+
+ public boolean isFailOnCollision()
+ {
+ return failOnCollision;
+ }
+
+ public void setFailOnCollision(boolean failOnCollision)
+ {
+ this.failOnCollision = failOnCollision;
+ }
+
public Map getModuleMap()
{
return Collections.unmodifiableMap(moduleMap);
@@ -200,9 +222,12 @@
File path = new File(deployURL.getFile());
String archive = path.getName();
File deployFile = new File(uploadDir, archive);
- if (deployFile.exists() == true)
+ if (failOnCollision && deployFile.exists())
throw new IOException("deployURL(" + deployURL + ") collides with: " + deployFile.getPath());
+ if (deployFile.exists())
+ Files.delete(deployFile);
+
File parentFile = deployFile.getParentFile();
if (parentFile.exists() == false)
{
@@ -285,8 +310,10 @@
File deployFile = new File(uploadDir, archive);
if (deployFile.exists() == false)
throw new IOException("deployURL(" + url + ") has not been distributed");
- Files.delete(deployFile);
+ if (deleteOnUndeploy)
+ Files.delete(deployFile);
+
moduleMap.remove(url);
}
Modified: branches/Branch_4_2/deployment/src/main/org/jboss/deployment/services/DeploymentManagerServiceMBean.java
===================================================================
--- branches/Branch_4_2/deployment/src/main/org/jboss/deployment/services/DeploymentManagerServiceMBean.java 2007-01-31 09:44:59 UTC (rev 60131)
+++ branches/Branch_4_2/deployment/src/main/org/jboss/deployment/services/DeploymentManagerServiceMBean.java 2007-01-31 12:43:12 UTC (rev 60132)
@@ -42,6 +42,14 @@
public void setUploadDir(File uploadDir);
+ boolean isDeleteOnUndeploy();
+
+ void setDeleteOnUndeploy(boolean deleteOnUndeploy);
+
+ boolean isFailOnCollision();
+
+ void setFailOnCollision(boolean failOnCollision);
+
public ObjectName getMainDeployer();
public void setMainDeployer(ObjectName deployer);
More information about the jboss-cvs-commits
mailing list