|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.mindtree.techworks.insight.ShutdownHookManager
public final class ShutdownHookManager
This class manages all actions that need to be performed when the application is being closed. All possible tasks are defined as constants in this class, and the class exposes public methods to register tasks that need to be performed on application shutdown.
The class registers a thread which monitors the runtime with a shutdown
hook, and calls a method in this class when the runtime is going down. The
method #shutDown
checks for all registered actions requested (if
any) and executes them.
Field Summary | |
---|---|
protected static int |
SHUTDOWN_ACTION
Store of all actions that need to be performed on application shutdown. |
static int |
SHUTDOWN_ACTION_CLEAR_PAGES
Action identifier to call a clear on the PageSet, to clear the paginated data before the application is closed. |
static int |
SHUTDOWN_ACTION_SAVE_PREFERENCES
Action identifier to call a save on the Preference Manager before the application is closed. |
Constructor Summary | |
---|---|
ShutdownHookManager()
|
Method Summary | |
---|---|
static void |
addShutdownAction(int shutdownAction)
Register an action to be performed on shutdown of the application. |
protected static void |
shutDown()
Method called when the runtime is going down, all actions registered will be checked and performed. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int SHUTDOWN_ACTION_SAVE_PREFERENCES
public static final int SHUTDOWN_ACTION_CLEAR_PAGES
protected static int SHUTDOWN_ACTION
Constructor Detail |
---|
public ShutdownHookManager()
Method Detail |
---|
public static void addShutdownAction(int shutdownAction)
shutdownAction
- The action identifier or a union of those for multiple
actions.protected static void shutDown()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |