org.opennms.bb.dp.actiond
Class Actiond

java.lang.Object
  |
  +--java.lang.Thread
        |
        +--org.opennms.bb.dp.common.components.PollerThread
              |
              +--org.opennms.bb.dp.actiond.Actiond
All Implemented Interfaces:
Runnable

public class Actiond
extends PollerThread

Actiond listens for events coming from eventd over JSDT. The XML stream is validated and parsed in order to extract any auto actions. These actions are added to a queue and processed by a pool of runnable consumer threads. Actions are executed as separate processes, monitored for termination (terminated forcefully if a timeout expires) and then results are logged to a file.

Version:
$Revision: 1.2 $
Author:
Mike/A>, OpenNMS.org

Field Summary
private  PCQueue m_actionQ
          the queue between the ActiondEventListener and the execManager
private  ActiondEventListener m_eventListener
          The thread that listens to incoming threads
private  ActionLaunchManager m_launchManager
          the thread that manages the pool of runnable consumer threads which launch the auto actions
private static Properties m_properties
          The properties that are specific to the Actiond process.
 
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
Actiond()
          Actiond constructor creates the ActiondEventListener to listen for events..
 
Method Summary
(package private) static void ()
          Copy the System properties and then load the bluebird and Actiond specific files into the property object.
static Properties getProperties()
           
static String getProperty(String key)
           
static void main(String[] args)
          Start up Actiond
 void run()
          Loop through and wait for status changes - if a status change is detected, all the threads are informed of the status change for appropriate action to be taken
 void shutdown()
          Initiates the shutdown sequence and waits for this thread to exit.
 void start()
          Start all the threads of Actiond
 
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, 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

m_eventListener

private ActiondEventListener m_eventListener
The thread that listens to incoming threads

m_launchManager

private ActionLaunchManager m_launchManager
the thread that manages the pool of runnable consumer threads which launch the auto actions

m_actionQ

private PCQueue m_actionQ
the queue between the ActiondEventListener and the execManager

m_properties

private static Properties m_properties

The properties that are specific to the Actiond process. The properties are a combination of the JVM's system properties, plus the inclusion of the OpenNMS specific property files. There are two additional files that are loaded, if the system properties are correctly set.

In order to properly load the OpenNMS specific file(s) their location must be known in advance. Instead of hard coding the location of the files, the files are referenced by properties. The following list declares the properites that reference the specific files. The property files are loaded in the order they appear in the list.

Currently the string returned for the propertyFile(s) must be a file on the local filesystem. Later support for remote files via HTTP, JSDT, etc al may be supported.

Constructor Detail

Actiond

public Actiond()
        throws ActiondEventListenerException,
               com.sun.media.jsdt.JSDTException
Actiond constructor creates the ActiondEventListener to listen for events..
Throws:
throws - ActiondEventListenerException if the event listener communication channel cannot be set up
throws - JSDTPropertiesException if the JSDT communication channel cannot be established
Method Detail

static void ()

Copy the System properties and then load the bluebird and Actiond specific files into the property object. For more information see the javadoc comment for the m_properties element.

Additionally, this static loading will also look at the debugging options and will setup the Logging Facility. This can only be done after the properties have been loaded.


start

public void start()
Start all the threads of Actiond
Overrides:
start in class Thread

run

public void run()
Loop through and wait for status changes - if a status change is detected, all the threads are informed of the status change for appropriate action to be taken
Overrides:
run in class Thread

shutdown

public void shutdown()

Initiates the shutdown sequence and waits for this thread to exit.

Overrides:
shutdown in class PollerThread
Following copied from class: org.opennms.bb.dp.common.components.PollerThread
See Also:
PollerThread.STATUS_TERMINATING, Object.notifyAll()

getProperties

public static Properties getProperties()
Returns:
all the loaded properties

getProperty

public static String getProperty(String key)
Returns:
value for the specified property

main

public static void main(String[] args)
Start up Actiond