public class ShutdownOperations
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
static java.lang.Runnable |
DEFAULT_SHUTDOWN_OPERATION |
| Constructor and Description |
|---|
ShutdownOperations() |
| Modifier and Type | Method and Description |
|---|---|
static void |
addOperation(java.lang.Runnable runnable)
Adds a shutdown operation which will be run once for the next shutdown
|
static void |
addOperation(java.lang.Runnable runnable,
boolean preserveForNextShutdown)
Adds a shutdown operation
|
static void |
resetOperations()
Clears all shutdown operations without running them.
|
static void |
runOperations()
Runs the shutdown operations
|
public static final java.lang.Runnable DEFAULT_SHUTDOWN_OPERATION
public static void runOperations()
public static void addOperation(java.lang.Runnable runnable)
runnable - The runnable operationpublic static void addOperation(java.lang.Runnable runnable,
boolean preserveForNextShutdown)
runnable - The runnable operationpreserveForNextShutdown - should preserve the operation for subsequent shutdowns, useful in testspublic static void resetOperations()