use of org.apache.camel.core.osgi.OsgiDefaultCamelContext in project camel by apache.
the class AbstractCamelRunner method createCamelContext.
protected void createCamelContext(final BundleContext bundleContext, final Map<String, String> props) {
if (bundleContext != null) {
context = new OsgiDefaultCamelContext(bundleContext, createRegistry(bundleContext));
// Setup the application context classloader with the bundle classloader
context.setApplicationContextClassLoader(new BundleDelegatingClassLoader(bundleContext.getBundle()));
// and make sure the TCCL is our classloader
Thread.currentThread().setContextClassLoader(context.getApplicationContextClassLoader());
} else {
context = new DefaultCamelContext(createRegistry());
}
setupPropertiesComponent(context, props, log);
}
Aggregations