this.server = server;
this.add(new WebApplicationDeploymentPatternWAR());
}
public WebApplicationDeployment<IVirtualDirectory> deploy(IVirtualArtifactDeploymentContext<IVirtualDirectory, WebApplicationDeployment<IVirtualDirectory>> ctx) {
IVirtualDirectory artifact = ctx.getDeployment();
WebApplicationDeployment<IVirtualDirectory> depl = this.createDeployment(artifact);
ClassLoader original = Thread.currentThread().getContextClassLoader();
try {
Thread.currentThread().setContextClassLoader(this.deploymentClassLoader);
WebApplicationServerDescriptor wsd = WebApplicationServerDescriptor.get(depl.getDeploymentStructure());
String path = wsd == null ? artifact.getName().split(".war")[0] : wsd.getContextPath();
if (!path.startsWith("/")) path = "/" + path;
WebApplicationStandard application = new WebApplicationStandard(artifact.getName(), path, depl.getDeploymentStructure());
application.setReloadable( !depl.getDeploymentStructure().isReadOnly() );
if (wsd != null) application.addAuxilaryDescriptor(wsd);
application.addAuxilaryDescriptor(artifact);
application.addAuxilaryDescriptor(depl.getDeploymentStructure());