Exemplo n.º 1
0
 @Override
 public void deploy(final URL archiveURL) throws Exception {
   final DeploymentPlanBuilder builder =
       deploymentManager.newDeploymentPlan().add(archiveURL).andDeploy();
   final DeploymentPlan plan = builder.build();
   final DeploymentAction deployAction = builder.getLastAction();
   final String uniqueId = deployAction.getDeploymentUnitUniqueName();
   executeDeploymentPlan(plan, deployAction);
   url2Id.put(archiveURL, uniqueId);
 }
  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;
    }
  }
Exemplo n.º 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;
    }
  }