@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();
 }
예제 #2
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);
 }
 @Override
 public void deploy(TargetModuleID targetModuleID) throws Exception {
   ROOT_LOGGER.beginDeploy(targetModuleID);
   String deploymentName = targetModuleID.getModuleID();
   DeploymentPlanBuilder builder = deploymentManager.newDeploymentPlan();
   builder = builder.add(deploymentName, new URL(deploymentName)).andDeploy();
   DeploymentPlan plan = builder.build();
   DeploymentAction deployAction = builder.getLastAction();
   executeDeploymentPlan(plan, deployAction);
   ROOT_LOGGER.endDeploy(targetModuleID);
 }
  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;
    }
  }
예제 #5
0
 @Override
 public void undeploy(final URL archiveURL) throws Exception {
   final DeploymentPlanBuilder builder = deploymentManager.newDeploymentPlan();
   final String uniqueName = url2Id.get(archiveURL);
   if (uniqueName != null) {
     final DeploymentPlan plan = builder.undeploy(uniqueName).remove(uniqueName).build();
     final DeploymentAction deployAction = builder.getLastAction();
     try {
       executeDeploymentPlan(plan, deployAction);
     } finally {
       url2Id.remove(archiveURL);
     }
   }
 }
예제 #6
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;
    }
  }