From d8eabd6d1abf0be346f26b91cd82ee5ac106bf06 Mon Sep 17 00:00:00 2001 From: antelder Date: Mon, 11 Jul 2011 08:42:49 +0000 Subject: Update to support remote starts git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@1145068 13f79535-47bb-0310-9956-ffa450edef68 --- .../java/org/apache/tuscany/sca/shell/commands/Start.java | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'sca-java-2.x') diff --git a/sca-java-2.x/trunk/modules/shell/src/main/java/org/apache/tuscany/sca/shell/commands/Start.java b/sca-java-2.x/trunk/modules/shell/src/main/java/org/apache/tuscany/sca/shell/commands/Start.java index 4a9505bc9d..e6d6c04913 100644 --- a/sca-java-2.x/trunk/modules/shell/src/main/java/org/apache/tuscany/sca/shell/commands/Start.java +++ b/sca-java-2.x/trunk/modules/shell/src/main/java/org/apache/tuscany/sca/shell/commands/Start.java @@ -26,6 +26,7 @@ import org.apache.tuscany.sca.shell.Command; import org.apache.tuscany.sca.shell.Shell; import org.apache.tuscany.sca.shell.jline.CompositeURICompletor; import org.apache.tuscany.sca.shell.jline.ICURICompletor; +import org.apache.tuscany.sca.shell.jline.RemoteNodeCompletor; public class Start implements Command { @@ -42,7 +43,7 @@ public class Start implements Command { @Override public String getShortHelp() { - return "start "; + return "start "; } @Override @@ -58,22 +59,26 @@ public class Start implements Command { helpText.append(" Arguments:\n"); helpText.append(" curi - (required) the URI of an installed contribution\n"); helpText.append(" compositeUri - (required) the URI of a composite within the contribution to start\n"); + helpText.append(" remoteNode - (optional) the name of a remote node which should run the composite\n"); return helpText.toString(); } @Override public Completor[] getCompletors() { - return new Completor[]{new ICURICompletor(shell), new CompositeURICompletor(shell), new NullCompletor()}; + return new Completor[]{new ICURICompletor(shell), new CompositeURICompletor(shell), new RemoteNodeCompletor(shell), new NullCompletor()}; } @Override public boolean invoke(String[] args) throws Exception { - if (args.length != 2) { + if (args.length == 2) { + shell.getNode().startComposite(args[0], args[1]); + } else if (args.length == 3) { + shell.getNode().startComposite(args[0], args[1], args[2]); + } else { System.err.println("Wrong number of args"); System.err.println(getShortHelp()); return true; } - shell.getNode().startComposite(args[0], args[1]); return true; } -- cgit v1.2.3