On Tue, Oct 2, 2012 at 3:38 PM, Tim Dudgeon <[email protected]> wrote:
> Are there any tricks or patterns to use when it comes to needing to manage
> the lifecyle of components used in Camel routes.
> For instance if I write a custom Processor that creates something like a
> PreparedStatement how can I make sure its is close()'d when the CamelContext
> shuts down.
>

See
http://camel.apache.org/lifecycle.html

You can implement the Service interface, or extend ServiceSupport.
Then you have callbacks when its started/stopped etc.

> Thanks
> Tim



-- 
Claus Ibsen
-----------------
Red Hat, Inc.
FuseSource is now part of Red Hat
Email: [email protected]
Web: http://fusesource.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen

Reply via email to