1 17 18 package org.apache.geronimo.deployment.cli; 19 20 import org.apache.geronimo.common.DeploymentException; 21 22 import javax.enterprise.deploy.spi.DeploymentManager ; 23 import javax.enterprise.deploy.spi.Target ; 24 import javax.enterprise.deploy.spi.status.ProgressObject ; 25 import java.io.File ; 26 import java.io.PrintWriter ; 27 28 33 public class CommandDeploy extends CommandDistribute { 34 public CommandDeploy() { 35 super("deploy", "1. Common Commands", "[--inPlace] [--targets target;target;...] [module] [plan]", 36 "Normally both a module and plan are passed to the deployer. " + 37 "Sometimes the module contains a plan, or requires no plan, in which case " + 38 "the plan may be omitted. Sometimes the plan references a module already " + 39 "deployed in the Geronimo server environment, in which case a module does " + 40 "not need to be provided.\n" + 41 "If no targets are provided, the module is deployed to all available " + 42 "targets. Geronimo only provides one target (ever), so this is primarily " + 43 "useful when using a different driver."); 44 } 45 46 protected String getAction() { 47 return "Deployed"; 48 } 49 50 protected ProgressObject runCommand(DeploymentManager mgr, PrintWriter out, boolean inPlace, Target [] tlist, File module, File plan) throws DeploymentException { 51 ProgressObject po = super.runCommand(mgr, out, inPlace, tlist, module, plan); 52 waitForProgress(out, po); 53 if(po.getDeploymentStatus().isFailed()) { 54 throw new DeploymentException("Unable to distribute "+(module == null ? plan.getName() : module.getName())+": "+po.getDeploymentStatus().getMessage()); 55 } 56 return mgr.start(po.getResultTargetModuleIDs()); 57 } 58 59 public void execute(PrintWriter out, ServerConnection connection, String [] args) throws DeploymentException { 60 super.execute(out, connection, args); 61 } 62 } 63 | Popular Tags |