Package org.jboss.deployers.spi.management.deploy

Examples of org.jboss.deployers.spi.management.deploy.DeploymentStatus


        List<DeploymentOption> deploymentOptions = new ArrayList<DeploymentOption>();
        if (deployExploded) {
            deploymentOptions.add(DeploymentOption.Explode);
        }
        DeploymentProgress progress = null;
        DeploymentStatus distributeStatus;
        Exception distributeFailure = null;
        try {
            progress = deploymentManager.distribute(archiveFileName, contentURL,
                deploymentOptions.toArray(new DeploymentOption[deploymentOptions.size()]));
            distributeStatus = run(progress);
            if (distributeStatus.isFailed()) {
                distributeFailure = (distributeStatus.getFailure() != null) ? distributeStatus.getFailure()
                    : new Exception("Distribute failed for unknown reason.");
            }
        } catch (Exception e) {
            distributeFailure = e;
        }
        if (distributeFailure != null) {
            throw new Exception("Failed to distribute '" + contentURL + "' to '" + archiveFileName + "' - cause: "
                + ThrowableUtil.getAllMessages(distributeFailure));
        }

        // Now that we've successfully distributed the deployment, try to start it.
        String[] deploymentNames = progress.getDeploymentID().getRepositoryNames();
        DeploymentStatus startStatus;
        Exception startFailure = null;
        try {
            progress = deploymentManager.start(deploymentNames);
            startStatus = run(progress);
            if (startStatus.isFailed()) {
                startFailure = (startStatus.getFailure() != null) ? startStatus.getFailure() : new Exception(
                    "Start failed for unknown reason.");
            }
        } catch (Exception e) {
            startFailure = e;
        }
View Full Code Here


            if (LOG.isDebugEnabled()) {
                LOG.debug("Redeploying parent deployment '" + parentDeployment.getName()
                    + "' in order to complete removal of component " + toString(managedComponent) + "...");
            }
            DeploymentProgress progress = deploymentManager.redeploy(parentDeployment.getName());
            DeploymentStatus status = DeploymentUtils.run(progress);
            if (status.isFailed()) {
                LOG.error("Failed to redeploy parent deployment '" + parentDeployment.getName()
                    + "during removal of component " + toString(managedComponent)
                    + " - removal may not persist when the app server is restarted.", status.getFailure());
            }
        } else {
            //this is the last component of the deployment and nothing would be left there after
            //the component was removed. Let's just undeploy it in addition to removing the component.
            //This will make sure that the deployment doesn't leave behind any defunct config files, etc.
            if (LOG.isDebugEnabled()) {
                LOG.debug("Undeploying parent deployment '" + parentDeployment.getName()
                    + "' in order to complete removal of component " + toString(managedComponent) + "...");
            }
            parentDeployment = managementView.getDeployment(parentDeployment.getName());
            DeploymentProgress progress = deploymentManager.remove(parentDeployment.getName());
            DeploymentStatus status = DeploymentUtils.run(progress);
            if (status.isFailed()) {
                LOG.error("Failed to undeploy parent deployment '" + parentDeployment.getName()
                    + "during removal of component " + toString(managedComponent)
                    + " - removal may not persist when the app server is restarted.", status.getFailure());
            }
        }

        managementView.load();
    }
View Full Code Here

        DeploymentManager deploymentManager = getDeploymentManager();

        DeploymentProgress progress = deploymentManager.distribute(name, archiveFile.toURI().toURL(), exploded);
        progress.run();

        DeploymentStatus status = progress.getDeploymentStatus();

        if (status.isFailed()) {
            throw new IllegalStateException("Failed to distribute " + archiveFile.getAbsolutePath() + " with message: "
                + status.getMessage());
        }

        String[] deploymentNames = progress.getDeploymentID().getRepositoryNames();

        progress = deploymentManager.start(deploymentNames);
        progress.run();

        status = progress.getDeploymentStatus();

        if (status.isFailed()) {
            throw new IllegalStateException("Failed to start " + archiveFile.getAbsolutePath() + " with message: "
                + status.getMessage());
        }

    }
View Full Code Here

       
        DeploymentProgress progress = deploymentManager.stop(archiveName);
        progress.run();

        DeploymentStatus status = progress.getDeploymentStatus();

        if (status.isFailed()) {
            throw new IllegalStateException("Failed to stop " + archiveName + " with message: "
                + status.getMessage());
        }

        progress = deploymentManager.remove(archiveName);
        progress.run();

        status = progress.getDeploymentStatus();

        if (status.isFailed()) {
            throw new IllegalStateException("Failed to undeploy " + archiveName + " with message: "
                + status.getMessage());
        }
    }
View Full Code Here

            // Still try to start, even if stop fails (maybe the app wasn't running to begin with).
            progress = deploymentManager.start(deploymentName);
        } else {
            throw new UnsupportedOperationException(name);
        }
        DeploymentStatus status = DeploymentUtils.run(progress);
        if (LOG.isDebugEnabled()) {
            LOG.debug("Operation '" + name + "' on " + getResourceDescription() + " returned status [" + status + "].");
        }
        if (status.isFailed()) {
            throw status.getFailure();
        }
        return new OperationResult();
    }
View Full Code Here

    DeploymentProgress progress = deploymentManager.distribute(name,
        archiveFile.toURI().toURL(), exploded);
    progress.run();

    DeploymentStatus status = progress.getDeploymentStatus();

    if (status.isFailed()) {
      throw new IllegalStateException("Failed to distribute "
          + archiveFile.getAbsolutePath() + " with message: "
          + status.getMessage());
    }

    String[] deploymentNames = progress.getDeploymentID()
        .getRepositoryNames();

    progress = deploymentManager.start(deploymentNames);
    progress.run();

    status = progress.getDeploymentStatus();

    if (status.isFailed()) {
      throw new IllegalStateException("Failed to start "
          + archiveFile.getAbsolutePath() + " with message: "
          + status.getMessage());
    }

  }
View Full Code Here

    DeploymentManager deploymentManager = getDeploymentManager();

    DeploymentProgress progress = deploymentManager.remove(archiveName);
    progress.run();

    DeploymentStatus status = progress.getDeploymentStatus();

    if (status.isFailed()) {
      throw new IllegalStateException("Failed to undeploy " + archiveName
          + " with message: " + status.getMessage());
    }
  }
View Full Code Here

      };
   }

   protected static void checkProgress(DeploymentProgress progress) throws Exception
   {
      DeploymentStatus status = progress.getDeploymentStatus();
      Throwable failure = status.getFailure();
      if (failure != null)
      {
         staticLog.debug(status);
         throw new Exception(failure);
      }
View Full Code Here

   {
      DeploymentProgress progress = deployMgr.start(repositoryNames);
      progress.addProgressListener(this);
      progress.run();
     
      DeploymentStatus status = progress.getDeploymentStatus();
      assertCompleted(status);
   }
View Full Code Here

   {
      DeploymentProgress progress = deployMgr.stop(repositoryNames);
      progress.addProgressListener(this);
      progress.run();
     
      DeploymentStatus status = progress.getDeploymentStatus();
      assertCompleted(status);
   }
View Full Code Here

TOP

Related Classes of org.jboss.deployers.spi.management.deploy.DeploymentStatus

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.