Thanks Claus. I created https://issues.apache.org/jira/browse/CAMEL-4514 for this issue. I took your advice and suggested adding the callback to RoutePolicy, especially since it already has an onInit(Route) method.
On Tue, Oct 4, 2011 at 11:51 AM, Claus Ibsen <claus.ib...@gmail.com> wrote: > On Tue, Oct 4, 2011 at 5:11 PM, Jeff Segal <jeffrey.se...@gmail.com> wrote: >> I have an application which dynamically creates and removes routes in >> a camel context. I'd like to be able to invoke an onShutdown method >> when routes are removed so that I can perform some cleanup tasks. I've >> read http://camel.apache.org/graceful-shutdown.html but wasn't able to >> find a good solution there. Ideally I'd define a Runnable and >> configure it like this: >> >> from("foo:bar").to("abc:123").onShutdown(myRunnable); >> >> Is there some alternative that I missed or is this more of a feature request? >> > > There is no such thing in the DSL. > > Would could possible look into adding support for callbacks on > RoutePolicy, as you > could then associate a route with a policy, and have callbacks for > onStart / onStop / onShutdown wtc. > > Fell free to create a JIRA ticket. > > >> Thanks, >> Jeff >> > > > > -- > Claus Ibsen > ----------------- > FuseSource > Email: cib...@fusesource.com > Web: http://fusesource.com > Twitter: davsclaus, fusenews > Blog: http://davsclaus.blogspot.com/ > Author of Camel in Action: http://www.manning.com/ibsen/ >