WebGatewayBuilder builder = new WebGatewayBuilder(esbWarFiles, esbArchive, deploymentName, localCl, esbMetaData.getModel());
File subDeployment = builder.build();
if (subDeployment != null)
{
VFSDeployment vfsDeployment = null;
try
{
vfsDeployment = createVFSDeployment(subDeployment);
mainDeployer.deploy(vfsDeployment);
log.info("Deploying '" + vfsDeployment.getName() + "'");
this.setPublishers(builder.getPublishers());
this.setServlets(builder.getServlets());
this.deployment = vfsDeployment;
}
catch (Throwable throwable)
{
if (vfsDeployment != null)
{
VirtualFile deploymentFile = vfsDeployment.getRoot();
if(deploymentFile.exists())
{
log.info("Deleting '" + vfsDeployment.getSimpleName() + "'");
deploymentFile.delete();
}
}
throw new ConfigurationException("Error deploying '" + vfsDeployment.getName() + "'.", throwable);
}
}
this.state = CREATED;
}