public Boolean call() throws Exception { return bye(); } };
public Shell(String domainURI, boolean useJLine) { this.runtime = TuscanyRuntime.newInstance(); this.useJline = useJLine; try { initCommands(); } catch (IOException e) { throw new RuntimeException(e); } if (domainURI != null) { domain(domainURI); } }
boolean run(final String commandsFileURL) throws IOException { BufferedReader r = new BufferedReader(new InputStreamReader(IOHelper.getLocationAsURL(commandsFileURL).openStream())); String l; try { while ((l = r.readLine()) != null) { out.println(l); String[] toks = l != null ? l.trim().split(" ") : "".split(" "); List<String> toksList = getTokens(toks); apply(eval(toksList)); } } finally { r.close(); } return true; }
@Override public boolean invoke(String[] args) throws Exception { shell.getNode().uninstallContribution(args[0]); return true; }
public TShellCompletor(Shell shell) { super((Completor)null); this.shell = shell; this.commandCompletor = new SimpleCompletor(shell.getCommandNames()); completors = new HashMap<String, Completor[]>(); completors.put("help", new Completor[]{commandCompletor, commandCompletor, new NullCompletor()}); completors.put("install", new Completor[]{commandCompletor, new InstallCompletor(shell)}); completors.put("installed", new Completor[]{commandCompletor, new ICURICompletor(shell), new NullCompletor()}); completors.put("invoke", new Completor[]{commandCompletor, new ServiceCompletor(shell), new ServiceOperationCompletor(shell), new NullCompletor()}); completors.put("load", new Completor[]{commandCompletor, new FileNameCompletor(), new NullCompletor()}); completors.put("remove", new Completor[]{commandCompletor, new ICURICompletor(shell), new NullCompletor()}); completors.put("run", new Completor[]{commandCompletor, new FileNameCompletor(), new NullCompletor()}); completors.put("save", new Completor[]{commandCompletor, new FileNameCompletor(), new NullCompletor()}); completors.put("start", new Completor[]{commandCompletor, new ICURICompletor(shell), new CompositeURICompletor(shell), new RemoteNodeCompletor(shell), new NullCompletor()}); completors.put("started", new Completor[]{commandCompletor, new ICURICompletor(shell), new CompositeURICompletor(shell), new NullCompletor()}); completors.put("stop", new Completor[]{commandCompletor, new ICURICompletor(shell), new CompositeURICompletor(shell), new NullCompletor()}); for (Command c : shell.getCommands().values()) { List<Completor> compleors = new ArrayList<Completor>(); compleors.add(commandCompletor); compleors.addAll(Arrays.asList(c.getCompletors())); completors.put(c.getName(), compleors.toArray(new Completor[]{})); } }
boolean install(final List<String> toks) throws ContributionReadException, ActivationException, ValidationException { if (getNode() == null) { out.println("not in domain, use domain command first"); return true; curl = mavenProject(curl); String uri = getNode().installContribution(curi, curl, metaDataURL, duris); out.println("installed at: " + uri); return true;
public Boolean call() throws Exception { return domains(); } };
public Boolean call() throws Exception { return domain(toks.size() > 1 ? toks.get(1) : ""); } };
public Boolean call() throws Exception { return domainComposite(); } };
boolean run(final String commandsFileURL) throws IOException { BufferedReader r = new BufferedReader(new InputStreamReader(IOHelper.getLocationAsURL(commandsFileURL).openStream())); String l; try { while ((l = r.readLine()) != null) { out.println(l); String[] toks = l != null ? l.trim().split(" ") : "".split(" "); List<String> toksList = getTokens(toks); apply(eval(toksList)); } } finally { r.close(); } return true; }
public TShellCompletor(Shell shell) { super((Completor)null); this.shell = shell; this.commandCompletor = new SimpleCompletor(shell.getCommandNames()); completors = new HashMap<String, Completor[]>(); completors.put("help", new Completor[]{commandCompletor, commandCompletor, new NullCompletor()}); completors.put("install", new Completor[]{commandCompletor, new InstallCompletor(shell)}); completors.put("installed", new Completor[]{commandCompletor, new ICURICompletor(shell), new NullCompletor()}); completors.put("invoke", new Completor[]{commandCompletor, new ServiceCompletor(shell), new ServiceOperationCompletor(shell), new NullCompletor()}); completors.put("load", new Completor[]{commandCompletor, new FileNameCompletor(), new NullCompletor()}); completors.put("remove", new Completor[]{commandCompletor, new ICURICompletor(shell), new NullCompletor()}); completors.put("run", new Completor[]{commandCompletor, new FileNameCompletor(), new NullCompletor()}); completors.put("save", new Completor[]{commandCompletor, new FileNameCompletor(), new NullCompletor()}); completors.put("start", new Completor[]{commandCompletor, new ICURICompletor(shell), new CompositeURICompletor(shell), new RemoteNodeCompletor(shell), new NullCompletor()}); completors.put("started", new Completor[]{commandCompletor, new ICURICompletor(shell), new CompositeURICompletor(shell), new NullCompletor()}); completors.put("stop", new Completor[]{commandCompletor, new ICURICompletor(shell), new CompositeURICompletor(shell), new NullCompletor()}); for (Command c : shell.getCommands().values()) { List<Completor> compleors = new ArrayList<Completor>(); compleors.add(commandCompletor); compleors.addAll(Arrays.asList(c.getCompletors())); completors.put(c.getName(), compleors.toArray(new Completor[]{})); } }
boolean install(final List<String> toks) throws ContributionReadException, ActivationException, ValidationException { if (getNode() == null) { out.println("not in domain, use domain command first"); return true; curl = mavenProject(curl); String uri = getNode().installContribution(curi, curl, metaDataURL, duris); out.println("installed at: " + uri); return true;
public Boolean call() throws Exception { return domains(); } };
public Boolean call() throws Exception { return domain(toks.size() > 1 ? toks.get(1) : ""); } };
public Boolean call() throws Exception { return domainComposite(); } };
@Override public boolean invoke(String[] args) throws Exception { shell.getNode().uninstallContribution(args[0]); return true; }