|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.opennms.bb.dp.eventd.EventListener
Listener extends the PollerThread for the pause/resume/shutdown functionality
Its threads listen for events sent as XML over a TCP, UDP or JSDT connection. These threads add the received data as 'EventsReader'( conatining the input stream) to the 'readerQ'
It also maintains a pool of RunnableConsumerThreads that read and run the EventsReader objects added to the readerQ to actually parse the input streams to events('EventBlocks') - the 'EventsReader's are then added to the 'expanderQ' from where the 'EventsExpander's pick them up, and add data from the 'event.conf' to the events
Inner Class Summary | |
private class |
EventListener.CheckQueue
This class is designed to specifically override the add behaviour of the base class. |
Field Summary | |
private static int |
EVENTD_TCP_PORT
Port on which Listener accepts TCP connections |
private static int |
EVENTD_UDP_PORT
Port on which Listener accepts UDP connections |
private static int |
INIT_NUM_READERS
The initial number of threads |
private PCQueue |
m_destQ
The queue to were completed reader objects are sent. |
private JSDTHandler |
m_jsdtHandler
The handler for events coming in through JSDT |
private static Map |
m_parserMap
A hash table for the parser pool to be used by the 'RunnableConsumerThread' pool - a parser is added to the pool for each thread in the pool so that when the threads can then look up their parser by using the current thread ID |
private ThreadGroup |
m_readerGroup
The thread group that all the reader threads belong two. |
private PCQueue |
m_readerQ
The queue to which the incoming events are added |
private List |
m_readers
The RunnableConsumerThread thread pool that takes a event input source, parses it to the event datablocks and adds that to the expanderQ |
private TCPHandler |
m_tcpHandler
The handler for events coming in through TCP |
private UDPHandler |
m_udpHandler
The handler for events coming in through UDP |
private int |
max_readers
The max number of RunnableConsumerThreads that should be started by the manager. |
Constructor Summary | |
EventListener(PCQueue destQ)
Creates the Listener thread of eventd that listens for events sent via TCP, UDP or JSDT |
Method Summary | |
(package private) static void |
|
static org.apache.xerces.parsers.SAXParser |
getEventsParser(Object key)
Returns the SAX based parser that can be used to decompose the event. |
void |
pauseOperation()
|
void |
resumeOperation()
|
void |
shutdown()
Initiates the shutdown sequence and waits for this thread to exit. |
void |
start()
Start all the threads to handle the various communication paths |
(package private) void |
threadsVsQueueSizeCheck(int entries)
After each read from the readerQ, the threads in the thread pool call this method to adjust the number of threads in the pool if necessary If the number of entries in the queue is more than double the number of threads, the number of threads is increased by one until the configurable maximum number of threads is reached If the number of threads in thepool is more than double the number of entries in the queue, the number of threads is decreased by one until the predefined initial number of threads is reached |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait |
Field Detail |
private static final int EVENTD_TCP_PORT
private static final int EVENTD_UDP_PORT
private static final int INIT_NUM_READERS
private PCQueue m_readerQ
private PCQueue m_destQ
private TCPHandler m_tcpHandler
private UDPHandler m_udpHandler
private JSDTHandler m_jsdtHandler
private int max_readers
The max number of RunnableConsumerThreads that should be started by the manager.
private List m_readers
private ThreadGroup m_readerGroup
The thread group that all the reader threads belong two. This group can then be used to control/access the entire group. (If all the good methods were not depreciated).
It's mainly for separating the threads in the debugger now.
private static Map m_parserMap
Constructor Detail |
public EventListener(PCQueue destQ) throws EventListenerException
Creates the Listener thread of eventd that listens for events sent via TCP, UDP or JSDT
The Listener also has a pool of 'RunnableConsumerThread' threads that reads the input streams added by the individual listeners and parses the streams (this is done by running the EventsReader objects in the readerQ)
EventListenerException
- if any of the handlers fail to get createdMethod Detail |
static void()
void threadsVsQueueSizeCheck(int entries)
public void start()
public void pauseOperation() throws InterruptedException
public void resumeOperation() throws InterruptedException
public void shutdown()
Initiates the shutdown sequence and waits for this thread to exit.
public static org.apache.xerces.parsers.SAXParser getEventsParser(Object key)
key
- the currently running threadorg.apache.xerces.parser.SAXParser#getContentHandler
,
org.apache.soap.sax.SAXParser#getContentHandler
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |