OpenNMS API 1.2.3

org.opennms.core.fiber
Interface Fiber

All Known Subinterfaces:
EventReceiver, ExtendedStatusFiber, InitializableFiber, NotifdQueueHandler, PausableFiber
All Known Implementing Classes:
Actiond, Capsd, Client, Collectd, DataSender, DefaultQueueHandler, Dhcpd, Discovery, Eventd, EventQueueProcessor, Executor, Executor, Notifd, OutageManager, PingManager, PingManager.Pinger, Poller, Receiver, Receiver2, ReplyReceiver, RTCManager, RunnableConsumerThreadPool, RunnableConsumerThreadPool.FiberThreadImpl, Scheduler, Scheduler, Scheduler, Scriptd, SuspectEventGenerator, TcpEventReceiver, Threshd, Trapd, TrapQueueProcessor, UdpEventReceiver, Vacuumd, VMTaskFiber, Vulnscand, Xmlrpcd

public interface Fiber

The Fiber interface is similar to the core Java language Threadclass. The Fiber class is used to define a working context, which is the basic feature of a Thread. The differences end there since the Thread class is part of the core language and can only be extended since it is a concrete class.

The Fiber concept is used to represent an implementation defined execution context outside of the core Java language. It provides a very loose definition of what and how a Fiber should behave. This gives a great deal of implementation independence to the implementing classes.

For example, the Fiber interface could be used to represent a one-to-one mapping of a Java Thread. It could be used to represent a thread pool where multiple threads are grouped as one Fiber unit. Additionally, it could be used to defined a new execution environment where multiple Runnable elements are multiplexed over a one or more threads, where the Runnables far exceed the core Java threads.

Author:
Brian Weaver , OpenNMS

Field Summary
static int RUNNING
          This state is used to define the normal runtime condition of a Fiber.
static int START_PENDING
          This is the initial Fiber state.
static int STARTING
          This state is used to define when a Fiber has begun the initilization process.
static java.lang.String[] STATUS_NAMES
          The string names that correspond to the states of the fiber.
static int STOP_PENDING
          This state is used to denote when the Fiber is terminating processing.
static int STOPPED
          This state represents the final resting state of a Fiber.
 
Method Summary
 java.lang.String getName()
          This method is used to return the name of the Fiber.
 int getStatus()
          This method is used to get the current status of the Fiber.
 void start()
          This method is used to start the initilization process of the Fiber, which should eventually transition to a RUNNING status.
 void stop()
          This method is used to stop a currently running Fiber.
 

Field Detail

STATUS_NAMES

public static final java.lang.String[] STATUS_NAMES
The string names that correspond to the states of the fiber.


START_PENDING

public static final int START_PENDING
This is the initial Fiber state. When the Fiber begins it startup process it will transition to the STARTING state. A Fiber in a start pending state has not begun any of the initilization process.

See Also:
Constant Field Values

STARTING

public static final int STARTING
This state is used to define when a Fiber has begun the initilization process. Once the initilization process is completed the Fiber will transition to a RUNNING status.

See Also:
Constant Field Values

RUNNING

public static final int RUNNING
This state is used to define the normal runtime condition of a Fiber. When a Fiber is in this state then it is processing normally.

See Also:
Constant Field Values

STOP_PENDING

public static final int STOP_PENDING
This state is used to denote when the Fiber is terminating processing. This state is always followed by the state ST0PPED.

See Also:
Constant Field Values

STOPPED

public static final int STOPPED
This state represents the final resting state of a Fiber. Depending on the implementation it may be possible to resurect the Fiber from this state.

See Also:
Constant Field Values
Method Detail

start

public void start()
This method is used to start the initilization process of the Fiber, which should eventually transition to a RUNNING status.


stop

public void stop()
This method is used to stop a currently running Fiber. Once invoked the Fiber should begin it's shutdown process. Depending on the implementation, this method may block until the Fiber terminates.


getName

public java.lang.String getName()
This method is used to return the name of the Fiber. The name of the instance is defined by the implementor, but it should be realitively unique when possible.

Returns:
The name of the Fiber.

getStatus

public int getStatus()
This method is used to get the current status of the Fiber. The status of the fiber should be one of the predefined constants of the Fiber interface, or from one of the derived interfaces.

Returns:
The current status of the Fiber.

OpenNMS API 1.2.3

Generated by eevans on May 29 2005 2015.