|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectariba.util.shutdown.ShutdownManager
public class ShutdownManager
The ShutdownManager is responsible for executing shutdown requests as graceful as possible. There are several elements in the shutdown sequence:
| Nested Class Summary | |
|---|---|
static interface |
ShutdownManager.ShutdownNotifier
This is an interface defined to allow the shutdown manager to callback a notifier just before the actual shutdown. |
| Field Summary | |
|---|---|
static String |
AutoRecycleKey
|
static String |
DirectActionKey
|
static int |
FatalExitNoRestart
Exit code to use on fatal failure without restart. |
static int |
FatalExitRestart
Exit code to use on fatal failure with restart. |
static String |
FinalShutdownNoticeTopic
|
static String |
NodeKey
|
static String[] |
NodeStatusStrings
|
static String |
NodeStatusUnknown
|
static int |
NormalExitNoRestart
Exit code to use on normal exit with no restart |
static String |
SignalKey
|
static int |
StatusNodeAutoRecycle
Node is in Auto Recycle shutdown. |
static int |
StatusNodeDirectAction
Node is in shutdown initiated by a Direct Action. |
static int |
StatusNodeImmediate
Node is in immediate (synchronous, forced) shutdown. |
static int |
StatusNodeRunning
Nodes is in normal running state. |
static int |
StatusNodeSignal
Node is in shutdown initiated by a signal. |
static int |
StatusSystemRollingRestart
System is in Rolling Restart. |
static int |
StatusSystemRollingUpgrade
System is in Rolling Upgrade. |
static int |
StatusSystemRunning
System is in normal running state. |
static String[] |
SystemStatusStrings
|
static String |
SystemStatusUnknown
|
| Method Summary | |
|---|---|
static void |
addLastShutdownHook(Thread hook)
Adds a ShutdownHook to be invoked before the exit |
static void |
addShutdownDelayer(ShutdownDelayer delayer)
Adds a ShutdownDelayer to be invoked during the asynhchronous shutdown |
static void |
addShutdownHook(Thread hook)
Adds a ShutdownHook to be invoked before the exit |
static void |
forceShutdown(int exitCode)
Triggers the synchronous and immediate shutdown sequence |
static ShutdownManager |
get()
Returns the instance of the ShutdownManager |
long |
getGracePeriod()
Returns the milliseconds for which we wait for all the ShutdownDelayers to complete. |
static int |
getNodeStatus()
|
int |
getNodeStatus(String type)
Returns the status code given a shutdown type. |
static String |
getNodeStatusAsString(int status)
|
RecycleManager |
getRecycleMgr()
|
static long |
getShutdownStartTime()
|
static int |
getSystemStatus()
|
static String |
getSystemStatusAsString(int status)
|
ThreadFactory |
getThreadFactory()
|
long |
getTimeBeforeShutdown()
Returns the number of milliseconds before we will force the shutdown (unless all ShutdownDelayer let the shutdown proceed). |
long |
getWarningInterval()
Returns the millisecond interval between warnings during the warning perdiod. |
long |
getWarningPeriod()
Returns the millisecond period during which issue shutdown warnings through the UI. |
void |
registerShutdownManagerProcessor(ShutdownManagerProcessorIfc smp)
|
void |
registerSignalHandlerForAsynchronousShutdown(String signal)
Creates and registers a SignalHandler for the given signal
name which will trigger the execution of the asynchronous shutdown |
void |
registerSignalHandlerForSynchronousShutdown(String signal)
Creates and registers a SignalHandler for the given signal
name which will trigger the execution of the asynchronous shutdown |
static void |
restartAfterStartupError()
Shutdowns a node so that it can restarted after a transient startup error. |
void |
rollingRestartBegin()
Record start of Rolling Restart. |
void |
rollingRestartEnd()
Record end of Rolling Restart. |
void |
rollingUpgradeBegin()
Record start of Rolling Upgrade. |
void |
rollingUpgradeEnd()
Record end of Rolling Upgrade. |
static void |
setExitHook(ExitHook hook)
Changes the ExitHook |
void |
setHookRunnerTimeout(int timeout)
Defines the delay for which we wait for all the ShutdownHooks to complete. |
void |
setPingInterval(int interval)
Defines the interval between queries to the ShutdownDelayer |
void |
setPrintExtraMessages(boolean value)
Specifies whether to print extra messages during the shutdown. |
void |
setShutdownNotifier(ShutdownManager.ShutdownNotifier notifier)
Set the shutdownNotifier. |
void |
setShutdownTimes(String type,
int gracePeriod,
int warningPeriod,
int warningInterval)
Sets a group of shutdown times for a given key. |
static void |
setSystemStatus(int status)
|
void |
setThreadFactory(ThreadFactory tf)
Sets the ThreadFactory that will be used for creating new threads as needed during the shutdown sequence |
static void |
shutdown(int exitCode,
String type)
Triggers the start of the asynchronous shutdown sequence. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int NormalExitNoRestart
public static final int FatalExitRestart
public static final int FatalExitNoRestart
public static final int StatusSystemRunning
public static final int StatusSystemRollingUpgrade
public static final int StatusSystemRollingRestart
public static final String SystemStatusUnknown
public static final String[] SystemStatusStrings
public static final int StatusNodeRunning
public static final int StatusNodeImmediate
public static final int StatusNodeDirectAction
public static final int StatusNodeSignal
public static final int StatusNodeAutoRecycle
public static final String NodeStatusUnknown
public static final String[] NodeStatusStrings
public static final String DirectActionKey
public static final String SignalKey
public static final String AutoRecycleKey
public static final String FinalShutdownNoticeTopic
public static final String NodeKey
| Method Detail |
|---|
public static ShutdownManager get()
public RecycleManager getRecycleMgr()
public static void addShutdownDelayer(ShutdownDelayer delayer)
delayer - the ShutdownDelayer to be addedpublic static void addShutdownHook(Thread hook)
hook - the ShutdownHook to be addedpublic static void addLastShutdownHook(Thread hook)
hook - the ShutdownHook to be addedpublic static void setExitHook(ExitHook hook)
hook - the new ExitHook to use
public static void shutdown(int exitCode,
String type)
exitCode - the exit code to return at the endpublic static void forceShutdown(int exitCode)
exitCode - the exit code to returnpublic static void restartAfterStartupError()
public void setHookRunnerTimeout(int timeout)
timeout - delay in minutes
public void setShutdownTimes(String type,
int gracePeriod,
int warningPeriod,
int warningInterval)
type - shutdown typegracePeriod - overall delay period in minuteswarningPeriod - total period to issue warnings in UI in minuteswarningInterval - interval between UI warningspublic int getNodeStatus(String type)
public void rollingUpgradeBegin()
public void rollingUpgradeEnd()
public void rollingRestartBegin()
public void rollingRestartEnd()
public long getGracePeriod()
public long getWarningPeriod()
public long getWarningInterval()
getWarningPeriod()public void setPingInterval(int interval)
interval - delay in secondspublic void setThreadFactory(ThreadFactory tf)
tf - the new ThreadFactorypublic ThreadFactory getThreadFactory()
public void setPrintExtraMessages(boolean value)
true is passed to that
method
value - if true the extra messages will be printed
on the consolepublic void registerSignalHandlerForAsynchronousShutdown(String signal)
SignalHandler for the given signal
name which will trigger the execution of the asynchronous shutdown
signal - name of the signal to register withpublic void registerSignalHandlerForSynchronousShutdown(String signal)
SignalHandler for the given signal
name which will trigger the execution of the asynchronous shutdown
signal - name of the signal to register withpublic void registerShutdownManagerProcessor(ShutdownManagerProcessorIfc smp)
public long getTimeBeforeShutdown()
public void setShutdownNotifier(ShutdownManager.ShutdownNotifier notifier)
public static int getSystemStatus()
public static String getSystemStatusAsString(int status)
public static void setSystemStatus(int status)
public static int getNodeStatus()
public static String getNodeStatusAsString(int status)
public static long getShutdownStartTime()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||