Repository: cxf Updated Branches: refs/heads/2.6.x-fixes 2f309fb16 -> 1adf37424 refs/heads/2.7.x-fixes 3d3956033 -> 172a57287 refs/heads/master 82b48aa22 -> a40358aed
CXF-5597 Setup the ResourceResolver for BlueprintBus Project: http://git-wip-us.apache.org/repos/asf/cxf/repo Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/1adf3742 Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/1adf3742 Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/1adf3742 Branch: refs/heads/2.6.x-fixes Commit: 1adf374248ad563fe2d39b57f3632cafa30e5341 Parents: 2f309fb Author: Willem Jiang <[email protected]> Authored: Thu Mar 6 20:58:36 2014 +0800 Committer: Willem Jiang <[email protected]> Committed: Thu Mar 6 21:04:47 2014 +0800 ---------------------------------------------------------------------- .../java/org/apache/cxf/bus/blueprint/BlueprintBus.java | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cxf/blob/1adf3742/rt/core/src/main/java/org/apache/cxf/bus/blueprint/BlueprintBus.java ---------------------------------------------------------------------- diff --git a/rt/core/src/main/java/org/apache/cxf/bus/blueprint/BlueprintBus.java b/rt/core/src/main/java/org/apache/cxf/bus/blueprint/BlueprintBus.java index 9d15a4b..5f0ebb8 100644 --- a/rt/core/src/main/java/org/apache/cxf/bus/blueprint/BlueprintBus.java +++ b/rt/core/src/main/java/org/apache/cxf/bus/blueprint/BlueprintBus.java @@ -26,6 +26,8 @@ import org.apache.cxf.configuration.Configurer; import org.apache.cxf.feature.AbstractFeature; import org.apache.cxf.feature.Feature; import org.apache.cxf.feature.WrappedFeature; +import org.apache.cxf.resource.ClassLoaderResolver; +import org.apache.cxf.resource.ResourceManager; import org.osgi.framework.BundleContext; import org.osgi.framework.InvalidSyntaxException; import org.osgi.framework.ServiceReference; @@ -66,9 +68,12 @@ public class BlueprintBus extends ExtensionManagerBus { public void setBundleContext(BundleContext c) { context = c; - super.setExtension(new BundleDelegatingClassLoader(c.getBundle(), - this.getClass().getClassLoader()), - ClassLoader.class); + ClassLoader bundleClassLoader = new BundleDelegatingClassLoader(c.getBundle(), + this.getClass().getClassLoader()); + super.setExtension(bundleClassLoader, ClassLoader.class); + // Setup the resource resolver with the bundle classloader + ResourceManager rm = super.getExtension(ResourceManager.class); + rm.addResourceResolver(new ClassLoaderResolver(bundleClassLoader)); super.setExtension(c, BundleContext.class); } public void setBlueprintContainer(BlueprintContainer con) {
