|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.commons.pipeline.testFramework.TestStage
public class TestStage
| Field Summary | |
|---|---|
boolean |
initialized
|
boolean |
postprocessed
|
boolean |
preprocessed
|
List<Object> |
processedObjects
|
boolean |
released
|
| Constructor Summary | |
|---|---|
TestStage(int index)
Construct a TestStage with a numeric index used to easily identify this stage. |
|
| Method Summary | |
|---|---|
int |
getIndex()
|
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). |
String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public List<Object> processedObjects
public boolean initialized
public boolean preprocessed
public boolean postprocessed
public boolean released
| Constructor Detail |
|---|
public TestStage(int index)
getIndex and toString methods use this index.
index - acts as an identification number| Method Detail |
|---|
public int getIndex()
public void init(StageContext context)
StageInitialization 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.
init in interface Stagecontext - the StageContext within which the stage sill be run
public void preprocess()
throws StageException
Stage
preprocess in interface StageStageException - any checked Exception thrown by the implementation should
be wrapped in a StageException
public void process(Object obj)
throws StageException
StageFeeder. This Feeder can be obtained from
the stage context made available during initialization.
NOTE: Implementations of this method must be thread-safe!
process in interface Stageobj - an object to be processed
StageException - any checked Exception thrown by the implementation should
be wrapped in a StageException
public void postprocess()
throws StageException
Stage
postprocess in interface StageStageException - any checked Exception thrown by the implementation should
be wrapped in a StageExceptionpublic void release()
Stage
release in interface Stagepublic String toString()
toString in class Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||