Package io.ebean.event
Class ShutdownManager
java.lang.Object
io.ebean.event.ShutdownManager
public final class ShutdownManager extends Object
Manages the shutdown of the JVM Runtime.
Makes sure all the resources are shutdown properly and in order.
-
Method Summary
Modifier and Type Method Description static voidderegisterShutdownHook()Deregister the Shutdown hook.static booleanisStopping()Return true if the system is in the process of stopping.static voidregisterContainer(SpiContainer ebeanContainer)static voidregisterDatabase(Database server)Register an ebeanServer to be shutdown when the JVM is shutdown.static voidshutdown()Shutdown gracefully cleaning up any resources as required.static voidtouch()Make sure the ShutdownManager is activated.static voidunregisterDatabase(Database server)Deregister an ebeanServer.
-
Method Details
-
registerContainer
-
touch
Make sure the ShutdownManager is activated. -
isStopping
Return true if the system is in the process of stopping. -
deregisterShutdownHook
Deregister the Shutdown hook.In calling this method it is expected that application code will invoke the shutdown() method.
For running in a Servlet Container a redeploy will cause a shutdown, and for that case we need to make sure the shutdown hook is deregistered.
-
shutdown
Shutdown gracefully cleaning up any resources as required.This is typically invoked via JVM shutdown hook.
-
registerDatabase
Register an ebeanServer to be shutdown when the JVM is shutdown. -
unregisterDatabase
Deregister an ebeanServer.This is done when the ebeanServer is shutdown manually.
-