activemq-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "James Strachan" <james.strac...@gmail.com>
Subject Re: [camel] CamelContext destruction
Date Wed, 25 Apr 2007 17:10:20 GMT
On 4/25/07, dr.jeff <jlansing@systechnologies.com> wrote:
>
> This is very mysterious to me. When I call builder.getRouteList() my
> DefaultCamelContext is destroyed, and another (empty) one is mysteriously
> swapped into its place. How can that happen?

So the idea is that you create a CamelContext, add routes to it, then
destroy the context when your're done.

So

CamelContex context = new DefaultContext();
context.addRoutes(myBuilder);
context.start();

// time passes

context.stop();

Its just that by default RouteBuilder will use its own context if you
don't explicitly add it to a context. (Maybe we should stop this
default behaviour to avoid confusion?)



-- 
James
-------
http://macstrac.blogspot.com/

Mime
View raw message