|
![]() |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.lang.Thread
uk.org.iscream.cms.server.client.MonitorSkeleton
uk.org.iscream.cms.server.client.monitors.Heartbeat__Monitor
This Monitor watches heartbeats. It generates an alert when a heartbeat that is expected does not arrive. Unlike all the other monitors, this one is driven by an event *not* occuring, rather than an event occuring. This means it must be actively checking for missing heartbeat's, and thus has an extra inner class thread. This originally took "heartbeat" packets, but they've now been deprecated. Instead we look at UDP packets, or, rather the lack of them :-)
Nested Class Summary | |
private class |
Heartbeat__Monitor.HeartbeatHolder
This inner class simply holding some information about a specific host. |
private class |
Heartbeat__Monitor.HeartbeatWorker
This worker thread just checks all the hosts and then waits a period of time before doing it again. |
Field Summary | |
private ConfigurationProxy |
_cp
A reference to the configuration proxy in use |
private HashMap |
_hosts
A HashMap of hosts, with associated HeartbeatHolder's. |
private Logger |
_logger
A reference to the system logger. |
private String |
_name
This is the friendly identifier of the component this class is running in. |
int |
DEFAULT_CHECK_PERIOD
The default (used if not configured) period at which to check for old heartbeats. |
String |
DESC
A description of this monitor |
String |
REVISION
The current CVS revision of this class |
Fields inherited from class uk.org.iscream.cms.server.client.MonitorSkeleton |
_alerterQueue, _qID, _running |
Fields inherited from class java.lang.Thread |
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
Constructor Summary | |
Heartbeat__Monitor()
Constructs a new Heartbeat monitor, and starts off the worker thread. |
Method Summary | |
void |
analysePacket(XMLPacket packet)
Analyse a packet of data. |
private int |
checkAttributeThreshold(long timeSinceLastHB,
Register reg)
Checks whether the time since the last heartbeat is beyond the threshold(s). |
private void |
createInitialHosts()
Gets an initial list of hosts from the config and adds a fake set of heartbeats for them. |
String |
getDescription()
return the String representation of what the monitor does |
protected Queue |
getQueue()
Returns a reference to the Queue we're getting data from. |
String |
toString()
Overrides the Object.toString()
method to provide clean logging (every class should have this). |
Methods inherited from class uk.org.iscream.cms.server.client.MonitorSkeleton |
getQueueId, processAlert, run |
Methods inherited from class java.lang.Thread |
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getContextClassLoader, getName, getPriority, getThreadGroup, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setName, setPriority, sleep, sleep, start, stop, stop, suspend, yield |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public final String REVISION
public final String DESC
public final int DEFAULT_CHECK_PERIOD
private String _name
private ConfigurationProxy _cp
private HashMap _hosts
private Logger _logger
Constructor Detail |
public Heartbeat__Monitor()
Method Detail |
public void analysePacket(XMLPacket packet)
analysePacket
in class MonitorSkeleton
packet
- The packet of data to analysepublic String toString()
Object.toString()
method to provide clean logging (every class should have this).
This uses the uk.org.iscream.cms.util.NameFormat class
to format the toString()
public String getDescription()
getDescription
in interface PluginMonitor
getDescription
in class MonitorSkeleton
private int checkAttributeThreshold(long timeSinceLastHB, Register reg)
timeSinceLastHB
- a long time since the last heartbeat arrivedreg
- the Register for this host
private void createInitialHosts()
protected Queue getQueue()
getQueue
in class MonitorSkeleton
|
![]() |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |