From 43581b0d383083350dcbf58cba22875916ff6731 Mon Sep 17 00:00:00 2001 From: antelder Date: Wed, 7 Jul 2010 09:25:49 +0000 Subject: Update installed command to show all composites in a contribution with the status command showing the deployed composites git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@961319 13f79535-47bb-0310-9956-ffa450edef68 --- .../java/org/apache/tuscany/sca/shell/Shell.java | 33 +++++++++++----------- 1 file changed, 16 insertions(+), 17 deletions(-) (limited to 'sca-java-2.x/trunk/modules/shell/src') 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 dc4b790a49..c94a2f19fe 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 @@ -139,17 +139,25 @@ public class Shell { for (String curi : curis) { out.println(curi + " " + node.getInstalledContribution(curi).getLocation()); Contribution c = node.getInstalledContribution(curi); - for (String dcuri : node.getDeployedCompostes(curi)) { - for (Artifact a : c.getArtifacts()) { - if (dcuri.equals(a.getURI())) { - out.println(" " + dcuri + " " + ((Composite)a.getModel()).getName()); - break; - } + for (Artifact a : c.getArtifacts()) { + if (a.getModel() instanceof Composite) { + Composite composite = (Composite) a.getModel(); + out.println(" " + composite.getURI() + " " + composite.getName()); } } } return true; } + boolean listComposites(final String curi) { + Contribution c = node.getInstalledContribution(curi); + for (Artifact a : c.getArtifacts()) { + if (a.getModel() instanceof Composite) { + out.println(((Composite)a.getModel()).getName()); + } + } + return true; + } + private String getDefaultURI(String contributionURL) { int lastDot = contributionURL.lastIndexOf('.'); @@ -186,16 +194,6 @@ public class Shell { return true; } - boolean listComposites(final String curi) { - Contribution c = node.getInstalledContribution(curi); - for (Artifact a : c.getArtifacts()) { - if (a.getModel() instanceof Composite) { - out.println(((Composite)a.getModel()).getName()); - } - } - return true; - } - public boolean stop(List toks) throws ActivationException { if (toks == null || toks.size() < 2) { node.stop(); @@ -449,7 +447,8 @@ public class Shell { out.println(" installed []"); out.println(); out.println(" Shows information about the contributions installed on this node,"); - out.println(" including the contribution URI and location along with the URI and QName of any deployed composites"); + out.println(" including the contribution URI and location along with the URI"); + out.println(" and QName of any composites within the contribution"); out.println(); out.println(" Arguments:"); out.println(" contributionURI - (optional) the URI of an installed contribution"); -- cgit v1.2.3