Top Description Inners Fields Constructors Methods
org.eclipse.jetty.ee10.servlet

public Class ServletChannelState

extends Object
Class Inheritance
Imports
java.util.ArrayList, .List, java.util.concurrent.TimeUnit, .TimeoutException, jakarta.servlet.AsyncListener, .ServletContext, .UnavailableException, jakarta.servlet.http.HttpServletRequest, org.eclipse.jetty.http.HttpException, .HttpStatus, org.eclipse.jetty.io.QuietException, org.eclipse.jetty.server.Request, .Response, org.eclipse.jetty.server.handler.ErrorHandler, org.eclipse.jetty.util.thread.AutoLock, .Scheduler, org.slf4j.Logger, .LoggerFactory

holder of the state of request-response cycle.

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static enum
ServletChannelState.Action

The actions to take as the channel moves from state to state.

private static enum
private static enum
private static enum
public static enum

Field Summary

Modifier and TypeField and Description
private List<AsyncListener>
private boolean
private AsyncContextEvent
private Throwable
private boolean
private boolean
private ServletChannelState.InputState
private final AutoLock
private Thread
private ServletChannelState.OutputState
private ServletChannelState.RequestState
private boolean
private final ServletChannel
private ServletChannelState.State
private long
private static final long
private static final Logger

Constructor Summary

AccessConstructor and Description
protected

Method Summary

Modifier and TypeMethod and Description
public void
abort(Throwable failure)

private boolean
public void
public void
asyncError(Throwable
the error.
failure
)

This method is called when a failure occurs asynchronously to normal handling.

protected void
protected void
public void
protected void
public Throwable
protected void
public void
pack-priv void
errorHandling()

Called when an asynchronous call to ErrorHandler.handle() is about to happen.

pack-priv void
errorHandlingComplete(Throwable
the failure reported by the error handling, or null if there was no failure
failure
)

Called when the Callback passed to ErrorHandler.handle() is completed.

public AsyncContextEvent
public Object
public ServletContextHandler
public ServletChannel
public ServletChannelState.State
public String
private String
public long
public ServletChannelState.Action

Returns:

Next handling of the request should proceed
handling
()

public boolean
public boolean
public boolean
public boolean
pack-priv boolean
public boolean
public boolean
public boolean
public boolean
public boolean
public boolean
public boolean
public boolean
pack-priv AutoLock
lock()

private ServletChannelState.Action
nextAction(boolean handling)

public void
onContentAdded()

Called to indicate that some content was produced and is ready for consumption.

protected void
public boolean
public boolean
public void
onReadIdle()

Called to indicate that the content is being consumed.

public boolean

Returns:

true if woken
onReadReady
()

Called to signal that the channel is ready for a callback.

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.

protected void
public boolean
public void
protected void
public void
pack-priv void
protected void
private void
public void
sendError(int code, String message)

public void
setAttribute(String name, Object attribute)

public void
setTimeout(long ms)

public void
protected void
public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.
private String
protected ServletChannelState.Action

Returns:

next actions be handled again (e.g. because of a resume that happened before unhandle was called)
unhandle
()

Signal that the HttpConnection has finished handling the request.

public void
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

_asyncListenersback to summary
private List<AsyncListener> _asyncListeners
_asyncWritePossibleback to summary
private boolean _asyncWritePossible
_eventback to summary
private AsyncContextEvent _event
_failureback to summary
private Throwable _failure
_failureListenerback to summary
private boolean _failureListener
_initialback to summary
private boolean _initial
_inputStateback to summary
private ServletChannelState.InputState _inputState
_lockback to summary
private final AutoLock _lock
_onTimeoutThreadback to summary
private Thread _onTimeoutThread
_outputStateback to summary
private ServletChannelState.OutputState _outputState
_requestStateback to summary
private ServletChannelState.RequestState _requestState
_sendErrorback to summary
private boolean _sendError
_servletChannelback to summary
private final ServletChannel _servletChannel
_stateback to summary
private ServletChannelState.State _state
_timeoutMsback to summary
private long _timeoutMs
DEFAULT_TIMEOUTback to summary
private static final long DEFAULT_TIMEOUT
LOGback to summary
private static final Logger LOG

Constructor Detail

ServletChannelStateback to summary
protected ServletChannelState(ServletChannel servletChannel)

Method Detail

abortback to summary
public void abort(Throwable failure)
abortResponseback to summary
private boolean abortResponse(Throwable failure)
addListenerback to summary
public void addListener(AsyncListener listener)
asyncErrorback to summary
public void asyncError(Throwable failure)

This method is called when a failure occurs asynchronously to normal handling. If the request is async, we arrange for the exception to be thrown from the normal handling loop and then actually handled by onError(Throwable)

Parameters
failure:Throwable

the error.

cancelTimeoutback to summary
protected void cancelTimeout()
cancelTimeoutback to summary
protected void cancelTimeout(AsyncContextEvent event)
completeback to summary
public void complete()
completedback to summary
protected void completed(Throwable failure)
completeResponseback to summary
public Throwable completeResponse()
completingback to summary
protected void completing()
dispatchback to summary
public void dispatch(ServletContext context, String path)
errorHandlingback to summary
pack-priv void errorHandling()

Called when an asynchronous call to ErrorHandler.handle() is about to happen.

See Also
errorHandlingComplete(Throwable)
errorHandlingCompleteback to summary
pack-priv void errorHandlingComplete(Throwable failure)

Called when the Callback passed to ErrorHandler.handle() is completed.

Parameters
failure:Throwable

the failure reported by the error handling, or null if there was no failure

getAsyncContextEventback to summary
public AsyncContextEvent getAsyncContextEvent()
getAttributeback to summary
public Object getAttribute(String name)
getContextHandlerback to summary
public ServletContextHandler getContextHandler()
getServletChannelback to summary
public ServletChannel getServletChannel()
getStateback to summary
public ServletChannelState.State getState()
getStatusStringback to summary
public String getStatusString()
getStatusStringLockedback to summary
private String getStatusStringLocked()
getTimeoutback to summary
public long getTimeout()
handlingback to summary
public ServletChannelState.Action handling()
Returns:ServletChannelState.Action

Next handling of the request should proceed

hasListenerback to summary
public boolean hasListener(AsyncListener listener)
isAbortedback to summary
public boolean isAborted()
isAsyncback to summary
public boolean isAsync()
isAsyncStartedback to summary
public boolean isAsyncStarted()
isCompletedback to summary
pack-priv boolean isCompleted()
isExpiredback to summary
public boolean isExpired()
isIdleback to summary
public boolean isIdle()
isInitialback to summary
public boolean isInitial()
isInputUnreadyback to summary
public boolean isInputUnready()
isResponseCommittedback to summary
public boolean isResponseCommitted()
isResponseCompletedback to summary
public boolean isResponseCompleted()
isSendErrorback to summary
public boolean isSendError()
isSuspendedback to summary
public boolean isSuspended()
lockback to summary
pack-priv AutoLock lock()
nextActionback to summary
private ServletChannelState.Action nextAction(boolean handling)
onContentAddedback to summary
public void onContentAdded()

Called to indicate that some content was produced and is ready for consumption.

onErrorback to summary
protected void onError(Throwable th)
onIdleTimeoutback to summary
public boolean onIdleTimeout(TimeoutException timeout)
onReadEofback to summary
public boolean onReadEof()
onReadIdleback to summary
public void onReadIdle()

Called to indicate that the content is being consumed.

onReadReadyback to summary
public boolean onReadReady()

Called to signal that the channel is ready for a callback.

Returns:boolean

true if woken

onReadUnreadyback to summary
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.

onTimeoutback to summary
protected void onTimeout()
onWritePossibleback to summary
public boolean onWritePossible()
openOutputback to summary
public void openOutput()
recycleback to summary
protected void recycle()
removeAttributeback to summary
public void removeAttribute(String name)
runInContextback to summary
pack-priv void runInContext(AsyncContextEvent event, Runnable runnable)
scheduleDispatchback to summary
protected void scheduleDispatch()
sendErrorback to summary
private void sendError(Throwable th)
sendErrorback to summary
public void sendError(int code, String message)
setAttributeback to summary
public void setAttribute(String name, Object attribute)
setTimeoutback to summary
public void setTimeout(long ms)
startAsyncback to summary
public void startAsync(AsyncContextEvent event)
timeoutback to summary
protected void timeout()
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object.

Returns:String

a string representation of the object.

Annotations
@Override
toStringLockedback to summary
private String toStringLocked()
unhandleback to summary
protected ServletChannelState.Action 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:ServletChannelState.Action

next actions be handled again (e.g. because of a resume that happened before unhandle was called)

upgradeback to summary
public void upgrade()
org.eclipse.jetty.ee10.servlet back to summary

public final Enum ServletChannelState.Action

extends Enum<ServletChannelState.Action>
Class Inheritance

The actions to take as the channel moves from state to state.

Field Summary

Modifier and TypeField and Description
public static final ServletChannelState.Action
public static final ServletChannelState.Action
public static final ServletChannelState.Action
public static final ServletChannelState.Action
public static final ServletChannelState.Action
public static final ServletChannelState.Action
public static final ServletChannelState.Action
public static final ServletChannelState.Action
public static final ServletChannelState.Action
public static final ServletChannelState.Action

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public static ServletChannelState.Action
public static ServletChannelState.Action[]
Inherited from java.lang.Enum:
clonecompareTodescribeConstableequalsfinalizegetDeclaringClasshashCodenameordinaltoStringvalueOf

Field Detail

ASYNC_DISPATCHback to summary
public static final ServletChannelState.Action ASYNC_DISPATCH
ASYNC_ERRORback to summary
public static final ServletChannelState.Action ASYNC_ERROR
ASYNC_TIMEOUTback to summary
public static final ServletChannelState.Action ASYNC_TIMEOUT
COMPLETEback to summary
public static final ServletChannelState.Action COMPLETE
DISPATCHback to summary
public static final ServletChannelState.Action DISPATCH
READ_CALLBACKback to summary
public static final ServletChannelState.Action READ_CALLBACK
SEND_ERRORback to summary
public static final ServletChannelState.Action SEND_ERROR
TERMINATEDback to summary
public static final ServletChannelState.Action TERMINATED
WAITback to summary
public static final ServletChannelState.Action WAIT
WRITE_CALLBACKback to summary
public static final ServletChannelState.Action WRITE_CALLBACK

Constructor Detail

Actionback to summary
private Action()

Method Detail

valueOfback to summary
public static ServletChannelState.Action valueOf(String name)
valuesback to summary
public static ServletChannelState.Action[] values()
org.eclipse.jetty.ee10.servlet back to summary

private final Enum ServletChannelState.InputState

extends Enum<ServletChannelState.InputState>
Class Inheritance

Field Summary

Modifier and TypeField and Description
public static final ServletChannelState.InputState
public static final ServletChannelState.InputState
public static final ServletChannelState.InputState

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public static ServletChannelState.InputState
public static ServletChannelState.InputState[]
Inherited from java.lang.Enum:
clonecompareTodescribeConstableequalsfinalizegetDeclaringClasshashCodenameordinaltoStringvalueOf

Field Detail

IDLEback to summary
public static final ServletChannelState.InputState IDLE
READYback to summary
public static final ServletChannelState.InputState READY
UNREADYback to summary
public static final ServletChannelState.InputState UNREADY

Constructor Detail

InputStateback to summary
private InputState()

Method Detail

valueOfback to summary
public static ServletChannelState.InputState valueOf(String name)
valuesback to summary
public static ServletChannelState.InputState[] values()
org.eclipse.jetty.ee10.servlet back to summary

private final Enum ServletChannelState.OutputState

extends Enum<ServletChannelState.OutputState>
Class Inheritance

Field Summary

Modifier and TypeField and Description
public static final ServletChannelState.OutputState
public static final ServletChannelState.OutputState
public static final ServletChannelState.OutputState
public static final ServletChannelState.OutputState

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public static ServletChannelState.OutputState
public static ServletChannelState.OutputState[]
Inherited from java.lang.Enum:
clonecompareTodescribeConstableequalsfinalizegetDeclaringClasshashCodenameordinaltoStringvalueOf

Field Detail

ABORTEDback to summary
public static final ServletChannelState.OutputState ABORTED
COMPLETEDback to summary
public static final ServletChannelState.OutputState COMPLETED
IDLEback to summary
public static final ServletChannelState.OutputState IDLE
OPENback to summary
public static final ServletChannelState.OutputState OPEN

Constructor Detail

OutputStateback to summary
private OutputState()

Method Detail

valueOfback to summary
public static ServletChannelState.OutputState valueOf(String name)
valuesback to summary
public static ServletChannelState.OutputState[] values()
org.eclipse.jetty.ee10.servlet back to summary

private final Enum ServletChannelState.RequestState

extends Enum<ServletChannelState.RequestState>
Class Inheritance

Field Summary

Modifier and TypeField and Description
public static final ServletChannelState.RequestState
public static final ServletChannelState.RequestState
public static final ServletChannelState.RequestState
public static final ServletChannelState.RequestState
public static final ServletChannelState.RequestState
public static final ServletChannelState.RequestState
public static final ServletChannelState.RequestState
public static final ServletChannelState.RequestState
public static final ServletChannelState.RequestState

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public static ServletChannelState.RequestState
public static ServletChannelState.RequestState[]
Inherited from java.lang.Enum:
clonecompareTodescribeConstableequalsfinalizegetDeclaringClasshashCodenameordinaltoStringvalueOf

Field Detail

ASYNCback to summary
public static final ServletChannelState.RequestState ASYNC
BLOCKINGback to summary
public static final ServletChannelState.RequestState BLOCKING
COMPLETEback to summary
public static final ServletChannelState.RequestState COMPLETE
COMPLETEDback to summary
public static final ServletChannelState.RequestState COMPLETED
COMPLETINGback to summary
public static final ServletChannelState.RequestState COMPLETING
DISPATCHback to summary
public static final ServletChannelState.RequestState DISPATCH
ERRORINGback to summary
public static final ServletChannelState.RequestState ERRORING
EXPIREback to summary
public static final ServletChannelState.RequestState EXPIRE
EXPIRINGback to summary
public static final ServletChannelState.RequestState EXPIRING

Constructor Detail

RequestStateback to summary
private RequestState()

Method Detail

valueOfback to summary
public static ServletChannelState.RequestState valueOf(String name)
valuesback to summary
public static ServletChannelState.RequestState[] values()
org.eclipse.jetty.ee10.servlet back to summary

public final Enum ServletChannelState.State

extends Enum<ServletChannelState.State>
Class Inheritance

Field Summary

Modifier and TypeField and Description
public static final ServletChannelState.State
public static final ServletChannelState.State
public static final ServletChannelState.State
public static final ServletChannelState.State
public static final ServletChannelState.State

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public static ServletChannelState.State
public static ServletChannelState.State[]
Inherited from java.lang.Enum:
clonecompareTodescribeConstableequalsfinalizegetDeclaringClasshashCodenameordinaltoStringvalueOf

Field Detail

HANDLINGback to summary
public static final ServletChannelState.State HANDLING
IDLEback to summary
public static final ServletChannelState.State IDLE
UPGRADEDback to summary
public static final ServletChannelState.State UPGRADED
WAITINGback to summary
public static final ServletChannelState.State WAITING
WOKENback to summary
public static final ServletChannelState.State WOKEN

Constructor Detail

Stateback to summary
private State()

Method Detail

valueOfback to summary
public static ServletChannelState.State valueOf(String name)
valuesback to summary
public static ServletChannelState.State[] values()