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/172a5728 Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/172a5728 Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/172a5728 Branch: refs/heads/2.7.x-fixes Commit: 172a57287adf9576bda87be602dc4067e90edc34 Parents: 3d39560 Author: Willem Jiang <willem.ji...@gmail.com> Authored: Thu Mar 6 20:58:36 2014 +0800 Committer: Willem Jiang <willem.ji...@gmail.com> Committed: Thu Mar 6 21:05:07 2014 +0800 ---------------------------------------------------------------------- .../main/java/org/apache/cxf/bus/blueprint/BlueprintBus.java | 5 +++++ 1 file changed, 5 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cxf/blob/172a5728/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 5ed1aec..9842ad3 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 @@ -25,6 +25,8 @@ import java.security.PrivilegedAction; import org.apache.cxf.bus.extension.ExtensionManagerBus; import org.apache.cxf.configuration.ConfiguredBeanLocator; import org.apache.cxf.configuration.Configurer; +import org.apache.cxf.resource.ClassLoaderResolver; +import org.apache.cxf.resource.ResourceManager; import org.osgi.framework.BundleContext; import org.osgi.service.blueprint.container.BlueprintContainer; @@ -54,6 +56,9 @@ public class BlueprintBus extends ExtensionManagerBus { } }); 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) {