-
1. Re: Load a camelContext from a OSGi BundleActivator
njiang Aug 26, 2010 3:27 AM (in response to pchandler)Spring DM is powerful
But you can find anther way to start a camel context.
Please check out the camel-example-guice-jms, its use an OSGi BundleActivator to start up the camel context, and guice is used for wiring the camel context.
-
2. Re: Load a camelContext from a OSGi BundleActivator
pchandler Aug 26, 2010 11:53 AM (in response to njiang)Thanks. I had a look at the example.
My understating of the example is:
Bundle Activator -> uses Guice/Java to start camel.
In my case:
Bundle Activator -> uses Spring DM to start a camel XML context file.
-
3. Re: Load a camelContext from a OSGi BundleActivator
njiang Aug 26, 2010 8:45 PM (in response to pchandler)Spring DM has a extender which could help you to load the spring configure from the bundle, and it also helps you to find the resources from OSGi.
To do it, basically you just need to use Spring DM create a OSGi version application context and set the bundle context to it, then Spring DM will take care of the rest work.
Here is example that you can take a look.
Willem
-
4. Re: Load a camelContext from a OSGi BundleActivator
pchandler Sep 10, 2010 3:21 PM (in response to njiang)OsgiBundleXmlApplicationContext applicationContext = new OsgiBundleXmlApplicationContext(new String[]{"org/apache/camel/itest/osgi/CamelContext.xml"}) applicationContext.setBundleContext(bundleContext); applicationContext.refresh();
Thanks.