use of org.apache.camel.core.osgi.OsgiEventAdminNotifier in project camel by apache.
the class CamelContextFactoryBean method afterPropertiesSet.
@Override
public void afterPropertiesSet() throws Exception {
super.afterPropertiesSet();
getContext().getManagementStrategy().addEventNotifier(new OsgiCamelContextPublisher(bundleContext));
try {
getClass().getClassLoader().loadClass("org.osgi.service.event.EventAdmin");
getContext().getManagementStrategy().addEventNotifier(new OsgiEventAdminNotifier(bundleContext));
} catch (Throwable t) {
// Ignore, if the EventAdmin package is not available, just don't use it
LOG.debug("EventAdmin package is not available, just don't use it");
}
}
use of org.apache.camel.core.osgi.OsgiEventAdminNotifier in project camel by apache.
the class CamelContextFactoryBean method afterPropertiesSet.
@Override
public void afterPropertiesSet() throws Exception {
super.afterPropertiesSet();
// setup the application context classloader with the bundle delegating classloader
ClassLoader cl = new BundleDelegatingClassLoader(bundleContext.getBundle());
LOG.debug("Set the application context classloader to: {}", cl);
getContext().setApplicationContextClassLoader(cl);
osgiCamelContextPublisher = new OsgiCamelContextPublisher(bundleContext);
osgiCamelContextPublisher.start();
getContext().getManagementStrategy().addEventNotifier(osgiCamelContextPublisher);
try {
getClass().getClassLoader().loadClass("org.osgi.service.event.EventAdmin");
getContext().getManagementStrategy().addEventNotifier(new OsgiEventAdminNotifier(bundleContext));
} catch (Throwable t) {
// Ignore, if the EventAdmin package is not available, just don't use it
LOG.debug("EventAdmin package is not available, just don't use it");
}
// ensure routes is setup
setupRoutes();
}
use of org.apache.camel.core.osgi.OsgiEventAdminNotifier in project aries by apache.
the class CamelContextFactoryBean method afterPropertiesSet.
@Override
public void afterPropertiesSet() throws Exception {
super.afterPropertiesSet();
BundleContext bundleContext = getBundleContext();
getContext().getManagementStrategy().addEventNotifier(new OsgiCamelContextPublisher(bundleContext));
try {
getClass().getClassLoader().loadClass("org.osgi.service.event.EventAdmin");
getContext().getManagementStrategy().addEventNotifier(new OsgiEventAdminNotifier(bundleContext));
} catch (Throwable t) {
// Ignore, if the EventAdmin package is not available, just don't use it
LOG.debug("EventAdmin package is not available, just don't use it");
}
}
Aggregations