Package org.grails.core.lifecycle
Class ShutdownOperations
- java.lang.Object
-
- org.grails.core.lifecycle.ShutdownOperations
-
public class ShutdownOperations extends java.lang.ObjectOperations that should be executed on shutdown.- Since:
- 2.0
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.RunnableDEFAULT_SHUTDOWN_OPERATION
-
Constructor Summary
Constructors Constructor Description ShutdownOperations()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static voidaddOperation(java.lang.Runnable runnable)Adds a shutdown operation which will be run once for the next shutdownstatic voidaddOperation(java.lang.Runnable runnable, boolean preserveForNextShutdown)Adds a shutdown operationstatic voidresetOperations()Clears all shutdown operations without running them.static voidrunOperations()Runs the shutdown operations
-
-
-
Method Detail
-
runOperations
public static void runOperations()
Runs the shutdown operations
-
addOperation
public static void addOperation(java.lang.Runnable runnable)
Adds a shutdown operation which will be run once for the next shutdown- Parameters:
runnable- The runnable operation
-
addOperation
public static void addOperation(java.lang.Runnable runnable, boolean preserveForNextShutdown)Adds a shutdown operation- Parameters:
runnable- The runnable operationpreserveForNextShutdown- should preserve the operation for subsequent shutdowns, useful in tests
-
resetOperations
public static void resetOperations()
Clears all shutdown operations without running them. Also clears operations that are kept after running operations.
-
-