summaryrefslogtreecommitdiffstats
path: root/java/sca/modules/node-launcher-equinox
diff options
context:
space:
mode:
authorjsdelfino <jsdelfino@13f79535-47bb-0310-9956-ffa450edef68>2008-09-08 03:16:34 +0000
committerjsdelfino <jsdelfino@13f79535-47bb-0310-9956-ffa450edef68>2008-09-08 03:16:34 +0000
commitfe56d619a6e9c5a5a3ed26d61591fd4fb89b4c1f (patch)
treebc63c578f6509d4cf488da99415de6bf091e577b /java/sca/modules/node-launcher-equinox
parentd6293beb6665b69b91241907d4e735f7d2cc0f26 (diff)
Simplified a bit the service discovery implementation. Some code cleanup in node-launcher-equinox. Started to remove dependencies on a particular setting of the Thread Context ClassLoader.
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@692989 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'java/sca/modules/node-launcher-equinox')
-rw-r--r--java/sca/modules/node-launcher-equinox/src/main/java/org/apache/tuscany/sca/node/equinox/launcher/JarFileFinder.java5
-rw-r--r--java/sca/modules/node-launcher-equinox/src/main/java/org/apache/tuscany/sca/node/equinox/launcher/LibrariesBundleFileFactoryHook.java1
-rw-r--r--java/sca/modules/node-launcher-equinox/src/main/java/org/apache/tuscany/sca/node/equinox/launcher/NodeLauncherUtil.java15
3 files changed, 13 insertions, 8 deletions
diff --git a/java/sca/modules/node-launcher-equinox/src/main/java/org/apache/tuscany/sca/node/equinox/launcher/JarFileFinder.java b/java/sca/modules/node-launcher-equinox/src/main/java/org/apache/tuscany/sca/node/equinox/launcher/JarFileFinder.java
index 476c65958e..0f595df758 100644
--- a/java/sca/modules/node-launcher-equinox/src/main/java/org/apache/tuscany/sca/node/equinox/launcher/JarFileFinder.java
+++ b/java/sca/modules/node-launcher-equinox/src/main/java/org/apache/tuscany/sca/node/equinox/launcher/JarFileFinder.java
@@ -277,10 +277,7 @@ public class JarFileFinder {
*
* @return
*/
- public static List<URL> getClassPathEntries(ClassLoader classLoader, boolean recursive) {
- if (classLoader == null) {
- classLoader = Thread.currentThread().getContextClassLoader();
- }
+ static List<URL> getClassPathEntries(ClassLoader classLoader, boolean recursive) {
Set<URL> entries = new HashSet<URL>();
list(entries, classLoader, recursive);
return new ArrayList<URL>(entries);
diff --git a/java/sca/modules/node-launcher-equinox/src/main/java/org/apache/tuscany/sca/node/equinox/launcher/LibrariesBundleFileFactoryHook.java b/java/sca/modules/node-launcher-equinox/src/main/java/org/apache/tuscany/sca/node/equinox/launcher/LibrariesBundleFileFactoryHook.java
index 2713dd7f52..db0524a7d7 100644
--- a/java/sca/modules/node-launcher-equinox/src/main/java/org/apache/tuscany/sca/node/equinox/launcher/LibrariesBundleFileFactoryHook.java
+++ b/java/sca/modules/node-launcher-equinox/src/main/java/org/apache/tuscany/sca/node/equinox/launcher/LibrariesBundleFileFactoryHook.java
@@ -64,6 +64,7 @@ public class LibrariesBundleFileFactoryHook implements org.eclipse.osgi.baseadap
@Override
public InputStream getInputStream() throws IOException {
+ System.out.println(new String(bytes));
return new ByteArrayInputStream(bytes);
}
diff --git a/java/sca/modules/node-launcher-equinox/src/main/java/org/apache/tuscany/sca/node/equinox/launcher/NodeLauncherUtil.java b/java/sca/modules/node-launcher-equinox/src/main/java/org/apache/tuscany/sca/node/equinox/launcher/NodeLauncherUtil.java
index f4c4f1369c..c058589433 100644
--- a/java/sca/modules/node-launcher-equinox/src/main/java/org/apache/tuscany/sca/node/equinox/launcher/NodeLauncherUtil.java
+++ b/java/sca/modules/node-launcher-equinox/src/main/java/org/apache/tuscany/sca/node/equinox/launcher/NodeLauncherUtil.java
@@ -19,6 +19,12 @@
package org.apache.tuscany.sca.node.equinox.launcher;
+import static org.osgi.framework.Constants.BUNDLE_CLASSPATH;
+import static org.osgi.framework.Constants.BUNDLE_MANIFESTVERSION;
+import static org.osgi.framework.Constants.BUNDLE_SYMBOLICNAME;
+import static org.osgi.framework.Constants.DYNAMICIMPORT_PACKAGE;
+import static org.osgi.framework.Constants.EXPORT_PACKAGE;
+
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
@@ -260,10 +266,11 @@ final class NodeLauncherUtil {
Manifest manifest = new Manifest();
Attributes attributes = manifest.getMainAttributes();
attributes.putValue("Manifest-Version", "1.0");
- attributes.putValue(Constants.BUNDLE_MANIFESTVERSION, "2");
- attributes.putValue(Constants.BUNDLE_SYMBOLICNAME, "org.apache.tuscany.sca.node.launcher.equinox.libraries");
- attributes.putValue(Constants.EXPORT_PACKAGE, exports.substring(0, exports.length() -1));
- attributes.putValue(Constants.BUNDLE_CLASSPATH, classpath.substring(0, classpath.length() -1));
+ attributes.putValue(BUNDLE_MANIFESTVERSION, "2");
+ attributes.putValue(BUNDLE_SYMBOLICNAME, "org.apache.tuscany.sca.node.launcher.equinox.libraries");
+ attributes.putValue(EXPORT_PACKAGE, exports.substring(0, exports.length() -1));
+ attributes.putValue(BUNDLE_CLASSPATH, classpath.substring(0, classpath.length() -1));
+ attributes.putValue(DYNAMICIMPORT_PACKAGE, "*");
return manifest;
} catch (IOException e) {