diff options
author | antelder <antelder@13f79535-47bb-0310-9956-ffa450edef68> | 2010-08-08 09:28:58 +0000 |
---|---|---|
committer | antelder <antelder@13f79535-47bb-0310-9956-ffa450edef68> | 2010-08-08 09:28:58 +0000 |
commit | 9089224b14e651e45f2cae5d9094d51d376d5974 (patch) | |
tree | 49d2acd438ec5287fbe78972b0e98526193f90d9 /sca-java-2.x/trunk/modules/shell/src/main/java/org/apache/tuscany/sca | |
parent | 38d57f547fb803911499707e6f06a7e20b3ea44b (diff) |
Change start command to use -duris to match the install command
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@983367 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'sca-java-2.x/trunk/modules/shell/src/main/java/org/apache/tuscany/sca')
-rw-r--r-- | sca-java-2.x/trunk/modules/shell/src/main/java/org/apache/tuscany/sca/shell/Shell.java | 37 |
1 files changed, 27 insertions, 10 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 decf3d38b0..f06a17414e 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 @@ -211,7 +211,11 @@ public class Shell { if (standaloneNodes.containsKey(curi)) {
standaloneNodes.remove(curi).stop();
} else if (nodes.containsKey(curi)) {
- nodes.remove(curi).stop();
+ Node n = nodes.remove(curi);
+ n.stop();
+ if (n.getDomainName().equals(currentDomain)) {
+ currentDomain = "";
+ }
} else {
for (String compositeURI : getNode().getDeployedCompostes(curi)) {
getNode().removeFromDomainLevelComposite(curi, compositeURI);
@@ -399,14 +403,26 @@ public class Shell { if (op.equalsIgnoreCase("start"))
return new Callable<Boolean>() {
public Boolean call() throws Exception {
- if (currentDomain.length() < 1) {
- if (toks.size() == 4) {
- return start(toks.get(1), toks.get(2), toks.get(3));
+ if (currentDomain.length() > 0) {
+ return start(toks.get(1), toks.get(2));
+ } else {
+ String[] duris = null;
+ if (toks.contains("-duris")) {
+ int i = toks.indexOf("-duris");
+ duris = toks.get(i + 1).split(",");
+ toks.remove(i); toks.remove(i+1);
+ }
+ String name = toks.get(1);
+ String contributionURL;
+ String compositeURI;
+ if (toks.size() > 3) {
+ compositeURI = toks.get(2);
+ contributionURL = toks.get(3);
} else {
- return start(toks.get(1), null, toks.get(2));
+ compositeURI = null;
+ contributionURL = toks.get(2);
}
- } else {
- return start(toks.get(1), toks.get(2));
+ return start(name, compositeURI, contributionURL, duris);
}
}
};
@@ -501,7 +517,7 @@ public class Shell { out.println(" remove <contributionURI>");
out.println(" printDomainLevelComposite");
out.println(" start <curi> <compositeUri>|<contentURL>");
- out.println(" start <name> [<compositeUri>] <contributionURL> [<dependentContributionURLs>]");
+ out.println(" start <name> [<compositeUri>] <contributionURL> [-duris <uri,uri,...>]");
out.println(" status [<curi> <compositeUri>]");
out.println(" stop [<curi> <compositeUri>]");
out.println(" bye");
@@ -584,7 +600,7 @@ public class Shell { void helpStart() {
out.println(" start <curi> <compositeUri>|<contentURL>");
- out.println(" start <name> [<compositeUri>] <contributionURL> [<dependentContributionURLs>]");
+ out.println(" start <name> [<compositeUri>] <contributionURL> [-duris <uri,uri,...>]");
out.println();
out.println(" Starts a composite.");
out.println(" The composite is added to the domain composite with semantics that correspond to the domain-level");
@@ -602,7 +618,8 @@ public class Shell { out.println(" name - (required) a name for the started composite/contribution");
out.println(" compositeUri - (optional) the URI of a composite within the contribution");
out.println(" contributionURL - (required) the URL to the contribution");
- out.println(" dependentContributionURLs - (optional) URLs to any dependents of the contribution");
+ out.println(" -duris <uri,uri,...> - (optional) specifies the URIs of contributions that are used to resolve the");
+ out.println(" dependencies of the root contribution and other dependent contributions.");
}
void helpStatus() {
|