camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sub3 <>
Subject Inside & Out of OSGI
Date Thu, 28 Apr 2011 19:40:00 GMT
I would like to be able to run the same code (or very close) both inside and
outside an osgi container (I am using servicemix/karaf).

Normally, I set up via code like:

jndiContext = new JndiContext();
context = new DefaultCamelContext(jndiContext);
and add routes as needed:
context.addRoutes(new RouteBuilder() {
public void configure() {

>From other posts, I see the solution is to use CamelContextFactory instead
of DefaultCamelContext. 

So, Is there any way to just create the context differently based on whether
I am in a container?  Or do I need to separate setups & code?


View this message in context:
Sent from the Camel - Users mailing list archive at

View raw message