org.apache.commons.pipeline
Interface StageDriver

All Known Implementing Classes:
AbstractStageDriver, DedicatedThreadStageDriver, SynchronousStageDriver, ThreadPoolStageDriver

public interface StageDriver

This interface is used to define how processing for a stage is started, stopped, and run. StageDriver implementations may run stages in one or more threads, and use the StageContext interface to provide communication between the stage and the context it is run, usually a pipeline.


Nested Class Summary
static class StageDriver.State
          This enumeration represents possible states of the a stage driver during processing.
 
Method Summary
 void finish()
          This method waits for the stage(s) queue(s) to empty and any processor thread(s) to exit cleanly and then calls release() to release any resources acquired during processing, if possible.
 List<Throwable> getFatalErrors()
          Returns a list of unrecoverable errors that occurred during stage processing.
 Feeder getFeeder()
          This method is used to provide a communication channel between the context in which the driver is being run and the managed stage.
 List<ProcessingException> getProcessingExceptions()
          Returns a list of errors that occurred while processing data objects, along with the objects that were being processed when the errors were generated.
 Stage getStage()
          Returns the Stage being run by this StageDriver.
 StageDriver.State getState()
          Returns the current state of stage processing.
 void start()
          This method is used to start the driver, run the preprocess() method of the attached stage and to then begin processing any objects fed to this driver's Feeder.
 

Method Detail

start

void start()
           throws StageException
This method is used to start the driver, run the preprocess() method of the attached stage and to then begin processing any objects fed to this driver's Feeder.

Throws:
StageException - Thrown if there is an error during stage startup. In most cases, such errors will be handled internally by the driver.

finish

void finish()
            throws StageException
This method waits for the stage(s) queue(s) to empty and any processor thread(s) to exit cleanly and then calls release() to release any resources acquired during processing, if possible.

Throws:
StageException - Thrown if there is an error during driver shutdown. Ordinarily such exceptions will be handled internally.

getFeeder

Feeder getFeeder()
This method is used to provide a communication channel between the context in which the driver is being run and the managed stage.

Returns:
the Feeder used to feed objects to the managed stage for processing.

getStage

Stage getStage()
Returns the Stage being run by this StageDriver.

Returns:
The stage being run by this StageDriver instance

getState

StageDriver.State getState()
Returns the current state of stage processing.

Returns:
The current state

getFatalErrors

List<Throwable> getFatalErrors()
Returns a list of unrecoverable errors that occurred during stage processing.

Returns:
A list of unrecoverable errors that occurred during stage processing.

getProcessingExceptions

List<ProcessingException> getProcessingExceptions()
Returns a list of errors that occurred while processing data objects, along with the objects that were being processed when the errors were generated.

Returns:
The list of non-fatal processing errors.


Copyright © 2004-2009 The Apache Software Foundation. All Rights Reserved.