|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.lang.Thread | +--org.opennms.bb.dp.common.components.PollerThread | +--org.opennms.bb.dp.actiond.components.ActiondEventListener
ActiondEventListener extends the PollerThread for the pause/resume/shutdown functionality
Listens for events sent as XML over JSDT from the event daemon (eventd). Received data as 'EventsReader'(conatining the input stream) is added to the 'listenerQ'
It also maintains a pool of RunnableConsumerThreads that read and run the EventsReader objects added to the listenerQ to actually parse the input streams to events('EventBlocks') in order to extract any automatic actions associated with the event - the 'EventsReader's are then added to the 'actionQ' where they are read by 'ExecuteAction' threads and the actions actually executed by launching a new process.
Field Summary | |
private static int |
INIT_NUM_READERS
The initial number of threads. |
private PCQueue |
m_actionQ
The queue to which completed reader objects are sent for further processing. |
private List |
m_eventReaders
The RunnableConsumerThread thread pool. |
private ActiondEventReceiver |
m_eventReceiver
The handler for events coming in through JSDT from eventd. |
private static Map |
m_eventsParserPool
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 PCQueue |
m_listenerQ
The queue to which the incoming events are added. |
private static int |
max_readers
The max number of RunnableConsumerThreads that should be started by the manager. |
private static String |
PROP_MAX_EVENT_LISTENER_THREADS
The property name that contains the maximum number of threads to be used by the ActiondEventListenr for parsing event XML streams. |
Fields inherited from class org.opennms.bb.dp.common.components.PollerThread |
m_curOpStatus, STATUS_MASK, STATUS_NORMAL, STATUS_PAUSED, STATUS_PAUSING, STATUS_RESUMING, STATUS_SHUTDOWN, STATUS_STARTING, STATUS_TERMINATING |
Fields inherited from class java.lang.Thread |
contextClassLoader, daemon, eetop, group, inheritableThreadLocals, inheritedAccessControlContext, MAX_PRIORITY, MIN_PRIORITY, name, NORM_PRIORITY, priority, single_step, stillborn, stopThreadPermission, target, threadInitNumber, threadLocals, threadQ |
Constructor Summary | |
ActiondEventListener(PCQueue actionQ)
Creates the ActiondEventListener thread of actiond that listens for events via JSDT from eventd |
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 |
run()
Loop through and keep track of the status changes. |
void |
shutdown()
Initiates the shutdown sequence and waits for this thread to exit. |
protected void |
threadsVsQueueSizeCheck()
After each read from the listenerQ, 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 org.opennms.bb.dp.common.components.PollerThread |
getCtrlStatus, getOpStatus, pauseOperation, pauseThread, resumeOperation, resumeThread, setCtrlStatus, setOpStatus, setUserStatus, shutdownThread |
Methods inherited from class java.lang.Thread |
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, exit, getContextClassLoader, getName, getPriority, getThreadGroup, init, interrupt, interrupt0, interrupted, isAlive, isDaemon, isInterrupted, isInterrupted, join, join, join, nextThreadNum, registerNatives, resume, resume0, setContextClassLoader, setDaemon, setName, setPriority, setPriority0, sleep, sleep, start, stop, stop, stop0, suspend, suspend0, toString, yield |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
private static final String PROP_MAX_EVENT_LISTENER_THREADS
The property name that contains the maximum number of threads to be used by the ActiondEventListenr for parsing event XML streams.
private static int INIT_NUM_READERS
The initial number of threads.
private PCQueue m_listenerQ
The queue to which the incoming events are added.
private PCQueue m_actionQ
The queue to which completed reader objects are sent for further processing.
private ActiondEventReceiver m_eventReceiver
The handler for events coming in through JSDT from eventd.
private static int max_readers
The max number of RunnableConsumerThreads that should be started by the manager.
private List m_eventReaders
private static Map m_eventsParserPool
Constructor Detail |
public ActiondEventListener(PCQueue actionQ) throws ActiondEventListenerException
Creates the ActiondEventListener thread of actiond that listens for events via JSDT from eventd
The ActiondEventListener 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 listenerQ)
throws
- ActiondEventListenerException if any of the handlers fail to get createdMethod Detail |
static void()
protected void threadsVsQueueSizeCheck()
public void run()
run
in class Thread
public void shutdown()
Initiates the shutdown sequence and waits for this thread to exit.
shutdown
in class PollerThread
org.opennms.bb.dp.common.components.PollerThread
PollerThread.STATUS_TERMINATING
,
Object.notifyAll()
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 |