1 28 29 package org.objectweb.util.launcher ; 30 31 import org.objectweb.util.launcher.parser.Repository; 32 import org.objectweb.util.launcher.parser.RunDescription; 33 import org.objectweb.util.trace.TraceSystem; 34 35 36 42 public class CommandProvider 43 { 44 52 public static CommandJava get(Repository repository, String name) { 53 CommandJava cmd = CommandFactory.instance().create(); 54 cmd.setName(name); 55 TraceSystem.get("launcher").info("Completing java command " + cmd.getName()); 56 RunDescription desc = (RunDescription) repository.getDescription(cmd.getName()); 57 cmd.setClassname(desc.getMainclass()); 58 cmd.setMode(desc.getMode()); 59 try { 60 cmd.getLoader().addURL(desc.getClasses().toStringArray()); 61 } catch (java.net.MalformedURLException ex) { 62 throw new LauncherException(ex); 63 } 64 cmd.addArguments(desc.getArguments()); 65 cmd.addProperties(desc.getProperties()); 66 return cmd; 67 } 68 } 69 | Popular Tags |