|
![]() |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.lang.Thread | +--uk.org.iscream.cms.server.client.MonitorSkeleton
Skeleton class for Monitors This skeleton reads packets from a queue designated by the extending class, it then feeds the data to the analysePacket method, which the extending class should implement. The class should then handle the monitoring for that packet.
Field Summary | |
protected Queue |
_alerterQueue
A reference to the Alerter queue, into which all new alerts will be placed. |
protected Logger |
_logger
This holds a reference to the system logger that is being used. |
protected int |
_qID
The ID of the queue the monitor will use. |
protected boolean |
_running
The state of the alerter thread |
String |
REVISION
The current CVS revision of this class |
Fields inherited from class java.lang.Thread |
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
Constructor Summary | |
MonitorSkeleton()
Constructs and start the monitor reading its data |
Method Summary | |
protected abstract void |
analysePacket(XMLPacket packet)
Extending classes should override this method to analyse the given packet for the attribute they are responsible for. |
private void |
fireAlert(Register reg,
int lastAlert,
String source,
String currentValue,
String attributeName)
Fires an alert. |
abstract String |
getDescription()
Return the String representation of what the alerter does |
protected abstract Queue |
getQueue()
Obtain the queue which contains the data the Monitor is reading. |
protected int |
getQueueId()
Create a queue ID on the feeding data queue |
protected void |
processAlert(int newThreshold,
String attributeName,
Register reg,
String source,
String currentValue)
Once a Monitor has determined which threshold the given data packet is at, it should then call this method. |
void |
run()
Obtains data from the monitors data queue and passes the packet to the analysePacket method. |
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, toString, yield |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public final String REVISION
protected Logger _logger
protected Queue _alerterQueue
protected int _qID
protected boolean _running
Constructor Detail |
public MonitorSkeleton()
Method Detail |
public void run()
run
in interface Runnable
run
in class Thread
protected abstract void analysePacket(XMLPacket packet)
protected void processAlert(int newThreshold, String attributeName, Register reg, String source, String currentValue)
newThreshold
- the threshold that has been determined by the monitorattributeName
- the textual name of the attribute the monitor is responsible forreg
- the register that holds the current alert state for the machine/attributesource
- the source of the alert eg, hostnamecurrentValue
- the data value for the attributepublic abstract String getDescription()
getDescription
in interface PluginMonitor
private void fireAlert(Register reg, int lastAlert, String source, String currentValue, String attributeName)
reg
- the register holding the state values for the alertsource
- the source of the alert eg, hostnamecurrentValue
- the data value for the attributeattributeName
- the textual name of the attribute the alert is forprotected abstract Queue getQueue()
protected int getQueueId()
|
![]() |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |