diff options
author | antelder <antelder@13f79535-47bb-0310-9956-ffa450edef68> | 2011-07-11 08:42:49 +0000 |
---|---|---|
committer | antelder <antelder@13f79535-47bb-0310-9956-ffa450edef68> | 2011-07-11 08:42:49 +0000 |
commit | d8eabd6d1abf0be346f26b91cd82ee5ac106bf06 (patch) | |
tree | d319a1ed12afd1bc2962b58869e9cf48d3280690 /sca-java-2.x/trunk/modules/shell/src | |
parent | 611747a6fea6b03c16d955af639d101319cf0b7f (diff) |
Update to support remote starts
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@1145068 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'sca-java-2.x/trunk/modules/shell/src')
-rw-r--r-- | sca-java-2.x/trunk/modules/shell/src/main/java/org/apache/tuscany/sca/shell/commands/Start.java | 13 |
1 files changed, 9 insertions, 4 deletions
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 <curi> <compositeUri>";
+ return "start <curi> <compositeUri> <remoteNode>";
}
@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;
}
|