java.lang.Object
io.ebean.event.ShutdownManager
Manages the shutdown of Ebean.
Makes sure all the resources are shutdown properly and in order.
-
Method Summary
Modifier and TypeMethodDescriptionstatic voidDeregister the Shutdown hook.static booleanReturn true if the system is in the process of stopping.static voidregisterContainer(SpiContainer ebeanContainer) Registers the container (potentially with cluster management).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
Registers the container (potentially with cluster management). -
touch
public static void touch()Make sure the ShutdownManager is activated. -
isStopping
public static boolean isStopping()Return true if the system is in the process of stopping. -
deregisterShutdownHook
public static void 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
public static void 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.
-