Package org.opennms.core.fiber
Interface PausableFiber
-
- All Superinterfaces:
Fiber
- All Known Subinterfaces:
MockServiceDaemonMBean,NotifdQueueHandler,ServiceDaemon,ServiceDaemonMBean
- All Known Implementing Classes:
AbstractServiceDaemon,Actiond,Alarmd,AsteriskGateway,Collectd,Correlator,DefaultQueueHandler,Discovery,EnhancedLinkd,Eventd,EventTranslator,EventTranslator,JettyServer,LegacyScheduler,MockServiceDaemon,Notifd,PassiveStatusd,PassiveStatusKeeper,Poller,Queued,RTCManager,Scriptd,SnmpPoller,Syslogd,Tl1d,Trapd,Vacuumd
public interface PausableFiber extends Fiber
This interface defines an extension to the core
Fiberinterface and adds the methods for pausing and resuming an executable context. The base interface class defines an execution environment, this interface extends the core interface to provide methods for suspending and resuming theFiber.- Author:
- Brian Weaver
-
-
Field Summary
Fields Modifier and Type Field Description static intPAUSE_PENDINGThis state is used to define when aFiberhas begun the process of pausing its operations.static intPAUSEDThis state is used to denote a paused, or otherwise suspendedFiber.static intRESUME_PENDINGThis state is used to denote aFiberrecovering from a paused state to a running status.-
Fields inherited from interface org.opennms.core.fiber.Fiber
RUNNING, START_PENDING, STARTING, STATUS_NAMES, STOP_PENDING, STOPPED
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidpause()This method is used to suspend a currently runningFiber.voidresume()This method is used to resume a suspenededFiber.
-
-
-
Field Detail
-
PAUSE_PENDING
static final int PAUSE_PENDING
This state is used to define when aFiberhas begun the process of pausing its operations. This is the intermedate period where the thread is no longer in theRUNNINGstatus, but not yet to aPAUSEDstatus.- See Also:
- Constant Field Values
-
PAUSED
static final int PAUSED
This state is used to denote a paused, or otherwise suspendedFiber. When aFiberis in this state it should not be preforming any work.- See Also:
- Constant Field Values
-
RESUME_PENDING
static final int RESUME_PENDING
This state is used to denote aFiberrecovering from a paused state to a running status. During this status theFiberis reinitializing any necessary internal elements to re-enter theRUNNINGstate.- See Also:
- Constant Field Values
-
-
Method Detail
-
pause
void pause()
This method is used to suspend a currently runningFiber. When invoked theFiberwill begin the transition to aPAUSEDstatus after changing its internal state, if applicable.
-
resume
void resume()
This method is used to resume a suspenededFiber. If the thread is already running then this method should have no effect on the currentFiber.
-
-