uk.org.iscream.cms.server.client
Class MonitorManager

java.lang.Object
  |
  +--java.lang.Thread
        |
        +--uk.org.iscream.cms.server.client.MonitorManager
All Implemented Interfaces:
Runnable

public class MonitorManager
extends Thread

A manager for the Monitors. This class starts by loading all the monitors as specificed in the configuration. These monitors should implement the PluginMonitor interface. This class then takes the feed of data coming in over CORBA from the ClientServant queue. This data is then looked at to determine type. It then places it into either a data queue, or an other queue, and all data in the the all queue. Monitors then read the data off the queue that they are interested in and process the data accordingly.

Version:
$Id: MonitorManager.java,v 1.19 2003/02/24 20:18:46 tdb Exp $
Author:
$Author: tdb $

Field Summary
private  Queue _allQueue
          Outgoing ALL Queue
private  Queue _dataQueue
          Outgoing data Queue
private static MonitorManager _instance
          A reference to the single instance of this class
private  Logger _logger
          This holds a reference to the system logger that is being used.
private  LinkedList _monitorPipeline
          LinkedList for holding the PluginMonitor objects (the pipeline).
private  String _name
          This is the friendly identifier of the component this class is running in.
private  Queue _otherQueue
          Outgoing other Queue
private  int _qID
          Our incoming queue ID
private  Queue _queue
          A reference to our incoming Queue
private  ReferenceManager _refman
          A reference to the reference manager in use
private  String _suffix
          file name suffix for plugin monitor classes:
private  XMLCache _xmlCache
          A reference to the XMLCache in use
static String REVISION
          The current CVS revision of this class
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
private MonitorManager()
          Constructs a new MonitorManager.
 
Method Summary
 Queue getAllQueue()
          In case a Monitor wants more than one type of packet, this queue can be obtained.
 Queue getDataQueue()
          Allows Monitors to obtain the queue of data packets
static MonitorManager getInstance()
          Return a reference to the single class.
 Queue getOtherQueue()
          Allows Monitors to obtain the queue of all other packets
 void run()
          Runs the MonitorManager.
 String toString()
          Overrides the Object.toString() method to provide clean logging (every class should have this).
 
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

REVISION

public static final String REVISION
The current CVS revision of this class

See Also:
Constant Field Values

_name

private String _name
This is the friendly identifier of the component this class is running in. eg, a Filter may be called "filter1", If this class does not have an owning component, a name from the configuration can be placed here. This name could also be changed to null for utility classes.


_logger

private Logger _logger
This holds a reference to the system logger that is being used.


_refman

private ReferenceManager _refman
A reference to the reference manager in use


_queue

private Queue _queue
A reference to our incoming Queue


_qID

private int _qID
Our incoming queue ID


_suffix

private final String _suffix
file name suffix for plugin monitor classes:

See Also:
Constant Field Values

_monitorPipeline

private LinkedList _monitorPipeline
LinkedList for holding the PluginMonitor objects (the pipeline).


_dataQueue

private Queue _dataQueue
Outgoing data Queue


_otherQueue

private Queue _otherQueue
Outgoing other Queue


_allQueue

private Queue _allQueue
Outgoing ALL Queue


_xmlCache

private XMLCache _xmlCache
A reference to the XMLCache in use


_instance

private static MonitorManager _instance
A reference to the single instance of this class

Constructor Detail

MonitorManager

private MonitorManager()
Constructs a new MonitorManager. This initialises all the queues and loads all the Monitors that have been specified in the configuration

Method Detail

getInstance

public static MonitorManager getInstance()
Return a reference to the single class. Construct it if it does not already exist, otherwise just return the reference.


run

public void run()
Runs the MonitorManager. This reads data from the inbound queue (from the ClientServant). And passes it into the appropriate queue for processing by the monitor threads.

Specified by:
run in interface Runnable
Overrides:
run in class Thread

toString

public String toString()
Overrides the Object.toString() method to provide clean logging (every class should have this). This uses the uk.org.iscream.cms.util.FormatName class to format the toString()

Overrides:
toString in class Thread
Returns:
the name of this class and its CVS revision

getDataQueue

public Queue getDataQueue()
Allows Monitors to obtain the queue of data packets


getOtherQueue

public Queue getOtherQueue()
Allows Monitors to obtain the queue of all other packets


getAllQueue

public Queue getAllQueue()
In case a Monitor wants more than one type of packet, this queue can be obtained.



Copyright © 2000-2003 i-scream. All Rights Reserved.