summaryrefslogtreecommitdiffstats
path: root/sca-java-2.x/trunk/modules/shell/src/main
diff options
context:
space:
mode:
authorantelder <antelder@13f79535-47bb-0310-9956-ffa450edef68>2010-07-06 11:54:14 +0000
committerantelder <antelder@13f79535-47bb-0310-9956-ffa450edef68>2010-07-06 11:54:14 +0000
commit3b6dafef3fcd13f20d653d161aef69c0bf0aa6bf (patch)
tree2bcb5932e4491f8f75efbab7cb8a641c4ae838a6 /sca-java-2.x/trunk/modules/shell/src/main
parent4b05b5d35a0757ba9815897c18fba1e563fdca2a (diff)
Update to configure the registry from the domainURI
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@960881 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'sca-java-2.x/trunk/modules/shell/src/main')
-rw-r--r--sca-java-2.x/trunk/modules/shell/src/main/java/org/apache/tuscany/sca/shell/Shell.java17
1 files changed, 14 insertions, 3 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 8543ea1b14..d475af6a89 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
@@ -55,18 +55,28 @@ public class Shell {
Node node;
private boolean useJline;
final List<String> history = new ArrayList<String>();
+ private NodeFactory factory;
static final String[] COMMANDS = new String[] {"addDeploymentComposite", "addToDomainLevelComposite", "help",
"install", "installed", "listDeployedCompostes", "listInstalledContributions",
"printDomainLevelComposite", "removeFromDomainLevelComposite",
"remove", "start", "status", "stop"};
public static void main(final String[] args) throws Exception {
- boolean useJline = !Arrays.asList(args).contains("-nojline");
- new Shell(args.length > 0 ? args[0] : "default", useJline).run();
+ boolean useJline = true;
+ String domainURI = "default";
+ for (String s : args) {
+ if ("-nojline".equals(s)) {
+ useJline = false;
+ } else {
+ domainURI = s;
+ }
+ }
+ new Shell(domainURI, useJline).run();
}
public Shell(String domainURI, boolean useJLine) {
- this.node = NodeFactory.newInstance().createNode(domainURI);
+ this.factory = NodeFactory.newInstance();
+ this.node = factory.createNode(domainURI);
this.useJline = useJLine;
}
@@ -212,6 +222,7 @@ public class Shell {
boolean stop(List<String> toks) throws ActivationException {
if (toks == null || toks.size() < 2) {
node.stop();
+ factory.stop();
return false;
}
String curi = toks.get(1);