[jboss-cvs] JBossAS SVN: r68349 - trunk/system/src/main/org/jboss/system/server/profileservice/repository.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Mon Dec 17 15:01:34 EST 2007
Author: alex.loubyansky at jboss.com
Date: 2007-12-17 15:01:33 -0500 (Mon, 17 Dec 2007)
New Revision: 68349
Modified:
trunk/system/src/main/org/jboss/system/server/profileservice/repository/SerializableDeploymentRepository.java
Log:
fixed deployment removal issue seeing in ProfileServiceUnitTestCase
Modified: trunk/system/src/main/org/jboss/system/server/profileservice/repository/SerializableDeploymentRepository.java
===================================================================
--- trunk/system/src/main/org/jboss/system/server/profileservice/repository/SerializableDeploymentRepository.java 2007-12-17 18:58:32 UTC (rev 68348)
+++ trunk/system/src/main/org/jboss/system/server/profileservice/repository/SerializableDeploymentRepository.java 2007-12-17 20:01:33 UTC (rev 68349)
@@ -615,23 +615,34 @@
protected VFSDeployment removeBootstrap(String vfsPath) throws IOException
{
- File bootstrapFile = new File(bootstrapDir, vfsPath);
+ VFSDeployment vfsDeployment = bootstrapCtxs.get(vfsPath);
+ if(vfsDeployment == null)
+ throw new IllegalStateException("Deployment not found: " + vfsPath);
+ File bootstrapFile = new File(bootstrapDir, vfsDeployment.getSimpleName());
if( bootstrapFile.delete() == false )
throw new IOException("Failed to delete: "+bootstrapFile);
return bootstrapCtxs.remove(vfsPath);
}
+
+ // this is an infinite loop
protected VFSDeployment removeDeployer(String vfsPath) throws IOException
{
- File deployerFile = new File(deployersDir, vfsPath);
+ VFSDeployment vfsDeployment = deployerCtxs.get(vfsPath);
+ if(vfsDeployment == null)
+ throw new IllegalStateException("Deployment not found: " + vfsPath);
+ File deployerFile = new File(deployersDir, vfsDeployment.getSimpleName());
if( Files.delete(deployerFile) == false )
throw new IOException("Failed to delete: "+deployerFile);
- return this.removeDeployer(vfsPath);
+ return deployerCtxs.remove(vfsPath);
}
protected VFSDeployment removeApplication(String vfsPath) throws IOException
{
+ VFSDeployment vfsDeployment = applicationCtxs.get(vfsPath);
+ if(vfsDeployment == null)
+ throw new IllegalStateException("Deployment not found: " + vfsPath);
// Find the application dir
File applicationDir = applicationDirs[0];
- File deploymentFile = new File(applicationDir, vfsPath);
+ File deploymentFile = new File(applicationDir, vfsDeployment.getSimpleName());
if( Files.delete(deploymentFile) == false )
throw new IOException("Failed to delete: "+deploymentFile);
return this.applicationCtxs.remove(vfsPath);
More information about the jboss-cvs-commits
mailing list