Hello Hannes,


from a Restlet point of view, the "stop" method is the dedicated "spot" to take care of such considerations.
There is no need to override the "ServerServlet#destroy" method, unless you need so due to the fact that you override the ServerServlet class.
I would like to add also that by default the "ServerServlet#destroy" method invokes the "stop" method of your application.

Best regards,
Thierry Boileau
--
Restlet ~ Core developer ~ http://www.restlet.org
Noelios Technologies ~ Co-founder ~ http://www.noelios.com

I'm running Restlets in Tomcat and need a way to cleanly shutdown a
repository - is there a shutdown hook or a destroy() method I could use?

What's common practice for doing this?
    

I found now two possibilities:

- Creating a class derived from ServerServlet, overriding destroy(), and
invoking the new class from Tomcat, instead of ServerServlet.
- Overriding stop() from the Application class.

Overriding seems to be simpler, as it does not require a new class.

What is the preferred method for doing some cleanups before shutting
down in a container?
Do both approaches have the same effect, or is there a difference?

Thanks,
Hannes
  

Reply via email to