summaryrefslogtreecommitdiffstats
path: root/java/sca/modules/node-launcher-equinox/src
diff options
context:
space:
mode:
authorrfeng <rfeng@13f79535-47bb-0310-9956-ffa450edef68>2008-09-03 00:48:29 +0000
committerrfeng <rfeng@13f79535-47bb-0310-9956-ffa450edef68>2008-09-03 00:48:29 +0000
commitcc8967d7638d980d02cb44be647f76d979b02071 (patch)
tree7983a7c40061e5c9bde526a64d6d749f4b49886d /java/sca/modules/node-launcher-equinox/src
parent19bc9a9877d710e9e85385915e4628df876af4db (diff)
Make a few fields non-static to ServiceDiscovery
Enable Equinox launcher to load tuscany jars git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@691447 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'java/sca/modules/node-launcher-equinox/src')
-rw-r--r--java/sca/modules/node-launcher-equinox/src/main/java/org/apache/tuscany/sca/node/equinox/launcher/EquinoxOSGiHost.java15
-rw-r--r--java/sca/modules/node-launcher-equinox/src/main/java/org/apache/tuscany/sca/node/equinox/launcher/LauncherBundleActivator.java9
2 files changed, 20 insertions, 4 deletions
diff --git a/java/sca/modules/node-launcher-equinox/src/main/java/org/apache/tuscany/sca/node/equinox/launcher/EquinoxOSGiHost.java b/java/sca/modules/node-launcher-equinox/src/main/java/org/apache/tuscany/sca/node/equinox/launcher/EquinoxOSGiHost.java
index 46b1ebb808..effe9b298d 100644
--- a/java/sca/modules/node-launcher-equinox/src/main/java/org/apache/tuscany/sca/node/equinox/launcher/EquinoxOSGiHost.java
+++ b/java/sca/modules/node-launcher-equinox/src/main/java/org/apache/tuscany/sca/node/equinox/launcher/EquinoxOSGiHost.java
@@ -31,7 +31,9 @@ import org.osgi.framework.BundleContext;
*
*/
public class EquinoxOSGiHost implements OSGiHost {
-
+ private LauncherBundleActivator activator = new LauncherBundleActivator();
+ private BundleContext context;
+
private final static String systemPackages =
"org.osgi.framework; version=1.3.0," + "org.osgi.service.packageadmin; version=1.2.0, "
+ "org.osgi.service.startlevel; version=1.0.0, "
@@ -92,15 +94,22 @@ public class EquinoxOSGiHost implements OSGiHost {
String args[] = {};
Map<Object, Object> props = new HashMap<Object, Object>();
props.put("org.osgi.framework.system.packages", systemPackages);
+ // Set the extension bundle
+ // props.put("osgi.framework.extensions", "org.apache.tuscany.sca.extensibility.equinox");
props.put(EclipseStarter.PROP_CLEAN, "true");
props.put(LocationManager.PROP_INSTANCE_AREA, new File("target/workspace").toURI().toString());
- props.put(LocationManager.PROP_INSTALL_AREA, new File("target/eclipse").toURI().toString());
+ props.put(LocationManager.PROP_INSTALL_AREA, new File("target/eclipse/install").toURI().toString());
+ props.put(LocationManager.PROP_CONFIG_AREA, new File("target/eclipse/config").toURI().toString());
+ props.put(LocationManager.PROP_USER_AREA, new File("target/eclipse/user").toURI().toString());
+
EclipseStarter.setInitialProperties(props);
- BundleContext context = EclipseStarter.startup(args, null);
+ context = EclipseStarter.startup(args, null);
+ activator.start(context);
return context;
}
private void shutdown() throws Exception {
+ activator.stop(context);
EclipseStarter.shutdown();
}
diff --git a/java/sca/modules/node-launcher-equinox/src/main/java/org/apache/tuscany/sca/node/equinox/launcher/LauncherBundleActivator.java b/java/sca/modules/node-launcher-equinox/src/main/java/org/apache/tuscany/sca/node/equinox/launcher/LauncherBundleActivator.java
index 2a5af89171..778eb0f690 100644
--- a/java/sca/modules/node-launcher-equinox/src/main/java/org/apache/tuscany/sca/node/equinox/launcher/LauncherBundleActivator.java
+++ b/java/sca/modules/node-launcher-equinox/src/main/java/org/apache/tuscany/sca/node/equinox/launcher/LauncherBundleActivator.java
@@ -142,7 +142,8 @@ public class LauncherBundleActivator implements BundleActivator, Constants, Bund
for (URL url : urls) {
File file = new File(url.toURI());
- if (file.getName().startsWith("org.apache.felix.") || file.getName().startsWith("org.osgi.")) {
+ if (file.getName().startsWith("org.apache.felix.") || file.getName().startsWith("osgi-")
+ || file.getName().startsWith("org.osgi.")) {
continue;
}
try {
@@ -205,6 +206,12 @@ public class LauncherBundleActivator implements BundleActivator, Constants, Bund
}
String symbolicName = manifest.getMainAttributes().getValue(BUNDLE_SYMBOLICNAME);
+ if (symbolicName != null) {
+ int index = symbolicName.indexOf(';');
+ if (index != -1) {
+ symbolicName = symbolicName.substring(0, index);
+ }
+ }
String version = manifest.getMainAttributes().getValue(BUNDLE_VERSION);
Bundle bundle = findBundle(bundleContext, symbolicName, version);
if (bundle != null) {