diff options
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 | 27 |
1 files changed, 26 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 de83eae259..7408778f89 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 @@ -56,7 +56,7 @@ public class Shell { private boolean useJline;
final List<String> history = new ArrayList<String>();
static final String[] COMMANDS = new String[] {"addDeploymentComposite", "addToDomainLevelComposite", "help",
- "install", "listDeployedCompostes", "listInstalledContributions",
+ "install", "installed", "listDeployedCompostes", "listInstalledContributions",
"printDomainLevelComposite", "removeFromDomainLevelComposite",
"remove", "start", "status", "stop"};
@@ -102,6 +102,28 @@ public class Shell { return true;
}
+ boolean installed(final List<String> toks) {
+ List<String> curis;
+ if (toks.size() > 1) {
+ curis = Arrays.asList(new String[]{toks.get(1)});
+ } else {
+ curis =node.getInstalledContributions();
+ }
+ 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;
+ }
+ }
+ }
+ }
+ return true;
+ }
+
private String getDefaultURI(String contributionURL) {
int lastDot = contributionURL.lastIndexOf('.');
int lastSep = contributionURL.lastIndexOf("/");
@@ -269,6 +291,9 @@ public class Shell { if (op.equals("install")) return new Callable<Boolean>() { public Boolean call() throws Exception {
return install(toks.get(1), toks);
}};
+ if (op.equals("installed")) return new Callable<Boolean>() { public Boolean call() throws Exception {
+ return installed(toks);
+ }};
if (op.equals("listDeployedCompostes")) return new Callable<Boolean>() { public Boolean call() throws Exception {
return listDeployedCompostes(toks.get(1));
}};
|