|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface Stage
A Stage represents a set of tasks that can be performed on objects
in a queue, and methods used to communicate with other stages
in a Pipeline
.
Method Summary | |
---|---|
void |
init(StageContext context)
Initialization takes place when the stage is added to a pipeline. |
void |
postprocess()
Implementations of this method should do any additional processing or finalization necessary after all data objects have been processed by the stage. |
void |
preprocess()
Implementations of this method should perform any necessary setup that needs to be done before any data is processed. |
void |
process(Object obj)
Implementations of this method should atomically process a single data object and transfer any feed objects resulting from this processing to the downstream Feeder . |
void |
release()
Implementations of this method should clean up any lingering resources that might otherwise be left allocated if an exception is thrown during processing (or pre/postprocessing). |
Method Detail |
---|
void init(StageContext context)
Initialization takes place when the stage is added to a pipeline. Implementations of this method should perform any necessary setup that is required for the driver to be able to correctly run the stage.
NOTE: Since this method is run when the stage is added to the pipeline, certain information (such as the downstream feeder for the stage) may not yet be available until the pipeline is fully constructoed.
context
- the StageContext
within which the stage sill be runvoid preprocess() throws StageException
StageException
- any checked Exception thrown by the implementation should
be wrapped in a StageException
void process(Object obj) throws StageException
Feeder
. This Feeder
can be obtained from
the stage context made available during initialization
.
NOTE: Implementations of this method must be thread-safe!
obj
- an object to be processed
StageException
- any checked Exception thrown by the implementation should
be wrapped in a StageException
void postprocess() throws StageException
StageException
- any checked Exception thrown by the implementation should
be wrapped in a StageException
void release()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |