protected ProgressObject runCommand(ConsoleReader out, DeploymentManager mgr, TargetModuleID[] ids) { ProgressObject po = mgr.start(ids); waitForProgress(out, po); return po; }
@Override public ProgressObject start(TargetModuleID[] tmids) throws IllegalStateException { return getDeploymentManager().start(tmids); }
void start() throws Jsr88Exception { monitor(CommandType.START, dm.start(effectiveTargetModuleIDs())); }
public ProgressObject start(TargetModuleID[] targetModuleID) throws IllegalStateException { ThrowExceptionIfSuspended(); ClassLoader origClassLoader=Thread.currentThread().getContextClassLoader(); Thread.currentThread().setContextClassLoader(ServerLocationManager.getServerOnlyClassLoader(getPlatformRoot())); try{ // need to weed list of targetModules -- no app clients! // see https://glassfish.dev.java.net/issues/show_bug.cgi?id=641 TargetModuleID[] weeded = weedOutAppClientTMID(targetModuleID); ProgressObject retVal = null; if (weeded.length < 1) { retVal = new ShortCircuitProgressObject(CommandType.START, NbBundle.getMessage(SunDeploymentManager.class,"MESS_STARTED"), StateType.COMPLETED,targetModuleID); } else { retVal = new StartPOWorkAround(weeded,innerDM.start(weeded)); } return retVal; } finally{ Thread.currentThread().setContextClassLoader(origClassLoader); } }
protected ProgressObject runCommand(DeploymentManager mgr, ConsoleReader out, boolean inPlace, Target[] tlist, File module, File plan) throws DeploymentException { ProgressObject po = super.runCommand(mgr, out, inPlace, tlist, module, plan); waitForProgress(out, po); if(po.getDeploymentStatus().isFailed()) { throw new DeploymentException("Unable to deploy "+(module == null ? plan.getName() : module.getName())+": "+po.getDeploymentStatus().getMessage()); } return mgr.start(po.getResultTargetModuleIDs()); }
public void handleProgressEvent(ProgressEvent event) { DeploymentStatus status = event.getDeploymentStatus(); log.info(status.getMessage()); if (status.isCompleted()) { if (type.equals(CommandType.DISTRIBUTE)) { ProgressObject startProgress = container.getDeploymentManager().start(ids); startProgress.addProgressListener(new ProgressListener() { public void handleProgressEvent(ProgressEvent startEvent) { log.info(startEvent.getDeploymentStatus().getMessage()); if (startEvent.getDeploymentStatus().isCompleted()) { container.moduleStarted(true); } } }); } else if (type.equals(CommandType.UNDEPLOY)) { container.moduleStarted(false); } } } }
protected ProgressObject runCommand(ConsoleReader out, DeploymentManager mgr, TargetModuleID[] ids) { ProgressObject po = mgr.stop(ids); waitForProgress(out, po); if(po.getDeploymentStatus().isCompleted()) { po = mgr.start(ids); waitForProgress(out, po); } return po; }
/** * {@inheritDoc} */ @Override public void start(Deployable deployable) { DeploymentManager deploymentManager = this.getDeploymentManager(); TargetModuleID[] targetModules = null; try { targetModules = this.findTargetModule(deploymentManager, deployable); } catch (TargetException e) { throw new CargoException("Cannot communicate with the server", e); } ProgressObject progressObject = deploymentManager.start(targetModules); this.waitForProgressObject(progressObject); }
/** * Waits till the deploy progress object is in final state or till the timeout * runs out. If the deploy completes successfully the module will be started * if needed. * * @param ui progress ui which will be notified about progress object changes . * @param po progress object which will be tracked. * @param incremental is it incremental deploy? * @return true if the progress object completed successfully, false otherwise */ private boolean trackDeployProgressObject(ProgressUI ui, ProgressObject po, boolean incremental) throws ServerException { long deploymentTimeout = instance.getDeploymentTimeout(); long startTime = System.currentTimeMillis(); try { boolean completed = ProgressObjectUtil.trackProgressObject(ui, po, deploymentTimeout); if (completed) { TargetModuleID[] modules = po.getResultTargetModuleIDs(); modules = saveRootTargetModules(modules); if (!incremental) { // if incremental, plugin is responsible for starting module, depending on nature of changes ProgressObject startPO = instance.getDeploymentManager().start(modules); long deployTime = System.currentTimeMillis() - startTime; return ProgressObjectUtil.trackProgressObject(ui, startPO, deploymentTimeout - deployTime); } } return completed; } catch (TimeoutException e) { throw new ServerException(NbBundle.getMessage(TargetServer.class, "MSG_DeploymentTimeoutExceeded")); } }
this.waitForProgressObject(progressObject); progressObject = deploymentManager.start(progressObject.getResultTargetModuleIDs()); this.waitForProgressObject(progressObject);
progress = mgr.start(progress.getResultTargetModuleIDs()); while (progress.getDeploymentStatus().isRunning()) { Thread.sleep(100);
+ po.getDeploymentStatus().getMessage()); po = mgr.start(po.getResultTargetModuleIDs()); waitForProgress(consoleReader, po); TargetModuleID[] resultsDeployment = po.getResultTargetModuleIDs();
if(po.getDeploymentStatus().isCompleted()) { TargetModuleID[] ids = po.getResultTargetModuleIDs(); po = mgr.start(ids); waitForProgress(po); if(po.getDeploymentStatus().isCompleted()) {