summaryrefslogtreecommitdiffstats
path: root/java/sca/modules
diff options
context:
space:
mode:
Diffstat (limited to 'java/sca/modules')
-rw-r--r--java/sca/modules/node-launcher-osgi/src/main/java/org/apache/tuscany/sca/node/osgi/launcher/NodeLauncher.java19
-rw-r--r--java/sca/modules/node-launcher/src/main/java/org/apache/tuscany/sca/node/launcher/NodeLauncher.java19
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 {