summaryrefslogtreecommitdiffstats
path: root/sca-java-2.x/trunk/modules/shell/src/main/java/org/apache
diff options
context:
space:
mode:
authorantelder <antelder@13f79535-47bb-0310-9956-ffa450edef68>2011-05-19 12:21:55 +0000
committerantelder <antelder@13f79535-47bb-0310-9956-ffa450edef68>2011-05-19 12:21:55 +0000
commitc737cb99bcd1c364fe5f7f66c3662dee75ea7ae9 (patch)
tree85aa143c894131b294ce2f22c1ab722ab93bba6f /sca-java-2.x/trunk/modules/shell/src/main/java/org/apache
parenta5707c170d3ce4aaecd9956cb1935305709b91d1 (diff)
Add a way to run commands on remote nodes and add Node API and Shell commands to start and stop composites on remote nodes. Initial code so a little prototypy but it does work so committing it now for review
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@1124705 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'sca-java-2.x/trunk/modules/shell/src/main/java/org/apache')
-rw-r--r--sca-java-2.x/trunk/modules/shell/src/main/java/org/apache/tuscany/sca/shell/Shell.java25
1 files changed, 24 insertions, 1 deletions
diff --git a/sca-java-2.x/trunk/modules/shell/src/main/java/org/apache/tuscany/sca/shell/Shell.java b/sca-java-2.x/trunk/modules/shell/src/main/java/org/apache/tuscany/sca/shell/Shell.java
index 2403cab294..a407f3e105 100644
--- a/sca-java-2.x/trunk/modules/shell/src/main/java/org/apache/tuscany/sca/shell/Shell.java
+++ b/sca-java-2.x/trunk/modules/shell/src/main/java/org/apache/tuscany/sca/shell/Shell.java
@@ -73,7 +73,7 @@ public class Shell {
private Map<String, Node> nodes = new HashMap<String, Node>();
public static final String[] COMMANDS = new String[] {"bye", "domain", "domains", "domainComposite", "help", "install", "installed", "invoke",
- "load", "members", "remove", "run", "save", "services", "start", "started", "stop"};
+ "load", "members", "remoteStart", "remoteStop", "remove", "run", "save", "services", "start", "started", "stop"};
public static void main(final String[] args) throws Exception {
boolean useJline = true;
@@ -444,6 +444,17 @@ public class Shell {
return true;
}
+ boolean remoteStart(final List<String> toks) {
+ String response = getNode().remoteStart(toks.get(1), toks.get(2), toks.get(3));
+ out.println(response);
+ return true;
+ }
+ boolean remoteStop(final List<String> toks) {
+ String response = getNode().remoteStop(toks.get(1), toks.get(2), toks.get(3));
+ out.println(response);
+ return true;
+ }
+
boolean started(final List<String> toks) {
if (standaloneNodes.size() > 0) {
out.println("Standalone Nodes:");
@@ -662,6 +673,18 @@ public class Shell {
return bye();
}
};
+ if (op.equalsIgnoreCase("remoteStart"))
+ return new Callable<Boolean>() {
+ public Boolean call() throws Exception {
+ return remoteStart(toks);
+ }
+ };
+ if (op.equalsIgnoreCase("remoteStop"))
+ return new Callable<Boolean>() {
+ public Boolean call() throws Exception {
+ return remoteStop(toks);
+ }
+ };
if (op.equalsIgnoreCase("start"))
return new Callable<Boolean>() {
public Boolean call() throws Exception {