public void undeploy(String runtimeName, String target) throws DeploymentException { try { DeploymentPlanBuilder builder = deploymentManager.newDeploymentPlan(); DeploymentPlan plan = builder.undeploy(runtimeName).remove(runtimeName).toServerGroup(target).build(); Future<DeploymentPlanResult> future = deploymentManager.execute(plan); future.get(); } catch (Exception ex) { log.warn("Cannot undeploy: " + runtimeName + ":" + ex.getMessage()); } }
return groupPlanBuilder.build();
public String deploy(Archive<?> archive, String target) throws DeploymentException { try { final InputStream input = archive.as(ZipExporter.class).exportAsInputStream(); try { InitialDeploymentPlanBuilder builder = deploymentManager.newDeploymentPlan(); DeploymentPlan plan = builder.add(archive.getName(), input).andDeploy().toServerGroup(target).build(); DeploymentAction deployAction = plan.getDeploymentActions().get(plan.getDeploymentActions().size() - 1); return executeDeploymentPlan(plan, deployAction); } finally { if (input != null) try { input.close(); } catch (IOException e) { log.warnf(e, "Failed to close resource %s", input); } } } catch (Exception e) { throw new DeploymentException("Could not deploy to container", e); } }
DeploymentPlan plan = serverGroupBuilder.build(); Future<DeploymentPlanResult> future = deploymentManagerDeprecated.execute(plan); future.get();
DeploymentPlan plan = serverGroupBuilder.build(); DeploymentAction deployAction = plan.getDeploymentActions().get(plan.getDeploymentActions().size() - 1); return executeDeploymentPlan(plan, deployAction);