[jboss-cvs] JBossAS SVN: r99005 - branches/JBPAPP_5_0/system/src/main/org/jboss/system/server/profileservice/repository/clustered.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Mon Jan 4 14:52:36 EST 2010
Author: bstansberry at jboss.com
Date: 2010-01-04 14:52:36 -0500 (Mon, 04 Jan 2010)
New Revision: 99005
Modified:
branches/JBPAPP_5_0/system/src/main/org/jboss/system/server/profileservice/repository/clustered/ClusteredDeploymentRepository.java
Log:
[JBPAPP-3326] ClusteredDeploymentRepository does not take lock before removing deployment
Modified: branches/JBPAPP_5_0/system/src/main/org/jboss/system/server/profileservice/repository/clustered/ClusteredDeploymentRepository.java
===================================================================
--- branches/JBPAPP_5_0/system/src/main/org/jboss/system/server/profileservice/repository/clustered/ClusteredDeploymentRepository.java 2010-01-04 19:46:14 UTC (rev 99004)
+++ branches/JBPAPP_5_0/system/src/main/org/jboss/system/server/profileservice/repository/clustered/ClusteredDeploymentRepository.java 2010-01-04 19:52:36 UTC (rev 99005)
@@ -347,10 +347,27 @@
public ProfileDeployment removeDeployment(String vfsPath) throws Exception
{
- ProfileDeployment deployment = getDeployment(vfsPath);
- VirtualFile root = deployment.getRoot();
- this.clusteringHandler.removeDeploymentContent(root);
- return super.removeDeployment(deployment.getName());
+ if (this.clusteringHandler == null)
+ {
+ throw new IllegalStateException("Must register RepositoryClusteringHandler before invoking removeDeployment()");
+ }
+
+ // Take control of the cluster
+ if (!this.clusteringHandler.lockGlobally())
+ {
+ throw new RuntimeException("Cannot acquire global lock");
+ }
+ try
+ {
+ ProfileDeployment deployment = getDeployment(vfsPath);
+ VirtualFile root = deployment.getRoot();
+ this.clusteringHandler.removeDeploymentContent(root);
+ return super.removeDeployment(deployment.getName());
+ }
+ finally
+ {
+ this.clusteringHandler.unlockGlobally();
+ }
}
public Collection<ModificationInfo> getModifiedDeployments() throws Exception
More information about the jboss-cvs-commits
mailing list