public class AsyncStateMachine extends Object
The internal states that are used are: DISPATCHED - Standard request. Not in Async mode. STARTING - ServletRequest.startAsync() has been called but the request in which that call was made has not finished processing. STARTED - ServletRequest.startAsync() has been called and the request in which that call was made has finished processing. READ_WRITE_OP - Performing an asynchronous read or write. MUST_COMPLETE - complete() has been called before the request in which ServletRequest.startAsync() has finished. As soon as that request finishes, the complete() will be processed. COMPLETING - The call to complete() was made once the request was in the STARTED state. May or may not be triggered by a container thread - depends if start(Runnable) was used TIMING_OUT - The async request has timed out and is waiting for a call to complete(). If that isn't made, the error state will entered. MUST_DISPATCH - dispatch() has been called before the request in which ServletRequest.startAsync() has finished. As soon as that request finishes, the dispatch() will be processed. DISPATCHING - The dispatch is being processed. ERROR - Something went wrong. |-----------------»------| | \|/ | |----------«-------ERROR-----------------------------------«-------------------------------| | | complete() /|\/|\\ | | | | | \ | | | |-----»-------| | \-----------»----------| | | | | | |dispatch() | | | | | \|/ | | | | | |--|timeout() | | | | | post() | | \|/ | post() | | | | |---------- | --»DISPATCHED«---------- | --------------COMPLETING«-----| | | | | | | /|\ | | | /|\ | | | | | | |---»- | ---| | | |--| | | | | ^ ^ | | |startAsync() | timeout() | | | | | | | \ | | | | | | | | | \ | | | | | | | | | \ | | | | | | | | | \ | | | | | \|/ | | | \ \|/ post() | | | | MUST_COMPLETE-«- | ----«------STARTING--»--------- | -------------| ^ | | /|\ /|\ | complete() | | | complete() | | | | | | | | post() | /----------| | | | | ^ |dispatch() | |-----| | / | | | | | | | | | | / | | | | | \|/ | | \|/ \|/ / post() | | | | | MUST_DISPATCH-----«-----| |--«--STARTED«---------«---------| | | | | | /|\ | / | | | | | | | | | |post() / | | ^ | ^ | ^ | | |dispatched() / | |asyncOperation() | | | | | ^ | | / | | | | | | | | | | |-------------/ | |»-READ_WRITE_OP--»---| | | | | | | | | dispatch() | | | | | | | | |post() | | | timeout()| | | | error()| | | | |dispatched() | \|/ \|/ | dispatch()| | |-»--------| | | | |---«---------- | ---DISPATCHING«-----«------ | ------«----| | | | | | | ^ | | | | | | |----| | | | | | | timeout() | | | | | | | | | | | | dispatch() \|/ | | | | |-----------«-----------TIMING_OUT | | | | | | | | | |-------«----------------------------------«------| | | | | complete() | | | | | | |«- | ----«-------------------«-------------------------------«--| | | error() | | complete() | |----------------------------------------------------------------------------|
Constructor and Description |
---|
AsyncStateMachine(AbstractProcessor processor) |
Modifier and Type | Method and Description |
---|---|
boolean |
asyncComplete() |
boolean |
asyncDispatch() |
void |
asyncDispatched() |
void |
asyncError() |
void |
asyncOperation() |
AbstractEndpoint.Handler.SocketState |
asyncPostProcess() |
void |
asyncRun(Runnable runnable) |
void |
asyncStart(AsyncContextCallback asyncCtxt) |
boolean |
asyncTimeout() |
long |
getLastAsyncStart()
Obtain the time that this connection last transitioned to async
processing.
|
boolean |
isAsync() |
boolean |
isAsyncDispatching() |
boolean |
isAsyncError() |
boolean |
isAsyncStarted() |
boolean |
isAsyncTimingOut() |
boolean |
isCompleting() |
void |
recycle() |
public AsyncStateMachine(AbstractProcessor processor)
public boolean isAsync()
public boolean isAsyncDispatching()
public boolean isAsyncStarted()
public boolean isAsyncTimingOut()
public boolean isAsyncError()
public boolean isCompleting()
public long getLastAsyncStart()
System.currentTimeMillis()
) that
this connection last transitioned to asyncpublic void asyncStart(AsyncContextCallback asyncCtxt)
public void asyncOperation()
public AbstractEndpoint.Handler.SocketState asyncPostProcess()
public boolean asyncComplete()
public boolean asyncTimeout()
public boolean asyncDispatch()
public void asyncDispatched()
public void asyncError()
public void asyncRun(Runnable runnable)
public void recycle()
Copyright © 2000-2016 Apache Software Foundation. All Rights Reserved.