|
||||||||||
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.ActionLauncher
ActionLauncher reads events from the ActiondEventsReader object and runs any/all auto actions defined within the event. ActionLauncher extends the 'PollerThread' to handle the pause/resume/shutdown functionality
Field Summary | |
private PCQueue |
m_actionQ
The queue to which completed reader objects are added. |
private ActionLaunchManager |
m_launchMgr
The action launch manager. |
private long |
m_timeout
Time (in milliseconds) to wait for a command to complete. |
static int |
STATUS_BUSY
This defines the thread specific bits that mask the thread as busy when its status is STATUS_NORMAL. |
static int |
STATUS_IDLE
This defines the thread specific bits that mark the thread as idle when its status is STATUS_NORMAL. |
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 | |
ActionLauncher(ActionLaunchManager launchMgr,
PCQueue actionQ,
long timeout)
Constructs the ActionLauncher thread. |
Method Summary | |
private void |
launchAndWait(String cmd)
Receives a single command string as an argument, instantiates a and starts an AutoExec thread object to execute it, blocks waiting for the action to complete or timeout, and writes the results to the log. |
private void |
processEvents(ActiondEventsReader eventsReader)
For each event contained within the reader object, sequentially execute all auto actions, notifications and trouble ticket actions. |
void |
run()
Loop through and wait for status changes - if status is normal, read an ActiondEventsReader object off of the input actionQ and launch any actions associated with the event in the reader. |
Methods inherited from class org.opennms.bb.dp.common.components.PollerThread |
getCtrlStatus, getOpStatus, pauseOperation, pauseThread, resumeOperation, resumeThread, setCtrlStatus, setOpStatus, setUserStatus, shutdown, shutdownThread |
Methods inherited from class java.lang.Thread |
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final int STATUS_IDLE
This defines the thread specific bits that mark the thread as idle when its status is STATUS_NORMAL.
public static final int STATUS_BUSY
This defines the thread specific bits that mask the thread as busy when its status is STATUS_NORMAL.
private ActionLaunchManager m_launchMgr
The action launch manager.
private PCQueue m_actionQ
The queue to which completed reader objects are added.
private long m_timeout
Time (in milliseconds) to wait for a command to complete.
Constructor Detail |
public ActionLauncher(ActionLaunchManager launchMgr, PCQueue actionQ, long timeout)
launchMgr
- the action launch manageractionQ
- the queue from which actions to be launched are readtimeout
- the number of milliseconds to wait for a command to completeMethod Detail |
private void launchAndWait(String cmd)
Receives a single command string as an argument, instantiates a and starts an AutoExec thread object to execute it, blocks waiting for the action to complete or timeout, and writes the results to the log. If the process times out it will be forcefully terminated by calling the interrupt() method on the ActionExec thread.
cmd
- Command to be executedprivate void processEvents(ActiondEventsReader eventsReader)
For each event contained within the reader object, sequentially execute all auto actions, notifications and trouble ticket actions.
eventsReader
- the reader that has the events w/ actions to be launchedpublic void run()
run
in class Thread
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |