org.glassfish.jersey.process.internal
Interface StagingContext<DATA>

Type Parameters:
DATA - supported transformable data type.
All Known Implementing Classes:
DefaultStagingContext

public interface StagingContext<DATA>

Stage applying context.

Starting at a root, stages are applied and the returned continuation is resolved until a terminal stage, the one that does not return a continuation that could be further followed, is reached. With each stage the registered staging context callback methods are invoked before and after a stage is applied.

Author:
Marek Potociar (marek.potociar at oracle.com)
See Also:
LinearRequestProcessor, HierarchicalRequestProcessor

Method Summary
 void afterStage(Stage<DATA,?> stage, DATA data)
          Callback method invoked after each stage in the continuation of stages is applied.
 void beforeStage(Stage<DATA,?> stage, DATA data)
          Callback method invoked before each stage in the continuation of stages is applied.
 com.google.common.base.Optional<DATA> data()
          Get the processed data in the actual state in the current processing context.
 com.google.common.base.Optional<Stage<DATA,?>> lastStage()
          Get the last stage applied in the current staging context.
 

Method Detail

beforeStage

void beforeStage(Stage<DATA,?> stage,
                 DATA data)
Callback method invoked before each stage in the continuation of stages is applied.

Parameters:
stage - the stage to be applied.
data - the data to be transformed by the stage.

afterStage

void afterStage(Stage<DATA,?> stage,
                DATA data)
Callback method invoked after each stage in the continuation of stages is applied.

Parameters:
stage - the stage recently applied.
data - the stage transformation result.

lastStage

com.google.common.base.Optional<Stage<DATA,?>> lastStage()
Get the last stage applied in the current staging context. The returned stage can be Optional.absent() in case no stage has been applied yet.

Returns:
last stage applied in the current processing context.

data

com.google.common.base.Optional<DATA> data()
Get the processed data in the actual state in the current processing context.

Returns:
actual state of the processed data.


Copyright © 2007-2012 Oracle Corporation. All Rights Reserved. Use is subject to license terms.