public final class ShutdownOperations extends Object
Operations that should be executed on shutdown.
Modifiers | Name | Description |
---|---|---|
static Runnable |
DEFAULT_SHUTDOWN_OPERATION |
Type Params | Return Type | Name and description |
---|---|---|
|
public static void |
addOperation(Runnable runnable) Adds a shutdown operation which will be run once for the next shutdown |
|
public static void |
addOperation(Runnable runnable, boolean preserveForNextShutdown) Adds a shutdown operation |
|
public static void |
resetOperations() Clears all shutdown operations without running them. |
|
public static void |
runOperations() Runs the shutdown operations |
Adds a shutdown operation which will be run once for the next shutdown
runnable
- The runnable operationAdds a shutdown operation
runnable
- The runnable operationpreserveForNextShutdown
- should preserve the operation for subsequent shutdowns, useful in testsClears all shutdown operations without running them. Also clears operations that are kept after running operations.
Runs the shutdown operations