|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.opennms.bb.dp.actiond.components.ActionLaunchManager
ActionLaunchManager is responsible for launching any auto actions associated with the incoming event - it maintains a pool of 'ActionLauncher' threads to do this.
Field Summary | |
private static long |
COMMAND_TIMEOUT
Length of time (in milliseconds) to wait for a command to finish before forcing it to terminate. |
private static int |
INIT_NUM_LAUNCHERS
The initial number of launcher threads. |
private PCQueue |
m_actionQ
The queue to which the actions that are to be executed are added. |
private List |
m_launcherThreads
The pool of launcher threads. |
private static int |
max_launchers
The max number of threads in the thread pool - this is configurable through the actiond properties. |
private static String |
PROP_COMMAND_TIMEOUT
The property name that contains the number of milliseconds to wait for an external command to complete before considering it hung. |
private static String |
PROP_MAX_ACTION_LAUNCHER_THREADS
The property name that contains the maximum number of threads to be used by the ActionLaunchManager. |
Constructor Summary | |
ActionLaunchManager(PCQueue actionQ)
Constructs the ActionLaunchManager - creates the 'ActionLauncher' thread pool and starts the INIT_NUM_LAUNCHERS number of the threads The maximum number of threads in the pool can be configured via the PROP_MAX_ACTION_LAUNCHER_THREADS property - the maximum number defaults to 10 The command timeout is the number of milliseconds that the launcher should wait for a launched command to complete. |
Method Summary | |
void |
pauseOperation()
This method goes through and pauses all threads in the thread pool |
void |
resumeOperation()
This method goes through and resumes all threads in the thread pool |
void |
shutdown()
This method goes through and shuts down all threads in the thread pool |
protected void |
threadsVsQueueSizeCheck()
After each read from the actionQ, 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 |
|
Field Detail |
private static final String PROP_MAX_ACTION_LAUNCHER_THREADS
The property name that contains the maximum number of threads to be used by the ActionLaunchManager.
private static int INIT_NUM_LAUNCHERS
The initial number of launcher threads.
private static int max_launchers
The max number of threads in the thread pool - this is configurable through the actiond properties.
private static final String PROP_COMMAND_TIMEOUT
The property name that contains the number of milliseconds to wait for an external command to complete before considering it hung.
private static long COMMAND_TIMEOUT
Length of time (in milliseconds) to wait for a command to finish before forcing it to terminate. This value is configurable through the actiond property PROP_COMMAND_TIMEOUT.
private PCQueue m_actionQ
The queue to which the actions that are to be executed are added.
private List m_launcherThreads
The pool of launcher threads.
Constructor Detail |
public ActionLaunchManager(PCQueue actionQ)
actionQ
- queue from which actions to be executed are readMethod Detail |
protected void threadsVsQueueSizeCheck()
public void pauseOperation()
public void resumeOperation()
public void shutdown()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |