Examples of DeploymentStatus


Examples of javax.enterprise.deploy.spi.status.DeploymentStatus

            throw new IllegalStateException(MESSAGES.deploymentManagerNotConnected());

        ROOT_LOGGER.debugf("start %s", Arrays.asList(targetModuleIDs));

        // start the deployment process
        DeploymentStatus status = new DeploymentStatusImpl(StateType.RUNNING, CommandType.START, ActionType.EXECUTE, null);
        ProgressObject progress = new ProgressObjectImpl(status, targetModuleIDs);

        DeploymentWorker worker = new DeploymentWorker(progress, null);
        worker.start();
View Full Code Here

Examples of javax.enterprise.deploy.spi.status.DeploymentStatus

        if (isConnected == false)
            throw new IllegalStateException(MESSAGES.deploymentManagerNotConnected());

        ROOT_LOGGER.debugf("stop %s", Arrays.asList(targetModuleIDs));

        DeploymentStatus status = new DeploymentStatusImpl(StateType.RUNNING, CommandType.STOP, ActionType.EXECUTE, null);
        ProgressObject progress = new ProgressObjectImpl(status, targetModuleIDs);

        DeploymentWorker worker = new DeploymentWorker(progress, null);
        worker.start();
View Full Code Here

Examples of javax.enterprise.deploy.spi.status.DeploymentStatus

            throw new IllegalStateException(MESSAGES.deploymentManagerNotConnected());

        ROOT_LOGGER.debugf("undeploy %s", Arrays.asList(targetModuleIDs));

        // start the deployment process
        DeploymentStatus status = new DeploymentStatusImpl(StateType.RUNNING, CommandType.UNDEPLOY, ActionType.EXECUTE, null);
        ProgressObject progress = new ProgressObjectImpl(status, targetModuleIDs);

        DeploymentWorker worker = new DeploymentWorker(progress, null);
        worker.start();
View Full Code Here

Examples of javax.enterprise.deploy.spi.status.DeploymentStatus

                    String url = moduleIds[i].getWebURL();
                    log.info("Starting module: " + moduleIds[i].getModuleID() + (url == null ? "" : ("; URL: " + url)));
                }

                ProgressObject progress = getDeploymentManager().start(moduleIds);
                DeploymentStatus status = waitFor(progress);

                if (status.isFailed()) {
                    throw new MojoExecutionException("Failed to start modules: " + status.getMessage());
                }

                log.info("Started module(s):");
                logModules(moduleIds, "    ");
            }
View Full Code Here

Examples of javax.enterprise.deploy.spi.status.DeploymentStatus

            throw new IllegalStateException("No target to distribute to");
        }
        targets = new Target[] {targets[0]};
       
        ProgressObject progress = manager.distribute(targets, file, plan);
        DeploymentStatus status = waitFor(progress);

        if (status.isFailed()) {
            //
            // FIXME: There must be a better way to handle this.
            //
            if (status.getMessage().indexOf("already exists") < 0 ) {
                throw new MojoExecutionException("Distribution failed: " + status.getMessage());
            }
            log.info("Module already exists");
        }
       
View Full Code Here

Examples of javax.enterprise.deploy.spi.status.DeploymentStatus

        //
       
        ProgressListener listener = new ProgressListener()
        {
            public void handleProgressEvent(final ProgressEvent event) {
                DeploymentStatus status = event.getDeploymentStatus();

                if (!status.isRunning()) {
                    synchronized (progress) {
                        progress.notify();
                    }
                }
            }
View Full Code Here

Examples of org.apache.jetspeed.deployment.DeploymentStatus

            if (!ignoreFile(aFile))
            {
                boolean failed = false;
                boolean unknown = false;

                DeploymentStatus status = null;
                Exception de = null;
                try
                {
                    status = deploy(aFile);
                }
                catch (Exception e)
                {                   
                    de = e;
                }
               
                if ( status != null && status.getStatus() == DeploymentStatus.STATUS_OKAY )
                {
                    if (aFile.exists())
                    {
                        log.info("File: " + aFile.getAbsolutePath() + " deployed");
                        boolean result = aFile.delete();
                        if (!result)
                        {
                             log.error("Failed to remove: " + aFile);
                        }
                    }
                }
                else
                {
                    if (status == null || status.getStatus() == DeploymentStatus.STATUS_EVAL)
                    {
                        log.warn("Unrecognized file " + aFile.getAbsolutePath());
                    }
                    else if ( de != null )
                    {
View Full Code Here

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

    throw new AdminProcessingException(e.getMessage(), e);
  }

  public static void execute(DeploymentProgress progress, String errorMessage) throws AdminProcessingException {
      progress.run();
      DeploymentStatus status =  progress.getDeploymentStatus();
     
    if (status.isFailed()) {
      if (status.getFailure() != null) {
        throw new AdminProcessingException(status.getFailure().getMessage(), status.getFailure());
      }
      throw new AdminProcessingException(errorMessage);       
    }
  }
View Full Code Here

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

        .getDeploymentManager();
   
    log.debug("Stopping deployment [" + this.deploymentUrl + "]..."); //$NON-NLS-1$ //$NON-NLS-2$
    DeploymentProgress progress = deploymentManager
        .stop(this.deploymentUrl);
    DeploymentStatus stopStatus = DeploymentUtils.run(progress);
    if (stopStatus.isFailed()) {
      log.error("Failed to stop deployment '" + this.deploymentUrl //$NON-NLS-1$
          + "'.", stopStatus.getFailure()); //$NON-NLS-1$
      throw new Exception("Failed to stop deployment '" //$NON-NLS-1$
          + this.deploymentName + "' - cause: " //$NON-NLS-1$
          + stopStatus.getFailure());
    }
    log.debug("Removing deployment [" + this.deploymentUrl + "]..."); //$NON-NLS-1$ //$NON-NLS-2$
    progress = deploymentManager.remove(this.deploymentUrl);
    DeploymentStatus removeStatus = DeploymentUtils.run(progress);
    if (removeStatus.isFailed()) {
      log.error("Failed to remove deployment '" + this.deploymentUrl //$NON-NLS-1$
          + "'.", removeStatus.getFailure()); //$NON-NLS-1$
      throw new Exception("Failed to remove deployment '" //$NON-NLS-1$
          + this.deploymentName + "' - cause: " //$NON-NLS-1$
          + removeStatus.getFailure());
    }

  }
View Full Code Here

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

   * @throws Exception
   */
  private static void deployAndStart(DeploymentManager deploymentManager,
      URL contentURL, String archiveFileName) throws Exception {
    DeploymentProgress progress = null;
        DeploymentStatus distributeStatus;
        Exception distributeFailure = null;
        try {
            progress = deploymentManager.distribute(archiveFileName, contentURL, true);
            distributeStatus = run(progress);
            if (distributeStatus.isFailed()) {
                distributeFailure = (distributeStatus.getFailure() != null) ? distributeStatus.getFailure() :
                        new Exception("Distribute failed for unknown reason."); //$NON-NLS-1$
            }
        }
        catch (Exception e) {
            distributeFailure = e;
        }
        if (distributeFailure != null) {
            throw new Exception("Failed to distribute '" + contentURL + "' to '" + archiveFileName + "' - cause: "  //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
                    + ThrowableUtil.getAllMessages(distributeFailure));
        }

        // Now that we've successfully distributed the deployment, we need 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."); //$NON-NLS-1$
            }
        }
        catch (Exception e) {
            startFailure = e;
        }
        if (startFailure != null) {
            LOG.error("Failed to start deployment " + Arrays.asList(deploymentNames) //$NON-NLS-1$
                + " during deployment of '" + archiveFileName + "'. Backing out the deployment...", startFailure); //$NON-NLS-1$ //$NON-NLS-2$
            // If start failed, the app is invalid, so back out the deployment.
            DeploymentStatus removeStatus;
            Exception removeFailure = null;
            try {
                progress = deploymentManager.remove(deploymentNames);
                removeStatus = run(progress);
                if (removeStatus.isFailed()) {
                    removeFailure = (removeStatus.getFailure() != null) ? removeStatus.getFailure() :
                        new Exception("Remove failed for unknown reason."); //$NON-NLS-1$
                }
            }
            catch (Exception e) {
                removeFailure = e;
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.