From bd0decac659e7675f388d79fcdf0e2884ab7a96d Mon Sep 17 00:00:00 2001 From: rfeng Date: Mon, 26 Oct 2009 17:01:29 +0000 Subject: Improve the node launcher so that it can take more than one contributions and not specify composite, for example, - c1.jar c2.jar git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@829862 13f79535-47bb-0310-9956-ffa450edef68 --- .../apache/tuscany/sca/node/launcher/NodeLauncher.java | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) (limited to 'branches/sca-java-1.x/modules') diff --git a/branches/sca-java-1.x/modules/node-launcher/src/main/java/org/apache/tuscany/sca/node/launcher/NodeLauncher.java b/branches/sca-java-1.x/modules/node-launcher/src/main/java/org/apache/tuscany/sca/node/launcher/NodeLauncher.java index be9bdb15c4..74d47ceb55 100644 --- a/branches/sca-java-1.x/modules/node-launcher/src/main/java/org/apache/tuscany/sca/node/launcher/NodeLauncher.java +++ b/branches/sca-java-1.x/modules/node-launcher/src/main/java/org/apache/tuscany/sca/node/launcher/NodeLauncher.java @@ -125,13 +125,21 @@ public class NodeLauncher { logger.info("SCA Node configuration: " + configurationURI); node = launcher.createNodeFromURL(configurationURI); } else { - + // Create a node from a composite URI and a contribution location String compositeURI = args[0]; - String contributionLocation = args[1]; - logger.info("SCA composite: " + compositeURI); - logger.info("SCA contribution: " + contributionLocation); - node = launcher.createNode(compositeURI, new Contribution("default", contributionLocation)); + if ("-".equals(compositeURI)) { + compositeURI = null; + } else { + logger.info("SCA composite: " + compositeURI); + } + Contribution contributions[] = new Contribution[args.length - 1]; + for (int i = 1; i < args.length; i++) { + String contributionLocation = args[i]; + logger.info("SCA contribution: " + contributionLocation); + contributions[i - 1] = new Contribution("contribution" + (i - 1), contributionLocation); + } + node = launcher.createNode(compositeURI, contributions); } // Start the node -- cgit v1.2.3