Hannes Ebner wrote:
> 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