diff options
author | jsdelfino <jsdelfino@13f79535-47bb-0310-9956-ffa450edef68> | 2008-08-25 05:41:04 +0000 |
---|---|---|
committer | jsdelfino <jsdelfino@13f79535-47bb-0310-9956-ffa450edef68> | 2008-08-25 05:41:04 +0000 |
commit | 902d1cd1fe1dec937f578b7a4cc3c94fda2b52ff (patch) | |
tree | 4e181f36420612a2a36f95e32d4f0a1794354b3e /java/sca/modules | |
parent | 08288aa14dcda71549a0ad981a95beba01df1847 (diff) |
Added support for two parameters to NodeLauncher: composite URI and contribution location.
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@688623 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'java/sca/modules')
2 files changed, 32 insertions, 6 deletions
diff --git a/java/sca/modules/node-launcher-osgi/src/main/java/org/apache/tuscany/sca/node/osgi/launcher/NodeLauncher.java b/java/sca/modules/node-launcher-osgi/src/main/java/org/apache/tuscany/sca/node/osgi/launcher/NodeLauncher.java index 917838d521..c4c4c04eb8 100644 --- a/java/sca/modules/node-launcher-osgi/src/main/java/org/apache/tuscany/sca/node/osgi/launcher/NodeLauncher.java +++ b/java/sca/modules/node-launcher-osgi/src/main/java/org/apache/tuscany/sca/node/osgi/launcher/NodeLauncher.java @@ -113,9 +113,22 @@ public class NodeLauncher { // Create a node NodeLauncher launcher = newInstance(); - String configurationURI = args[0]; - logger.info("SCA Node configuration: " + configurationURI); - Object node = launcher.createNodeFromURL(configurationURI); + Object node; + if (args.length ==1) { + + // Create from a configuration URI + String configurationURI = args[0]; + logger.info("SCA Node configuration: " + configurationURI); + node = launcher.createNodeFromURL(configurationURI); + } else { + + // Create 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)); + } // Start the node try { diff --git a/java/sca/modules/node-launcher/src/main/java/org/apache/tuscany/sca/node/launcher/NodeLauncher.java b/java/sca/modules/node-launcher/src/main/java/org/apache/tuscany/sca/node/launcher/NodeLauncher.java index 44a5430976..2171f5d597 100644 --- a/java/sca/modules/node-launcher/src/main/java/org/apache/tuscany/sca/node/launcher/NodeLauncher.java +++ b/java/sca/modules/node-launcher/src/main/java/org/apache/tuscany/sca/node/launcher/NodeLauncher.java @@ -113,9 +113,22 @@ public class NodeLauncher { // Create a node NodeLauncher launcher = newInstance(); - String configurationURI = args[0]; - logger.info("SCA Node configuration: " + configurationURI); - Object node = launcher.createNodeFromURL(configurationURI); + Object node; + if (args.length ==1) { + + // Create from a configuration URI + String configurationURI = args[0]; + logger.info("SCA Node configuration: " + configurationURI); + node = launcher.createNodeFromURL(configurationURI); + } else { + + // Create 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)); + } // Start the node try { |