|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.glassfish.jersey.process.internal.DefaultStagingContext<DATA>
DATA - supported transformable data type.public class DefaultStagingContext<DATA>
Default implementation of a staging context.
The skeleton implementation provides support for
tracking last stage applied to the data in the current staging context
as well as default implementation of the
beforeStage and
afterStage callback methods.
| Constructor Summary | |
|---|---|
protected |
DefaultStagingContext()
Default protected constructor that sets the initial value of the last applied stage as well as
actual state of the transformed data to
absent. |
protected |
DefaultStagingContext(Stage<DATA,?> lastStage,
DATA data)
Protected constructor that sets the initial value of the last applied stage as well as
actual state of the transformed data to
a custom stage supplied in the constructor parameter. |
| Method Summary | |
|---|---|
protected void |
after(Stage<DATA,?> stage,
DATA data)
Protected callbacks to be overridden to provide custom implementation executed as part of the the after stage callback method. |
void |
afterStage(Stage<DATA,?> stage,
DATA data)
Callback method invoked after each stage in the continuation of stages is applied. |
protected void |
before(Stage<DATA,?> stage,
DATA data)
Protected callbacks to be overridden to provide custom implementation executed as part of the the before stage callback method. |
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. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
protected DefaultStagingContext()
last applied stage as well as
actual state of the transformed data to
absent.
Note that once the stage applying starts and the staging context
callback methods are invoked, the initial value of the last applied
stage as well as actual state of the transformed data change.
protected DefaultStagingContext(Stage<DATA,?> lastStage,
DATA data)
last applied stage as well as
actual state of the transformed data to
a custom stage supplied in the constructor parameter.
Note that once the stage applying starts and the staging context
callback methods are invoked, the initial value of the last applied
stage as well as actual state of the transformed data change.
lastStage - stage to be initially used as the last applied stage.
Passing null into the constructor will result in an
absent initial last applied stage.data - actual state of the transformed data to be set initially in the
processing context.| Method Detail |
|---|
public final void beforeStage(Stage<DATA,?> stage,
DATA data)
StagingContextapplied.
beforeStage in interface StagingContext<DATA>stage - the stage to be applied.data - the data to be transformed by the stage.
protected void before(Stage<DATA,?> stage,
DATA data)
before stage callback method.
stage - the stage to be applied.data - the data to be transformed by the stage.
public final void afterStage(Stage<DATA,?> stage,
DATA data)
StagingContextapplied.
afterStage in interface StagingContext<DATA>stage - the stage recently applied.data - the stage transformation result.
protected void after(Stage<DATA,?> stage,
DATA data)
after stage callback method.
stage - the stage previously applied.data - the stage transformation result.public final com.google.common.base.Optional<Stage<DATA,?>> lastStage()
StagingContextOptional.absent() in case no stage has been applied yet.
lastStage in interface StagingContext<DATA>public final com.google.common.base.Optional<DATA> data()
StagingContext
data in interface StagingContext<DATA>
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||