diff options
author | antelder <antelder@13f79535-47bb-0310-9956-ffa450edef68> | 2011-05-11 14:42:50 +0000 |
---|---|---|
committer | antelder <antelder@13f79535-47bb-0310-9956-ffa450edef68> | 2011-05-11 14:42:50 +0000 |
commit | 069ff5365820c918eedfcb6aa943bf882dc77ac0 (patch) | |
tree | 71efc5fad47ec79abae2c6e2c94b0ab518565135 /sca-java-2.x/trunk/modules/shell/src/main | |
parent | e15a45f69dfd08de632c0262186f46222a59bb9d (diff) |
Update Shell installed and start commands to work with the latest Node/registry changes
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@1101898 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.java | 72 |
1 files changed, 33 insertions, 39 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 76f76f6d1b..66156ad4ac 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 @@ -209,31 +209,23 @@ public class Shell { }
boolean installed(final List<String> toks) {
- List<String> curis;
- if (toks.size() > 1) {
- curis = Arrays.asList(new String[] {toks.get(1)});
- } else {
- if (getNode() == null) {
- return true;
- }
- curis = getNode().getInstalledContributionURIs();
+ if (getNode() == null) {
+ return true;
}
- boolean full = false;
- for (String curi : curis) {
- out.println(" " + curi);
- if (full) {
+ if (toks.size() > 1) {
+ String curi = toks.get(1);
+ Contribution c = getNode().getInstalledContribution(toks.get(1));
+ if (c == null) {
+ out.println("Contribution " + curi + " not installed");
+ } else {
+ out.println("Contribution " + curi);
+ out.println(" URL: " + c.getLocation());
// TODO: add full detail view of contribution showing
- // uri, url, dependent cintrubutions, deployables, exports
- out.println(curi + " " + getNode().getInstalledContribution(curi).getLocation());
- Contribution c = getNode().getInstalledContribution(curi);
- List<String> deployeds = getNode().getStartedCompositeURIs(curi);
- for (Artifact a : c.getArtifacts()) {
- if (a.getModel() instanceof Composite) {
- Composite composite = (Composite)a.getModel();
- String running = deployeds.contains(composite.getURI()) ? "***running***" : "";
- out.println(" " + composite.getURI() + " " + composite.getName() + " " + running);
- }
- }
+ // uri, url, dependent contrubutions, deployables, exports
+ }
+ } else {
+ for (String curi : getNode().getInstalledContributionURIs()) {
+ out.println(" " + curi);
}
}
return true;
@@ -390,22 +382,24 @@ public class Shell { }
boolean start(String curi, String compositeURI) throws ActivationException, ValidationException, ContributionReadException {
- Contribution c = getNode().getInstalledContribution(curi);
- for (Artifact a : c.getArtifacts()) {
- if (compositeURI.equals(a.getURI())) {
- getNode().start(curi, compositeURI);
- return true;
- }
- }
- // external composite file ('composite by value')
- try {
- URL url = IOHelper.getLocationAsURL(compositeURI);
- InputStream is = IOHelper.openStream(url);
- BufferedReader br = new BufferedReader(new InputStreamReader(is, "UTF-8"));
- getNode().start(curi, br);
- } catch (Exception e) {
- System.out.println(e);
- }
+ getNode().start(curi, compositeURI);
+
+// Contribution c = getNode().getInstalledContribution(curi);
+// for (Artifact a : c.getArtifacts()) {
+// if (compositeURI.equals(a.getURI())) {
+// getNode().start(curi, compositeURI);
+// return true;
+// }
+// }
+// // external composite file ('composite by value')
+// try {
+// URL url = IOHelper.getLocationAsURL(compositeURI);
+// InputStream is = IOHelper.openStream(url);
+// BufferedReader br = new BufferedReader(new InputStreamReader(is, "UTF-8"));
+// getNode().start(curi, br);
+// } catch (Exception e) {
+// System.out.println(e);
+// }
return true;
}
|