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;
    }
  }
  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;
    }
  }