return objectName.toString();
}
public void deploy_phase2(String url) throws Exception
{
SerializableTargetModuleID moduleID = moduleMap.get(url);
if (moduleID == null)
throw new IOException("deployURL(" + url + ") has not been distributed");
if (moduleID.isRunning())
{
return;
}
URL deployURL = new URL(url);
// Build the local path
File path = new File(deployURL.getFile());
String archive = path.getName();
File deployFile = new File(uploadDir, archive);
if (deployFile.exists() == false)
throw new IOException("deployURL(" + url + ") has no local archive");
VirtualFile root = VFS.getChild(deployFile.toURI());
Deployment deployment = deploymentFactory.createVFSDeployment(getDeploymentName(root), root);
mainDeployer.addDeployment(deployment);
DeploymentContext context = null;
try
{
mainDeployer.process();
context = mainDeployer.getDeploymentContext(deployment.getName());
mainDeployer.checkComplete(deployment);
}
catch (Exception e)
{
/* destroy the context */
hack(moduleID, context, "destroy");
/* clear the child */
moduleID.clearChildModuleIDs();
/* remove the deployment */
mainDeployer.removeDeployment(getDeploymentName(root));
mainDeployer.process();
/* remove the map */
if (deleteOnUndeploy)
Files.delete(deployFile);
moduleMap.remove(url);
throw e;
}
moduleID.setRunning(true);
moduleID.clearChildModuleIDs();
// Repopulate the child modules
fillChildrenTargetModuleID(moduleID, context);
// TODO: invoke the start.
// hack(moduleID, context, "start");