Interface Fiber
-
- All Known Subinterfaces:
InitializableFiber,MockServiceDaemonMBean,NotifdQueueHandler,PausableFiber,ServiceDaemon,ServiceDaemonMBean
- All Known Implementing Classes:
AbstractServiceDaemon,Actiond,Alarmd,AsteriskGateway,Collectd,Correlator,DataSender,DefaultQueueHandler,Discovery,EnhancedLinkd,Eventd,EventTranslator,EventTranslator,JettyServer,LegacyScheduler,MockServiceDaemon,Notifd,PassiveStatusd,PassiveStatusKeeper,Poller,Queued,RTCManager,Scriptd,SnmpPoller,Syslogd,Tl1d,Trapd,Vacuumd
public interface FiberThe
Fiberinterface is similar to the core Java languageThreadclass. TheFiberclass is used to define a working context, which is the basic feature of aThread. The differences end there since theThreadclass is part of the core language and can only be extended since it is a concrete class.The
Fiberconcept 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 aFibershould behave. This gives a great deal of implementation independence to the implementing classes.For example, the
Fiberinterface could be used to represent a one-to-one mapping of a JavaThread. It could be used to represent a thread pool where multiple threads are grouped as oneFiberunit. 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
-
-
Field Summary
Fields Modifier and Type Field Description static intRUNNINGThis state is used to define the normal runtime condition of aFiber.static intSTART_PENDINGThis is the initialFiberstate.static intSTARTINGThis state is used to define when aFiberhas begun the Initialization process.static String[]STATUS_NAMESThe string names that correspond to the states of the fiber.static intSTOP_PENDINGThis state is used to denote when theFiberis terminating processing.static intSTOPPEDThis state represents the final resting state of aFiber.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description StringgetName()This method is used to return the name of theFiber.intgetStatus()This method is used to get the current status of theFiber.voidstart()This method is used to start the initialization process of theFiber, which should eventually transition to aRUNNINGstatus.voidstop()This method is used to stop a currently runningFiber.
-
-
-
Field Detail
-
STATUS_NAMES
static final String[] STATUS_NAMES
The string names that correspond to the states of the fiber.
-
START_PENDING
static final int START_PENDING
This is the initialFiberstate. When theFiberbegins it startup process it will transition to theSTARTINGstate. AFiberin a start pending state has not begun any of the initialization process.- See Also:
- Constant Field Values
-
STARTING
static final int STARTING
This state is used to define when aFiberhas begun the Initialization process. Once the initialization process is completed theFiberwill transition to aRUNNINGstatus.- See Also:
- Constant Field Values
-
RUNNING
static final int RUNNING
This state is used to define the normal runtime condition of aFiber. When aFiberis in this state then it is processing normally.- See Also:
- Constant Field Values
-
STOP_PENDING
static final int STOP_PENDING
This state is used to denote when theFiberis terminating processing. This state is always followed by the stateST0PPED.- See Also:
- Constant Field Values
-
STOPPED
static final int STOPPED
This state represents the final resting state of aFiber. Depending on the implementation it may be possible to resurrect theFiberfrom this state.- See Also:
- Constant Field Values
-
-
Method Detail
-
start
void start()
This method is used to start the initialization process of theFiber, which should eventually transition to aRUNNINGstatus.
-
stop
void stop()
This method is used to stop a currently runningFiber. Once invoked theFibershould begin it's shutdown process. Depending on the implementation, this method may block until theFiberterminates.
-
getName
String getName()
This method is used to return the name of theFiber. 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
int getStatus()
This method is used to get the current status of theFiber. The status of the fiber should be one of the predefined constants of theFiberinterface, or from one of the derived interfaces.- Returns:
- The current status of the
Fiber.
-
-