private static void undeploy(StandardContext standardContext, ContextInfo contextInfo) { if (isReady(contextInfo.deployer)) { contextInfo.deployer.unmanageApp(standardContext.getName()); } else if (contextInfo.host != null) { contextInfo.host.removeChild(standardContext); } }
private static boolean undeploy(final StandardContext standardContext, final ContextInfo contextInfo) { if (isReady(contextInfo.deployer)) { contextInfo.deployer.unmanageApp(standardContext.getName()); return true; } else if (contextInfo.host != null) { return undeploy(standardContext, contextInfo.host); } else { Container container = contextInfo.standardContext; while (container != null) { if (container instanceof Host) { break; } container = container.getParent(); } return container != null && undeploy(standardContext, container); } }
public void deployWar(final StandardContext standardContext, final String host, final AppInfo info) { // TODO: instead of storing deployers, we could just lookup the right hostconfig for the server. final HostConfig deployer = deployers.get(host); if (isReady(deployer)) { // if not ready using directly host to avoid a NPE if (info != null) { final ContextInfo contextInfo = addContextInfo(host, standardContext); contextInfo.appInfo = info; contextInfo.deployer = deployer; contextInfo.module = extractModule(standardContext, info); } deployer.manageApp(standardContext); } else { final Host theHost = hosts.get(host); if (theHost != null) { if (info != null) { final ContextInfo contextInfo = addContextInfo(host, standardContext); contextInfo.appInfo = info; contextInfo.host = theHost; contextInfo.module = extractModule(standardContext, info); } theHost.addChild(standardContext); } } }
if (isReady(deployer)) { // if not ready using directly host to avoid a NPE