public class OrderedShutdownHooks
extends java.lang.Object
| Modifier and Type | Class and Description |
|---|---|
private static class |
OrderedShutdownHooks.ShutdownHook
Class representing a shutdown hook.
|
| Modifier and Type | Field and Description |
|---|---|
private static OrderedShutdownHooks |
instance
Singleton instance
|
private static CentralLogger |
LOG
Logger.
|
private static java.util.List<OrderedShutdownHooks.ShutdownHook> |
shutdownHooks
List of hooks to be handled at server shutdown
|
| Modifier | Constructor and Description |
|---|---|
private |
OrderedShutdownHooks()
Private constructor to prevent instantiation from outside the class.
|
| Modifier and Type | Method and Description |
|---|---|
static void |
deregisterShutdownHook(int priority,
java.lang.Runnable action)
Deregisters a shutdown hook with a specified priority.
|
private void |
executeShutdownHooks()
Executes all registered shutdown hooks in the order of their priority.
|
private static void |
getInstance()
Returns the singleton instance of OrderedShutdownHooks.
|
static void |
registerShutdownHook(int priority,
java.lang.Runnable action)
Registers a new shutdown hook with a specified priority.
|
private static final CentralLogger LOG
private static OrderedShutdownHooks instance
private static final java.util.List<OrderedShutdownHooks.ShutdownHook> shutdownHooks
private OrderedShutdownHooks()
private static void getInstance()
public static void registerShutdownHook(int priority,
java.lang.Runnable action)
priority - The priority of the shutdown hook.action - The Runnable action to be executed during shutdown.public static void deregisterShutdownHook(int priority,
java.lang.Runnable action)
priority - The priority of the shutdown hook.action - The Runnable action to be executed during shutdown.private void executeShutdownHooks()