1 17 package org.apache.geronimo.deployment.cli; 18 19 import javax.enterprise.deploy.spi.status.ProgressObject ; 20 import javax.enterprise.deploy.spi.DeploymentManager ; 21 import javax.enterprise.deploy.spi.TargetModuleID ; 22 import java.io.PrintWriter ; 23 24 27 public class CommandRestart extends CommandStart { 28 public CommandRestart() { 29 super("restart", "1. Common Commands", "[ModuleID|TargetModuleID]+", 30 "Accepts the configId of a module, or the fully-qualified " + 31 "TargetModuleID identifying both the module and the server or cluster it's " + 32 "on, and restarts that module. The module should be available to the server " + 33 "and running. If multiple modules are specified, they will all be restarted.\n"); 34 } 35 36 protected ProgressObject runCommand(PrintWriter out, DeploymentManager mgr, TargetModuleID [] ids) { 37 ProgressObject po = mgr.stop(ids); 38 waitForProgress(out, po); 39 if(po.getDeploymentStatus().isCompleted()) { 40 po = mgr.start(ids); 41 waitForProgress(out, po); 42 } 43 return po; 44 } 45 46 protected String getAction() { 47 return "Restarted"; 48 } 49 } 50 | Popular Tags |