You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tuscany.apache.org by an...@apache.org on 2010/07/05 22:04:07 UTC
svn commit: r960680 -
/tuscany/sca-java-2.x/trunk/modules/shell/src/main/java/org/apache/tuscany/sca/shell/Shell.java
Author: antelder
Date: Mon Jul 5 20:04:07 2010
New Revision: 960680
URL: http://svn.apache.org/viewvc?rev=960680&view=rev
Log:
Add installed command
Modified:
tuscany/sca-java-2.x/trunk/modules/shell/src/main/java/org/apache/tuscany/sca/shell/Shell.java
Modified: tuscany/sca-java-2.x/trunk/modules/shell/src/main/java/org/apache/tuscany/sca/shell/Shell.java
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/modules/shell/src/main/java/org/apache/tuscany/sca/shell/Shell.java?rev=960680&r1=960679&r2=960680&view=diff
==============================================================================
--- tuscany/sca-java-2.x/trunk/modules/shell/src/main/java/org/apache/tuscany/sca/shell/Shell.java (original)
+++ tuscany/sca-java-2.x/trunk/modules/shell/src/main/java/org/apache/tuscany/sca/shell/Shell.java Mon Jul 5 20:04:07 2010
@@ -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));
}};