You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by ni...@apache.org on 2014/08/28 14:43:25 UTC
[2/3] git commit: CAMEL-7761 Setup the application context
classloader of OSGiDefaultCamelContext
CAMEL-7761 Setup the application context classloader of OSGiDefaultCamelContext
Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/2806bb16
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/2806bb16
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/2806bb16
Branch: refs/heads/master
Commit: 2806bb166f0884c50aa68cffacadde489cacfdda
Parents: 64f0420
Author: Willem Jiang <wi...@gmail.com>
Authored: Thu Aug 28 20:28:25 2014 +0800
Committer: Willem Jiang <wi...@gmail.com>
Committed: Thu Aug 28 20:42:42 2014 +0800
----------------------------------------------------------------------
.../java/org/apache/camel/core/osgi/OsgiDefaultCamelContext.java | 3 +++
1 file changed, 3 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/camel/blob/2806bb16/components/camel-core-osgi/src/main/java/org/apache/camel/core/osgi/OsgiDefaultCamelContext.java
----------------------------------------------------------------------
diff --git a/components/camel-core-osgi/src/main/java/org/apache/camel/core/osgi/OsgiDefaultCamelContext.java b/components/camel-core-osgi/src/main/java/org/apache/camel/core/osgi/OsgiDefaultCamelContext.java
index 7329a7b..a48b9d1 100644
--- a/components/camel-core-osgi/src/main/java/org/apache/camel/core/osgi/OsgiDefaultCamelContext.java
+++ b/components/camel-core-osgi/src/main/java/org/apache/camel/core/osgi/OsgiDefaultCamelContext.java
@@ -22,6 +22,7 @@ import java.util.Properties;
import org.apache.camel.TypeConverter;
import org.apache.camel.core.osgi.utils.BundleContextUtils;
+import org.apache.camel.core.osgi.utils.BundleDelegatingClassLoader;
import org.apache.camel.impl.DefaultCamelContext;
import org.apache.camel.spi.FactoryFinder;
import org.apache.camel.spi.Registry;
@@ -41,6 +42,8 @@ public class OsgiDefaultCamelContext extends DefaultCamelContext {
this.bundleContext = bundleContext;
this.registry = registry;
OsgiCamelContextHelper.osgiUpdate(this, bundleContext);
+ // setup the application context classloader with the bundle classloader
+ setApplicationContextClassLoader(new BundleDelegatingClassLoader(bundleContext.getBundle()));
}
@Override