diff options
author | rfeng <rfeng@13f79535-47bb-0310-9956-ffa450edef68> | 2009-07-31 18:08:22 +0000 |
---|---|---|
committer | rfeng <rfeng@13f79535-47bb-0310-9956-ffa450edef68> | 2009-07-31 18:08:22 +0000 |
commit | b029a4016074bd535a0f2aa5277bdb03bad06921 (patch) | |
tree | 4bead2382cf161a925a7d7743aa14de461e59930 /java/sca/modules/extensibility | |
parent | a6179742e5829160477b0437afe323fcfe20131a (diff) |
Use the extensibility-equinox module to dynamically imports public packages and resources
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@799679 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'java/sca/modules/extensibility')
4 files changed, 15 insertions, 6 deletions
diff --git a/java/sca/modules/extensibility/META-INF/MANIFEST.MF b/java/sca/modules/extensibility/META-INF/MANIFEST.MF index 7cc2ff22c9..24949ed812 100644 --- a/java/sca/modules/extensibility/META-INF/MANIFEST.MF +++ b/java/sca/modules/extensibility/META-INF/MANIFEST.MF @@ -1,17 +1,13 @@ Manifest-Version: 1.0
-Tuscany-Comment: Expoprt the META-INF.services under an "internal" attribute
+Tuscany-Comment1: Export the META-INF.services under an "internal" attribute
so that it can be seen only by the bundle itself without following the
DynamicImport-Package *
Export-Package: org.apache.tuscany.sca.core;uses:="org.apache.tuscany.
sca.extensibility";version="2.0.0",org.apache.tuscany.sca.extensibility
- ;version="2.0.0",META-INF.services;internal=true;mandatory:=internal
+ ;version="2.0.0"
Tool: Bnd-0.0.255
Bundle-Name: Apache Tuscany SCA Extensibility
Created-By: 1.6.0_07 (Sun Microsystems Inc.)
-DynamicImport-Package: org.apache.tuscany.sca.extensibility.equinox,
- javax.transaction;version="1.1",
- javax.transaction.xa;version="1.1",
- *
Bundle-Vendor: The Apache Software Foundation
Bundle-Version: 2.0.0
Bnd-LastModified: 1225397079296
diff --git a/java/sca/modules/extensibility/src/main/java/org/apache/tuscany/sca/extensibility/ContextClassLoaderServiceDiscoverer.java b/java/sca/modules/extensibility/src/main/java/org/apache/tuscany/sca/extensibility/ContextClassLoaderServiceDiscoverer.java index 3d733d042e..26ede88214 100644 --- a/java/sca/modules/extensibility/src/main/java/org/apache/tuscany/sca/extensibility/ContextClassLoaderServiceDiscoverer.java +++ b/java/sca/modules/extensibility/src/main/java/org/apache/tuscany/sca/extensibility/ContextClassLoaderServiceDiscoverer.java @@ -121,6 +121,10 @@ public class ContextClassLoaderServiceDiscoverer implements ServiceDiscoverer { ClassLoader classLoader = Thread.currentThread().getContextClassLoader(); this.classLoaderReference = new WeakReference<ClassLoader>(classLoader); } + + public ClassLoader getContextClassLoader() { + return classLoaderReference.get(); + } private List<URL> getResources(final String name) throws IOException { try { diff --git a/java/sca/modules/extensibility/src/main/java/org/apache/tuscany/sca/extensibility/ServiceDiscoverer.java b/java/sca/modules/extensibility/src/main/java/org/apache/tuscany/sca/extensibility/ServiceDiscoverer.java index 9b939e8228..aebd6cd3de 100644 --- a/java/sca/modules/extensibility/src/main/java/org/apache/tuscany/sca/extensibility/ServiceDiscoverer.java +++ b/java/sca/modules/extensibility/src/main/java/org/apache/tuscany/sca/extensibility/ServiceDiscoverer.java @@ -46,4 +46,9 @@ public interface ServiceDiscoverer { */ public ServiceDeclaration getServiceDeclaration(String name) throws IOException; + /** + * Get a classloader that can be used for thread context loader + * @return A classloader that can provide access to public classes and resources + */ + public ClassLoader getContextClassLoader(); } diff --git a/java/sca/modules/extensibility/src/main/java/org/apache/tuscany/sca/extensibility/ServiceDiscovery.java b/java/sca/modules/extensibility/src/main/java/org/apache/tuscany/sca/extensibility/ServiceDiscovery.java index ec95aba7e1..70274752e4 100644 --- a/java/sca/modules/extensibility/src/main/java/org/apache/tuscany/sca/extensibility/ServiceDiscovery.java +++ b/java/sca/modules/extensibility/src/main/java/org/apache/tuscany/sca/extensibility/ServiceDiscovery.java @@ -182,4 +182,8 @@ public final class ServiceDiscovery implements ServiceDiscoverer { } } + public ClassLoader getContextClassLoader() { + return discoverer.getContextClassLoader(); + } + } |