public synchronized void addDeployment(String archiveName, Package pkg, boolean show) {
deployments.add(new Deployment(archiveName, pkg, show));
}
public synchronized void deploy() throws DuplicateDeploymentNameException, IOException, ExecutionException, InterruptedException {
ModelNode op = new ModelNode();
OperationBuilder builder = OperationBuilder.Factory.create(op);
op.get("operation").set("composite");
op.get("address").setEmptyList();
ModelNode steps = op.get("steps");
for (Deployment deployment : deployments) {
steps.add(deployment.addDeployment(builder));
}
op.get("rollout-plan").set(getRolloutPlan());
execute(builder.build());
}