org.apache.commons.pipeline.driver
Class SynchronousStageDriver
java.lang.Object
org.apache.commons.pipeline.driver.AbstractStageDriver
org.apache.commons.pipeline.driver.SynchronousStageDriver
- All Implemented Interfaces:
- StageDriver
public class SynchronousStageDriver
- extends AbstractStageDriver
This is a non-threaded version of the AbstractStageDriver.
Method Summary |
void |
finish()
Performs postprocessing and releases stage resources, and updates the driver
state accordingly. |
Feeder |
getFeeder()
Get the feeder for the encapsulated stage. |
void |
start()
Performs preprocessing and updates the driver state. |
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 |
SynchronousStageDriver
public SynchronousStageDriver(Stage stage,
StageContext context,
FaultTolerance faultTolerance)
- Creates a new instance of SimpleStageDriver
- Parameters:
stage
- The stage to be runcontext
- The context in which the stage will be run
getFeeder
public Feeder getFeeder()
- Get the feeder for the encapsulated stage. Since the SynchronousStageDriver
is designed to run the stage in the main thread of execution, calls
to
Feeder.feed(Object)
on the returned feeder will trigger processing
of the object fed to the stage.
- Specified by:
getFeeder
in interface StageDriver
- Specified by:
getFeeder
in class AbstractStageDriver
- Returns:
- The Feeder instance for the stage.
start
public void start()
throws StageException
- Performs preprocessing and updates the driver state.
- Specified by:
start
in interface StageDriver
- Specified by:
start
in class AbstractStageDriver
- Throws:
StageException
- Thrown if the driver is in an illegal state to be started or an error occurs
during preprocessing.
finish
public void finish()
throws StageException
- Performs postprocessing and releases stage resources, and updates the driver
state accordingly.
- Specified by:
finish
in interface StageDriver
- Specified by:
finish
in class AbstractStageDriver
- Throws:
StageException
- Thrown if an error occurs during postprocessing
Copyright © 2004-2009 The Apache Software Foundation. All Rights Reserved.