Package javax.enterprise.deploy.spi.status

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


                if (null == targets) {
                    throw new IllegalStateException("No target to distribute to");
                }
                targets = new Target[] {targets[0]};
               
                ProgressObject progress = mgr.distribute(targets, moduleFile, planFile);
                while (progress.getDeploymentStatus().isRunning()) {
                    Thread.sleep(100);
                }

                String abbrStatusMessage;
                String fullStatusMessage = null;
                if (progress.getDeploymentStatus().isCompleted()) {
                    abbrStatusMessage = "The application was successfully deployed.<br/>";
                    // start installed app/s
                    progress = mgr.start(progress.getResultTargetModuleIDs());
                    while (progress.getDeploymentStatus().isRunning()) {
                        Thread.sleep(100);
                    }
                    abbrStatusMessage += "The application was successfully started";
                } else {
                    fullStatusMessage = progress.getDeploymentStatus().getMessage();
                    // for the abbreviated status message clip off everything
                    // after the first line, which in most cases means the gnarly stacktrace
                    abbrStatusMessage = "Deployment failed:<br/>"
                            + fullStatusMessage.substring(0, fullStatusMessage.indexOf('\n'));
                }
View Full Code Here


                Target[] all = mgr.getTargets();
                if (null == all) {
                    throw new IllegalStateException("No target to distribute to");
                }

                ProgressObject progress;
                if(isRedeploy) {
                    TargetModuleID[] targets = identifyTargets(moduleFile, planFile, mgr.getAvailableModules(null, all));
                    if(targets.length == 0) {
                        throw new PortletException("Unable to identify modules to replace.  Please include a Geronimo deployment plan or use the command-line deployment tool.");
                    }
                    progress = mgr.redeploy(targets, moduleFile, planFile);
                } else {
                    progress = mgr.distribute(new Target[] {all[0]}, moduleFile, planFile);
                }
                while(progress.getDeploymentStatus().isRunning()) {
                    Thread.sleep(100);
                }
               
                String abbrStatusMessage;
                String fullStatusMessage = null;
                if(progress.getDeploymentStatus().isCompleted()) {
                    abbrStatusMessage = "The application was successfully "+(isRedeploy ? "re" : "")+"deployed.<br/>";
                    // start installed app/s
                    if (!isRedeploy && startApp != null && !startApp.equals("")) {
                        progress = mgr.start(progress.getResultTargetModuleIDs());
                        while(progress.getDeploymentStatus().isRunning()) {
                            Thread.sleep(100);
                        }
                        abbrStatusMessage+="The application was successfully started";
                    }
                } else {
                    fullStatusMessage = progress.getDeploymentStatus().getMessage();
                    // for the abbreviated status message clip off everything
                    // after the first line, which in most cases means the gnarly stacktrace
                    abbrStatusMessage = "Deployment failed:<br/>"
                                      + fullStatusMessage.substring(0, fullStatusMessage.indexOf('\n'));
                    // try to provide an upgraded version of the plan
View Full Code Here

                    if (null == targets) {
                        throw new IllegalStateException("No target to distribute to");
                    }
                    targets = new Target[] {targets[0]};
                   
                    ProgressObject po = mgr.distribute(targets, rarFile, tempFile);
                    waitForProgress(po);
                    if(po.getDeploymentStatus().isCompleted()) {
                        TargetModuleID[] ids = po.getResultTargetModuleIDs();
                        po = mgr.start(ids);
                        waitForProgress(po);
                        if(po.getDeploymentStatus().isCompleted()) {
                            ids = po.getResultTargetModuleIDs();
                            log.info("Deployment completed successfully!");
                        }
                    }
                }
            } catch (Exception e) {
View Full Code Here

                        }
                    }
                    TargetModuleID[] ids = {runningIds[index]};

                    // undeploy the db pool
                    ProgressObject po = mgr.undeploy(ids);
                    waitForProgress(po);

                    if (po.getDeploymentStatus().isCompleted()) {
                        log.info("Undeployment completed successfully!");
                    }
                } catch (Exception e) {
                    log.error("Undeployment unsuccessful!");
                } finally {
View Full Code Here

                    if (null == targets) {
                        throw new IllegalStateException("No target to distribute to");
                    }
                    targets = new Target[] {targets[0]};
                   
                    ProgressObject po = mgr.distribute(targets, rarFile, tempFile);
                    waitForProgress(po);
                    if (po.getDeploymentStatus().isCompleted()) {
                        TargetModuleID[] ids = po.getResultTargetModuleIDs();
                        po = mgr.start(ids);
                        waitForProgress(po);
                        if (po.getDeploymentStatus().isCompleted()) {
                            ids = po.getResultTargetModuleIDs();
                            if (status != null) {
                                status.getCurrentPool().setName(data.getName());
                                status.getCurrentPool().setConfigurationName(ids[0].getModuleID());
                                status.getCurrentPool().setFinished(true);
                                response.setRenderParameter(MODE_KEY, IMPORT_STATUS_MODE);
                            }

                            log.info("Deployment completed successfully!");
                        }
                    } else if (po.getDeploymentStatus().isFailed()) {
                        data.deployError = "Unable to deploy: " + data.name;
                        response.setRenderParameter(MODE_KEY, EDIT_MODE);
                        log.info("Deployment Failed!");
                    }
                }
View Full Code Here

           if (found.length == 0) {
               throw new MojoExecutionException("Module is not deployed: " + moduleId);
           }

           log.info("Starting module: " + moduleId);
           ProgressObject progress = manager.start(found);

           DeploymentStatus status = waitFor(progress);
           if (status.isFailed()) {
               throw new MojoExecutionException("Failed to start module: " + moduleId);
           }
View Full Code Here

           if (found.length == 0) {
               throw new MojoExecutionException("Module not deployed: " + moduleId);
           }

           log.info("Stopping module: " + moduleId);
           ProgressObject progress = manager.stop(found);

           DeploymentStatus status = waitFor(progress);
           if (status.isFailed()) {
               throw new MojoExecutionException("Failed to stop module: " + moduleId);
           }
View Full Code Here

              continue;
              //throw new Exception("Module is not deployed: " + moduleId);
          }

          log.info("Undeploying module: " + moduleId);
          ProgressObject progress = manager.undeploy(found);

          DeploymentStatus status = waitFor(progress);
          if (status.isFailed()) {
              throw new MojoExecutionException("Failed to undeploy module: " + moduleId);
          }
View Full Code Here

        if (toStop.size() == 0) {
            System.out.println("Module is not running or not deployed: " + getId());
            return;
        }
        moduleIds = (TargetModuleID[]) toStop.toArray(new TargetModuleID[toStop.size()]);
        ProgressObject progress = manager.stop(moduleIds);
        DeploymentClient.waitFor(progress);
    }
View Full Code Here

        if (toUndeploy.size() == 0) {
            System.out.println("Module is running or not deployed: " + getId());
            return;
        }
        moduleIds = (TargetModuleID[]) toUndeploy.toArray(new TargetModuleID[toUndeploy.size()]);
        ProgressObject progress = manager.undeploy(moduleIds);
        DeploymentClient.waitFor(progress);
    }
View Full Code Here

TOP

Related Classes of javax.enterprise.deploy.spi.status.ProgressObject

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.