summaryrefslogtreecommitdiffstats
path: root/java/sca/modules
diff options
context:
space:
mode:
authorrfeng <rfeng@13f79535-47bb-0310-9956-ffa450edef68>2009-06-23 22:51:36 +0000
committerrfeng <rfeng@13f79535-47bb-0310-9956-ffa450edef68>2009-06-23 22:51:36 +0000
commit7e0533543131e4171105e3bec5fae7cbabd2e93a (patch)
treed8e42fbac3b1c5afdae8dc356c3f891463243c9a /java/sca/modules
parent90ba7b1a18706b434520d531358619438a43b4f0 (diff)
Check the existence of OSGI-INF/sca/bundle.composite for SCA bundles
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@787866 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'java/sca/modules')
-rw-r--r--java/sca/modules/node-impl-osgi/src/main/java/org/apache/tuscany/sca/node/osgi/impl/NodeManager.java21
-rw-r--r--java/sca/modules/node-launcher-equinox/src/main/java/org/apache/tuscany/sca/node/equinox/launcher/NodeLauncher.java35
2 files changed, 38 insertions, 18 deletions
diff --git a/java/sca/modules/node-impl-osgi/src/main/java/org/apache/tuscany/sca/node/osgi/impl/NodeManager.java b/java/sca/modules/node-impl-osgi/src/main/java/org/apache/tuscany/sca/node/osgi/impl/NodeManager.java
index e597d62ef0..3f71117c1a 100644
--- a/java/sca/modules/node-impl-osgi/src/main/java/org/apache/tuscany/sca/node/osgi/impl/NodeManager.java
+++ b/java/sca/modules/node-impl-osgi/src/main/java/org/apache/tuscany/sca/node/osgi/impl/NodeManager.java
@@ -19,8 +19,8 @@
package org.apache.tuscany.sca.node.osgi.impl;
+import java.net.URL;
import java.util.Dictionary;
-import java.util.Enumeration;
import java.util.logging.Level;
import java.util.logging.Logger;
@@ -68,12 +68,27 @@ public class NodeManager implements SynchronousBundleListener, ServiceListener {
if (headers.get("SCA-Composite") != null) {
return true;
}
- Enumeration<?> entries = bundle.findEntries("OSGI-INF/sca", "*.composite", false);
- if (entries != null && entries.hasMoreElements()) {
+
+ URL bundleComposite = bundle.getResource("OSGI-INF/sca/bundle.composite");
+ if (bundleComposite != null) {
return true;
}
+ /* FIXME: What if there is a META-INF/sca-contribution.xml? There are two cases:
+ * 1. The file contains deployable elements
+ * 2. The file doesn't contain deployable elements
+ */
+
+ /*
+ * FIXME: Do we want to use all of the .composite files under OSGI-INF/sca?
+ */
+
/*
+ Enumeration<?> entries = bundle.findEntries("OSGI-INF/sca", "bundle.composite", false);
+ if (entries != null && entries.hasMoreElements()) {
+ return true;
+ }
+
// OSGi Declarative Services
if (headers.get("Service-Component") != null) {
return true;
diff --git a/java/sca/modules/node-launcher-equinox/src/main/java/org/apache/tuscany/sca/node/equinox/launcher/NodeLauncher.java b/java/sca/modules/node-launcher-equinox/src/main/java/org/apache/tuscany/sca/node/equinox/launcher/NodeLauncher.java
index e2de1b5246..79aedc81c4 100644
--- a/java/sca/modules/node-launcher-equinox/src/main/java/org/apache/tuscany/sca/node/equinox/launcher/NodeLauncher.java
+++ b/java/sca/modules/node-launcher-equinox/src/main/java/org/apache/tuscany/sca/node/equinox/launcher/NodeLauncher.java
@@ -128,19 +128,6 @@ public class NodeLauncher {
System.setProperty("osgi.configuration.area", cli.getOptionValue("config"));
}
- // 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.
- */
- // System.setProperty("osgi.bundles", cli.getOptionValue("bundles"));
- // }
while (true) {
if (cli.hasOption("node")) {
// Create a node from a configuration URI
@@ -153,11 +140,27 @@ public class NodeLauncher {
node = launcher.createNode(configurationURI);
}
- /*
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);
@@ -174,8 +177,9 @@ public class NodeLauncher {
// logger.log(Level.SEVERE, e.getMessage(), e);
}
}
+ */
- } */
+ }
else {
// Create a node from a composite URI and a contribution location
String compositeURI = cli.getOptionValue("composite");
@@ -201,6 +205,7 @@ public class NodeLauncher {
formatter.printHelp("java " + NodeLauncher.class.getName()
+ " [-config <equinoxConfiguration>]"
+ " [-c <compositeURI>]"
+ + " [-b <bundles>]"
+ " [-t <ttl>]"
+ " contribution1 ... contributionN", options);
return;