camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Claus Ibsen <claus.ib...@gmail.com>
Subject Re: How to execute route on shutdown?
Date Thu, 18 Oct 2012 03:56:11 GMT
On Mon, Oct 15, 2012 at 11:27 PM, Henrique Viecili <henrique@myreks.com> wrote:
> Hello guys...
>
> I've created a service that register itself on startup using camel-timer
> component and now I want to make it unregister itself on shutdown. I know I
> could do it registering a Shutdown Hook in the JVM or coding my own
> ShutdownStrategy but I am looking for a simple solution preferably using
> Spring DSL. Does anyone have done this before?
>
> Thanks,
> *Henrique Viecili*

What is your "service". And what do you mean by unreigstering itself
on shutdown?
>From what should it unregister, and when you say shutdown, it is the
CamelContext being stopped or the JVM itself etc.?

And with Spring you can simple just do
<bean id="foo" class="xxx" init-method="startMe" destroy-method="killMe"/>

The names of the attributes, you would need to check the spring docs
to make sure, as I am not sure if init-method etc is the correct name.


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

Mime
View raw message