if (wsd != null) application.addAuxilaryDescriptor(wsd);
application.addAuxilaryDescriptor(artifact);
application.addAuxilaryDescriptor(depl.getDeploymentStructure());
IWebServerHost host = wsd != null && wsd.getHost() != null ? server.getHost(wsd.getHost()) : server.getDefaultHost();
if (host == null) throw new VirtualArtifactDeployerException(this, artifact, "No host could be found for deployment");
if (wsd != null) {
for (WebApplicationExtensionDescriptor waed : wsd.getExtensions()) {
String ecl = waed.getClassName() == null ? server.getExtension(waed.getName()) : waed.getClassName();
if (ecl == null) continue;
application.addExtension(waed.getName(), ecl, waed.getSettings());
}
}
depl.set("host", host);
depl.setApplication(application);
for (IVirtualArtifactDeployment link : ctx.getRelatedDeployments()) { depl.link(link, false); }
if (!host.deploy(application)) {
this.fireEvent(depl, Type.DeploymentFailure);
return null;
}
this.markDeployed(depl);