org.mycore.common.events
Class MCRShutdownHandler
java.lang.Object
org.mycore.common.events.MCRShutdownHandler
public class MCRShutdownHandler
- extends Object
is a wrapper for shutdown hooks.
When used inside a web application this shutdown hook is bound to the
ServletContext. If not this hook is bound to the Java Runtime.
Every Closeable that is added via addCloseable()
will be closed at shutdown time. Do not forget to remove any closeable via
removeCloseable() to remove any instances.
For registering this hook for a web application see MCRServletContextListener
- Since:
- 1.3
- Author:
- Thomas Scheffler (yagee)
- See Also:
MCRShutdownThread,
MCRServletContextListener
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
isWebAppRunning
boolean isWebAppRunning
getInstance
public static MCRShutdownHandler getInstance()
addCloseable
public void addCloseable(MCRShutdownHandler.Closeable c)
removeCloseable
public void removeCloseable(MCRShutdownHandler.Closeable c)
shutDown
void shutDown()