private TargetInfo(final String targetExpr) { for (String targetName : targetExpr.split(",")) { targetNames.add(targetName); containsNonDAS |= ( ! DeploymentUtils.isDASTarget(targetName)); } }
private boolean isDASTarget(DeploymentContext context, DeployCommandParameters params) { if (DeploymentUtils.isDASTarget(params.target)) { return true; } else if (DeploymentUtils.isDomainTarget(params.target)) { List<String> targets = context.getTransientAppMetaData(DeploymentProperties.PREVIOUS_TARGETS, List.class); if (targets == null) { targets = domain.getAllReferencedTargetsForApplication( params.name); } if (targets.size() == 1 && DeploymentUtils.isDASTarget(targets.get(0))) { return true; } } return false; } }
private boolean loadAppOnDAS(String appName) { if (server.isDas()) { List<String> targets = domain.getAllReferencedTargetsForApplication(appName); for (String target : targets) { if (!DeploymentUtils.isDASTarget(target)) { // if application is referenced by any non-DAS target // we need to partially load it on DAS return true; } } } return false; } }
if (DeploymentUtils.isDASTarget(params.target)) { return;
if (!DeploymentUtils.isDASTarget(target)) { final ParameterMap paramMap = new ParameterMap(); paramMap.add("DEFAULT", name);
if (env.isDas() && !DeploymentUtils.isDASTarget(target)) { CommandRunner.CommandInvocation inv = commandRunner.getCommandInvocation("disable", report);
if (!isVersionExpression && DeploymentUtils.isDASTarget(target)) { return;
public void undeploy(String appName, ExtendedDeploymentContext context) { ActionReport report = context.getActionReport(); UndeployCommandParameters params = context.getCommandParameters(UndeployCommandParameters.class); ApplicationInfo info = appRegistry.get(appName); if (info==null) { report.failure(context.getLogger(), "Application " + appName + " not registered", null); events.send(new Event(Deployment.UNDEPLOYMENT_FAILURE, context)); return; } events.send(new Event(Deployment.UNDEPLOYMENT_START, info)); // for DAS target, the undeploy should unload the application // as well if (DeploymentUtils.isDASTarget(params.target)) { unload(info, context); } if (report.getActionExitCode().equals(ActionReport.ExitCode.SUCCESS)) { events.send(new Event(Deployment.UNDEPLOYMENT_SUCCESS, context)); deploymentLifecycleProbeProvider.applicationUndeployedEvent(appName, getApplicationType(info)); } else { events.send(new Event(Deployment.UNDEPLOYMENT_FAILURE, context)); } appRegistry.remove(appName); }
public void undeploy(String appName, ExtendedDeploymentContext context) { ActionReport report = context.getActionReport(); UndeployCommandParameters params = context.getCommandParameters(UndeployCommandParameters.class); ApplicationInfo info = appRegistry.get(appName); if (info==null) { report.failure(context.getLogger(), "Application " + appName + " not registered", null); events.send(new Event(Deployment.UNDEPLOYMENT_FAILURE, context)); return; } events.send(new Event(Deployment.UNDEPLOYMENT_START, info)); // for DAS target, the undeploy should unload the application // as well if (DeploymentUtils.isDASTarget(params.target)) { unload(info, context); } if (report.getActionExitCode().equals(ActionReport.ExitCode.SUCCESS)) { events.send(new Event(Deployment.UNDEPLOYMENT_SUCCESS, context)); deploymentLifecycleProbeProvider.applicationUndeployedEvent(appName, getApplicationType(info)); } else { events.send(new Event(Deployment.UNDEPLOYMENT_FAILURE, context)); } appRegistry.remove(appName); }