|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.lang.Thread
com.ibm.websphere.samples.asynchbeans.wstrader.applet.ServerMonitor
public class ServerMonitor
A ServerMonitor is a singleton object (one per JVM) that monitors the status of a server. It is very similar to the Asynch Beans SubsystemMonitor and Alarm interfaces. It publishes events based on the frequency of heartbeats that are received from the ping() method. The monitor is started when a listener is registered with the addNotificationListener() method and is destroyed when the last listener is removed with the removeNotificationListener() method.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class java.lang.Thread |
---|
java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler |
Field Summary |
---|
Fields inherited from class java.lang.Thread |
---|
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
Method Summary | |
---|---|
void |
addNotificationListener(NotificationListener listener)
Register a listener to this broadcaster. |
void |
cancel()
Cancel this monitor. |
static ServerMonitor |
create(int interval_ms,
int staleBeats,
int deadBeats)
Create a new singleton ServerMonitor or get the currently created on if one already exists |
void |
fireCurState()
Fire an event with our current status. |
boolean |
getCancelled()
Find out if the thread has been requested to end. |
static ServerMonitor |
getSelf()
Get the singleton ServerMonitor |
int |
getStatus()
Returns the status. |
boolean |
isDebug()
Returns the isDebug. |
void |
ping()
Reset the state of the monitor to Alive and fire a fresh event if the current state is stale or dead. |
void |
removeNotificationListener(NotificationListener listener)
Remove the specified listener from this broadcaster. |
void |
run()
Each x milliseconds (heartbeat interval), decrement the number of beats it will take to become stale or dead. |
void |
setIsDebug(boolean isDebug)
Sets the isDebug. |
void |
setStatus(int status)
Sets the status. |
Methods inherited from class java.lang.Thread |
---|
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Method Detail |
---|
public static ServerMonitor create(int interval_ms, int staleBeats, int deadBeats)
public static ServerMonitor getSelf()
public void ping()
public void run()
run
in interface java.lang.Runnable
run
in class java.lang.Thread
public void addNotificationListener(NotificationListener listener)
NotificationBroadcaster
addNotificationListener
in interface NotificationBroadcaster
NotificationBroadcaster.addNotificationListener(NotificationListener)
public void removeNotificationListener(NotificationListener listener)
NotificationBroadcaster
removeNotificationListener
in interface NotificationBroadcaster
NotificationBroadcaster.removeNotificationListener(NotificationListener)
public void fireCurState()
public void cancel()
public boolean getCancelled()
public int getStatus()
public void setStatus(int status)
status
- The status to setpublic boolean isDebug()
public void setIsDebug(boolean isDebug)
isDebug
- The isDebug to set
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |