|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.faunos.util.net.AsynchStagelet
public abstract class AsynchStagelet
A skeletal implementation of an asynchronous stagelet. An instance starts out in the IoState.PROCESSING state. Later, when the task is completed, a stagelet representing the completion of the task is pushed onto the stack.
init(HandletContext)
,
nextStage()
Field Summary | |
---|---|
protected StageletStack |
stack
|
Constructor Summary | |
---|---|
protected |
AsynchStagelet(StageletStack stack)
|
Method Summary | |
---|---|
void |
discard()
Does nothing. |
IoState |
init(HandletContext context)
Asynchronously invokes the nextStage() method, pushes the returned stagelet onto the stack, initializes it, and notifies the container that it is done processing. |
protected abstract Stagelet |
nextStage()
Returns the next stage which will be pushed onto the stack. |
IoState |
read(ScatteringByteChannel in)
Not implemented. |
IoState |
state()
Returns DONE, if unwound; PROCESSING, otherwise. |
IoState |
unwind(IoState preState)
Sets the state to DONE. |
IoState |
write(GatheringByteChannel out)
Not implemented. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected final StageletStack stack
Constructor Detail |
---|
protected AsynchStagelet(StageletStack stack)
Method Detail |
---|
public IoState unwind(IoState preState)
unwind
in interface Stagelet
preState
- the state of the previous stage prior to its flipping to
DONE
public void discard()
discard
in interface Handlet
public IoState init(HandletContext context)
init
in interface Handlet
context
- the context supplied by the instance's container (e.g.
server
public IoState read(ScatteringByteChannel in) throws IOException
read
in interface Handlet
UnsupportedOperationException
IOException
state()
public IoState state()
state
in interface Handlet
public IoState write(GatheringByteChannel out) throws IOException
write
in interface Handlet
UnsupportedOperationException
IOException
state()
protected abstract Stagelet nextStage()
init(HandletContext)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |