OpenNMS API 1.2.3

org.opennms.netmgt.scriptd
Class Scriptd

java.lang.Object
  extended byorg.opennms.netmgt.scriptd.Scriptd
All Implemented Interfaces:
Fiber, PausableFiber

public final class Scriptd
extends java.lang.Object
implements PausableFiber

This class implements a script execution service. This service subscribes to all events, and passes received events to the set of configured scripts. This services uses the Bean Scripting Framework (BSF) in order to allow scripts to be written in a variety of registered languages.

Author:
Jim Doble , OpenNMS.org

Field Summary
private static java.lang.String LOG4J_CATEGORY
          The log4j category used to log debug messsages and statements.
private  BroadcastEventProcessor m_eventReader
          The broadcast event receiver.
private  Executor m_execution
          The execution launcher
private static Scriptd m_singleton
          The singleton instance.
private  int m_status
          The current status of this fiber
 
Fields inherited from interface org.opennms.core.fiber.PausableFiber
PAUSE_PENDING, PAUSED, RESUME_PENDING
 
Fields inherited from interface org.opennms.core.fiber.Fiber
RUNNING, START_PENDING, STARTING, STATUS_NAMES, STOP_PENDING, STOPPED
 
Constructor Summary
private Scriptd()
          Constructs a new Script execution daemon.
 
Method Summary
static Scriptd getInstance()
          Returns the singular instance of the Scriptd daemon.
 java.lang.String getName()
          Returns the name of the Scriptd service.
 int getStatus()
          Returns the current status of the Scriptd service.
 void init()
          Initialize the Scriptd service.
 void pause()
          Pauses the Scriptd service if its currently running
 void resume()
          Resumes the Scriptd service if its currently paused
 void start()
          Starts the Scriptd service.
 void stop()
          Stops the Scriptd service.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LOG4J_CATEGORY

private static final java.lang.String LOG4J_CATEGORY
The log4j category used to log debug messsages and statements.

See Also:
Constant Field Values

m_singleton

private static final Scriptd m_singleton
The singleton instance.


m_execution

private Executor m_execution
The execution launcher


m_eventReader

private BroadcastEventProcessor m_eventReader
The broadcast event receiver.


m_status

private int m_status
The current status of this fiber

Constructor Detail

Scriptd

private Scriptd()
Constructs a new Script execution daemon.

Method Detail

init

public void init()
Initialize the Scriptd service.


start

public void start()
Starts the Scriptd service. The process of starting the service involves reading the configuration data, starting an event receiver, and creating an execution fiber. If the service is already running then an exception is thrown.

Specified by:
start in interface Fiber
Throws:
java.lang.IllegalStateException - Thrown if the service is already running.

stop

public void stop()
Stops the Scriptd service. If the service is not running then the command is silently discarded.

Specified by:
stop in interface Fiber

getStatus

public int getStatus()
Returns the current status of the Scriptd service.

Specified by:
getStatus in interface Fiber
Returns:
The service's status.

getName

public java.lang.String getName()
Returns the name of the Scriptd service.

Specified by:
getName in interface Fiber
Returns:
The service's name.

pause

public void pause()
Pauses the Scriptd service if its currently running

Specified by:
pause in interface PausableFiber

resume

public void resume()
Resumes the Scriptd service if its currently paused

Specified by:
resume in interface PausableFiber

getInstance

public static Scriptd getInstance()
Returns the singular instance of the Scriptd daemon. There can be only one instance of this service per virtual machine.

Returns:
The singular instance.

OpenNMS API 1.2.3

Generated by eevans on May 29 2005 2015.