@Override
 public void undeploy(TargetModuleID targetModuleID) throws Exception {
   String deploymentName = targetModuleID.getModuleID();
   DeploymentPlanBuilder builder = deploymentManager.newDeploymentPlan();
   DeploymentPlan plan = builder.undeploy(deploymentName).remove(deploymentName).build();
   Future<ServerDeploymentPlanResult> future = deploymentManager.execute(plan);
   future.get();
 }
  private void executeDeploymentPlan(DeploymentPlan plan, DeploymentAction deployAction)
      throws Exception {
    Future<ServerDeploymentPlanResult> future = deploymentManager.execute(plan);
    ServerDeploymentPlanResult planResult = future.get();

    ServerDeploymentActionResult actionResult =
        planResult.getDeploymentActionResult(deployAction.getId());
    if (actionResult != null) {
      Exception deploymentException = (Exception) actionResult.getDeploymentException();
      if (deploymentException != null) throw deploymentException;
    }
  }
Пример #3
0
  private void executeDeploymentPlan(final DeploymentPlan plan, final DeploymentAction deployAction)
      throws Exception {
    try {
      final ServerDeploymentPlanResult planResult = deploymentManager.execute(plan).get();

      if (deployAction != null) {
        final ServerDeploymentActionResult actionResult =
            planResult.getDeploymentActionResult(deployAction.getId());
        if (actionResult != null) {
          final Exception deploymentException = (Exception) actionResult.getDeploymentException();
          if (deploymentException != null) throw deploymentException;
        }
      }
    } catch (final Exception e) {
      LOGGER.fatal(e.getMessage(), e);
      throw e;
    }
  }