Package org.eclipse.jetty.server
Class HttpChannelState
java.lang.Object
org.eclipse.jetty.server.HttpChannelState
Implementation of AsyncContext interface that holds the state of request-response cycle.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumThe actions to take as the channel moves from state to state.static enum -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanvoidaddListener(javax.servlet.AsyncListener listener) voidasyncError(Throwable failure) protected voidprotected voidcancelTimeout(AsyncContextEvent event) booleanvoidcomplete()protected voidbooleanprotected voidvoidgetAttribute(String name) javax.servlet.ServletResponsejavax.servlet.ServletResponsegetState()longhandling()booleanhasListener(javax.servlet.AsyncListener listener) booleanisAsync()booleanbooleanbooleanisIdle()booleanbooleanbooleanbooleanbooleanbooleanvoidCalled to indicate that some content was produced and is ready for consumption.protected voidbooleanvoidCalled to indicate that the content is being consumed.booleanCalled to signal that the channel is ready for a callback.voidCalled to indicate that no content is currently available, more content has been demanded and may be available, but that a handling thread may need to produce (fill/parse) it.protected voidbooleanbooleanprotected voidrecycle()voidremoveAttribute(String name) protected voidvoidvoidsetAttribute(String name, Object attribute) voidsetTimeout(long ms) voidstartAsync(AsyncContextEvent event) protected voidtimeout()toString()protected HttpChannelState.Actionunhandle()Signal that the HttpConnection has finished handling the request.voidupgrade()
-
Constructor Details
-
HttpChannelState
-
-
Method Details
-
getState
-
addListener
public void addListener(javax.servlet.AsyncListener listener) -
hasListener
public boolean hasListener(javax.servlet.AsyncListener listener) -
isSendError
public boolean isSendError() -
setTimeout
public void setTimeout(long ms) -
getTimeout
public long getTimeout() -
getAsyncContextEvent
-
toString
-
getStatusString
-
commitResponse
public boolean commitResponse() -
partialResponse
public boolean partialResponse() -
completeResponse
public boolean completeResponse() -
isResponseCommitted
public boolean isResponseCommitted() -
isResponseCompleted
public boolean isResponseCompleted() -
abortResponse
public boolean abortResponse() -
handling
- Returns:
- Next handling of the request should proceed
-
unhandle
Signal that the HttpConnection has finished handling the request. For blocking connectors, this call may block if the request has been suspended (startAsync called).- Returns:
- next actions be handled again (eg because of a resume that happened before unhandle was called)
-
startAsync
-
dispatch
-
timeout
protected void timeout() -
onTimeout
protected void onTimeout() -
complete
public void complete() -
asyncError
-
onError
-
sendError
-
completing
protected void completing() -
completed
-
recycle
protected void recycle() -
upgrade
public void upgrade() -
scheduleDispatch
protected void scheduleDispatch() -
cancelTimeout
protected void cancelTimeout() -
cancelTimeout
-
isIdle
public boolean isIdle() -
isExpired
public boolean isExpired() -
isInitial
public boolean isInitial() -
isSuspended
public boolean isSuspended() -
isAsyncStarted
public boolean isAsyncStarted() -
isAsync
public boolean isAsync() -
getBaseRequest
-
getHttpChannel
-
getContextHandler
-
getServletResponse
public javax.servlet.ServletResponse getServletResponse() -
getServletResponse
-
getAttribute
-
removeAttribute
-
setAttribute
-
onReadReady
public boolean onReadReady()Called to signal that the channel is ready for a callback.- Returns:
- true if woken
-
onReadEof
public boolean onReadEof() -
onContentAdded
public void onContentAdded()Called to indicate that some content was produced and is ready for consumption. -
onReadIdle
public void onReadIdle()Called to indicate that the content is being consumed. -
onReadUnready
public void onReadUnready()Called to indicate that no content is currently available, more content has been demanded and may be available, but that a handling thread may need to produce (fill/parse) it. -
isInputUnready
public boolean isInputUnready() -
onWritePossible
public boolean onWritePossible()
-