summaryrefslogtreecommitdiffstats
path: root/branches/sca-java-2.0-M3/modules/node-launcher-equinox/src/main/java/org/apache/tuscany/sca/node/equinox/launcher/NodeLauncher.java
diff options
context:
space:
mode:
authorrfeng <rfeng@13f79535-47bb-0310-9956-ffa450edef68>2009-06-29 22:10:28 +0000
committerrfeng <rfeng@13f79535-47bb-0310-9956-ffa450edef68>2009-06-29 22:10:28 +0000
commit1fd00705939747143753aeae8c8aa084e3d9f800 (patch)
tree9ecb2c48a911665549388bbcba2069b6f020c53e /branches/sca-java-2.0-M3/modules/node-launcher-equinox/src/main/java/org/apache/tuscany/sca/node/equinox/launcher/NodeLauncher.java
parent1b4728bc676d02af0ddb68754167028cd5ab5773 (diff)
Merge changes from trunk to bring up the distributed osgi samples with Tuscany distribution
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@789466 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to '')
-rw-r--r--branches/sca-java-2.0-M3/modules/node-launcher-equinox/src/main/java/org/apache/tuscany/sca/node/equinox/launcher/NodeLauncher.java29
1 files changed, 25 insertions, 4 deletions
diff --git a/branches/sca-java-2.0-M3/modules/node-launcher-equinox/src/main/java/org/apache/tuscany/sca/node/equinox/launcher/NodeLauncher.java b/branches/sca-java-2.0-M3/modules/node-launcher-equinox/src/main/java/org/apache/tuscany/sca/node/equinox/launcher/NodeLauncher.java
index 08f962fb0a..79aedc81c4 100644
--- a/branches/sca-java-2.0-M3/modules/node-launcher-equinox/src/main/java/org/apache/tuscany/sca/node/equinox/launcher/NodeLauncher.java
+++ b/branches/sca-java-2.0-M3/modules/node-launcher-equinox/src/main/java/org/apache/tuscany/sca/node/equinox/launcher/NodeLauncher.java
@@ -35,15 +35,14 @@ import org.apache.commons.cli.HelpFormatter;
import org.apache.commons.cli.Option;
import org.apache.commons.cli.Options;
import org.apache.commons.cli.PosixParser;
-import org.osgi.framework.Bundle;
import org.osgi.framework.BundleContext;
-import org.osgi.framework.Constants;
/**
* A launcher for SCA nodes.
*
* Agruments:
* [-config <equinoxConfiguration>]: The configuration folder for Equinox
+ * [-bundles <osgiBundles>]: A list of bundles to be installed
* [-c <compositeURI>]: The composite URI
* [-t <ttl>]: Time to live in milliseconds before the node is started
* contribution1 ... contributionN: A list of contribution files or URLs
@@ -128,6 +127,7 @@ public class NodeLauncher {
if (cli.hasOption("config")) {
System.setProperty("osgi.configuration.area", cli.getOptionValue("config"));
}
+
while (true) {
if (cli.hasOption("node")) {
// Create a node from a configuration URI
@@ -139,10 +139,28 @@ public class NodeLauncher {
equinox = launcher.equinoxHost;
node = launcher.createNode(configurationURI);
- } else if (cli.hasOption("bundles")) {
+ }
+ else if (cli.hasOption("bundles")) {
+ /**
+ * osgi.bundles
+ * The comma-separated list of bundles which are automatically installed and optionally started once the system is up
+ * and running. Each entry is of the form:
+ * <URL | simple bundle location>[@ [<start-level>] [":start"]]
+ * If the start-level (>0 integer) is omitted then the framework will use the default start level for the bundle.
+ * If the "start" tag is added then the bundle will be marked as started after being installed. Simple bundle locations are
+ * interepreted as relative to the framework's parent directory. The start-level indicates the OSGi start level at which the
+ * bundle should run. If this value is not set, the system computes an appropriate default.
+ */
+ String bundles = cli.getOptionValue("bundles");
+ if (bundles != null) {
+ System.setProperty("osgi.bundles", cli.getOptionValue("bundles"));
+ }
+
// Create a node launcher
NodeLauncher launcher = newInstance();
equinox = launcher.equinoxHost;
+
+ /*
List<String> bundleFiles = cli.getArgList();
for (String bf : bundleFiles) {
File f = new File(bf);
@@ -159,8 +177,10 @@ public class NodeLauncher {
// logger.log(Level.SEVERE, e.getMessage(), e);
}
}
+ */
- } else {
+ }
+ else {
// Create a node from a composite URI and a contribution location
String compositeURI = cli.getOptionValue("composite");
List<String> contribs = cli.getArgList();
@@ -185,6 +205,7 @@ public class NodeLauncher {
formatter.printHelp("java " + NodeLauncher.class.getName()
+ " [-config <equinoxConfiguration>]"
+ " [-c <compositeURI>]"
+ + " [-b <bundles>]"
+ " [-t <ttl>]"
+ " contribution1 ... contributionN", options);
return;