|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.commons.pipeline.driver.AbstractStageDriver
org.apache.commons.pipeline.driver.DedicatedThreadStageDriver
public class DedicatedThreadStageDriver
This is a very simple implementation of a AbstractStageDriver which spawns a single thread to process a stage.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from interface org.apache.commons.pipeline.StageDriver |
|---|
StageDriver.State |
| Field Summary |
|---|
| Fields inherited from class org.apache.commons.pipeline.driver.AbstractStageDriver |
|---|
context, currentState, errors, faultTolerance, processingExceptions, stage |
| Constructor Summary | |
|---|---|
DedicatedThreadStageDriver(Stage stage,
StageContext context,
BlockingQueue queue,
long timeout,
FaultTolerance faultTolerance)
Creates a new DedicatedThreadStageDriver with the specified thread wait timeout and fault tolerance values. |
|
| Method Summary | |
|---|---|
void |
finish()
Causes processing to shut down gracefully. |
Feeder |
getFeeder()
Return the Feeder used to feed data to the queue of objects to be processed. |
int |
getQueueSize()
Get the size of the queue used by this StageDriver. |
long |
getTimeout()
Get the timeout value (in milliseconds) used by this StageDriver on thread termination. |
void |
start()
Start the processing of the stage. |
| Methods inherited from class org.apache.commons.pipeline.driver.AbstractStageDriver |
|---|
getFatalErrors, getFaultTolerance, getProcessingExceptions, getStage, getState, isInState, recordFatalError, recordProcessingException, setFaultTolerance, setState, testAndSetState |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public DedicatedThreadStageDriver(Stage stage,
StageContext context,
BlockingQueue queue,
long timeout,
FaultTolerance faultTolerance)
stage - The stage that the driver will runcontext - the context in which to run the stagequeue - The object queue to use for storing objects prior to processing. The
default is LinkedBlockingQueuetimeout - The amount of time, in milliseconds, that the worker thread
will wait before checking the processing state if no objects are available
in the thread's queue.faultTolerance - Flag determining the behavior of the driver when
an error is encountered in execution of Stage.process(Object).
If this is set to false, any exception thrown during Stage.process(Object)
will cause the worker thread to halt without executing Stage.postprocess()
(Stage.release() will be called.)| Method Detail |
|---|
public Feeder getFeeder()
getFeeder in interface StageDrivergetFeeder in class AbstractStageDriver
public void start()
throws StageException
start in interface StageDriverstart in class AbstractStageDriverStageException - Thrown if the driver is in an illegal state during startup
public void finish()
throws StageException
finish in interface StageDriverfinish in class AbstractStageDriverStageException - Thrown if the driver is in an illegal state for shutdown.public int getQueueSize()
public long getTimeout()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||