From 1fd00705939747143753aeae8c8aa084e3d9f800 Mon Sep 17 00:00:00 2001 From: rfeng Date: Mon, 29 Jun 2009 22:10:28 +0000 Subject: 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 --- .../sca/node/equinox/launcher/NodeLauncher.java | 29 +++++++++++++++++++--- 1 file changed, 25 insertions(+), 4 deletions(-) (limited to 'branches/sca-java-2.0-M3/modules/node-launcher-equinox/src/main/java/org/apache/tuscany/sca/node/equinox/launcher/NodeLauncher.java') 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 ]: The configuration folder for Equinox + * [-bundles ]: A list of bundles to be installed * [-c ]: The composite URI * [-t ]: 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: + * [@ [] [":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 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 contribs = cli.getArgList(); @@ -185,6 +205,7 @@ public class NodeLauncher { formatter.printHelp("java " + NodeLauncher.class.getName() + " [-config ]" + " [-c ]" + + " [-b ]" + " [-t ]" + " contribution1 ... contributionN", options); return; -- cgit v1.2.3