|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface Stagelet
An extension to Handlet
in order to encapsulate
a "stack frame".
There are 2 categories of stagelets. One, the stack-aware which may push other stagelets onto a common stack. Conceptually, these behave like function calls within a function. Two, the stack-unaware which though themselves on the stack, don't push anything else on the stack. These are analogous to a function that doesn't call any other function.
In order to make the analogy to function calls more concrete, the following protocol regarding interaction with the StageletStack is observed. (Although StageletStack does not appear in the signature of any method defined here, still, it's tied to this interface definition.)
Handlet.init(HandletContext)
,
Handlet.read(java.nio.channels.ScatteringByteChannel)
, or
Handlet.write(java.nio.channels.GatheringByteChannel)
method is
invoked.
If any of the above methods pushes another stagelet asynchronously, then the method must return IoState.PROCESSING.
StageletStack
Method Summary | |
---|---|
IoState |
unwind(IoState preState)
Callback method invoked when the previous stage[let] returned DONE. |
Methods inherited from interface com.faunos.util.net.Handlet |
---|
discard, init, read, state, write |
Method Detail |
---|
IoState unwind(IoState preState)
Handlet.discard()
method on the super
interface.
preState
- the state of the previous stage prior to its flipping to
DONE
Stagelet
on the execution
stack, then that stage's unwind()
method will also
be invoked with the same preState
argument.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |