| Modifier and Type | Class and Description |
|---|---|
| private static class | |
| private class | |
| private class |
| Modifier and Type | Field and Description |
|---|---|
| private final List | |
| private final Deque | |
| private volatile boolean | |
| private volatile boolean | |
| private boolean | |
| private final HttpServerExchange | |
| private boolean | |
| private Thread | |
| private AsyncContextImpl | |
| private boolean | |
| private final boolean | |
| private final ServletRequest | |
| private final ServletRequestContext | |
| private final ServletResponse | |
| private volatile long | |
| private volatile XnioExecutor. | |
| private final AsyncContextImpl. |
| Access | Constructor and Description |
|---|---|
| public | AsyncContextImpl(final HttpServerExchange exchange, final ServletRequest servletRequest, final ServletResponse servletResponse, final ServletRequestContext servletRequestContext, boolean requestSupplied, final AsyncContextImpl previousAsyncContext)
|
| Modifier and Type | Method and Description |
|---|---|
| public synchronized void | |
| public void | addListener(final AsyncListener
the AsyncListener to be registered listener)Implements jakarta. Registers the given |
| public void | addListener(final AsyncListener
the AsyncListener to be registered listener, final ServletRequest the ServletRequest that will be included in the AsyncEvent servletRequest, final ServletResponse the ServletResponse that will be included in the AsyncEvent servletResponse)Implements jakarta. Registers the given |
| private Executor | |
| public synchronized void | complete()
Implements jakarta. Completes the asynchronous operation that was started on the request that was used to initialze this AsyncContext, closing the response that was used to initialize this AsyncContext. |
| public synchronized void | |
| public <T extends AsyncListener> T | createListener(final Class<T>
the AsyncListener class to instantiate clazz)Implements jakarta. Instantiates the given |
| public void | dispatch()
Implements jakarta. Dispatches the request and response objects of this AsyncContext to the servlet container. |
| public void | dispatch(final String
the path of the dispatch target, scoped to the ServletContext from which this AsyncContext was
initialized path)Implements jakarta. Dispatches the request and response objects of this AsyncContext to the given path. |
| public void | dispatch(final ServletContext
the ServletContext of the dispatch target context, final String the path of the dispatch target, scoped to the given ServletContext path)Implements jakarta. Dispatches the request and response objects of this AsyncContext to the given path scoped to the given context. |
| private void | dispatchAsyncRequest(final ServletDispatcher servletDispatcher, final ServletPathMatch pathInfo, final HttpServerExchange exchange)
|
| private synchronized void | |
| public ServletRequest | getRequest()
Implements jakarta. Gets the request that was used to initialize this AsyncContext by calling |
| public ServletResponse | getResponse()
Implements jakarta. Gets the response that was used to initialize this AsyncContext by calling |
| public long | getTimeout()
Implements jakarta. Gets the timeout (in milliseconds) for this AsyncContext. |
| public void | |
| public void | |
| public boolean | hasOriginalRequestAndResponse()
Implements jakarta. Checks if this AsyncContext was initialized with the original or application-wrapped request and response objects. |
| public synchronized void | |
| public synchronized void | |
| public boolean | |
| public boolean | |
| public boolean | |
| private void | |
| private void | |
| private void | |
| private void | |
| private void | |
| private synchronized void | |
| public synchronized void | setTimeout(final long
the timeout in milliseconds timeout)Implements jakarta. Sets the timeout (in milliseconds) for this AsyncContext. |
| private void | |
| public void | start(final Runnable
the asynchronous handler run)Implements jakarta. Causes the container to dispatch a thread, possibly from a managed thread pool, to run the specified Runnable. |
| private void | |
| public void |
| asyncListeners | back to summary |
|---|---|
| private final List<AsyncContextImpl. | |
| asyncTaskQueue | back to summary |
|---|---|
| private final Deque<Runnable> asyncTaskQueue | |
| complete | back to summary |
|---|---|
| private volatile boolean complete | |
| completedBeforeInitialRequestDone | back to summary |
|---|---|
| private volatile boolean completedBeforeInitialRequestDone | |
| dispatched | back to summary |
|---|---|
| private boolean dispatched | |
| exchange | back to summary |
|---|---|
| private final HttpServerExchange exchange | |
| initialRequestDone | back to summary |
|---|---|
| private boolean initialRequestDone | |
| initiatingThread | back to summary |
|---|---|
| private Thread initiatingThread | |
| previousAsyncContext | back to summary |
|---|---|
| private AsyncContextImpl previousAsyncContext | |
| processingAsyncTask | back to summary |
|---|---|
| private boolean processingAsyncTask | |
| requestSupplied | back to summary |
|---|---|
| private final boolean requestSupplied | |
| servletRequest | back to summary |
|---|---|
| private final ServletRequest servletRequest | |
| servletRequestContext | back to summary |
|---|---|
| private final ServletRequestContext servletRequestContext | |
| servletResponse | back to summary |
|---|---|
| private final ServletResponse servletResponse | |
| timeout | back to summary |
|---|---|
| private volatile long timeout | |
| timeoutKey | back to summary |
|---|---|
| private volatile XnioExecutor. | |
| timeoutTask | back to summary |
|---|---|
| private final AsyncContextImpl. | |
| AsyncContextImpl | back to summary |
|---|---|
| public AsyncContextImpl(final HttpServerExchange exchange, final ServletRequest servletRequest, final ServletResponse servletResponse, final ServletRequestContext servletRequestContext, boolean requestSupplied, final AsyncContextImpl previousAsyncContext) | |
| addAsyncTask | back to summary |
|---|---|
| public synchronized void addAsyncTask(final Runnable runnable) Adds a task to be run to the async context. These tasks are run one at a time, after the initial request is finished. If the request is dispatched before the initial request is complete then these tasks will not be run This method is intended to be used to queue read and write tasks for async streams, to make sure that multiple threads do not end up working on the same exchange at once
| |
| addListener | back to summary |
|---|---|
| public void addListener(final AsyncListener listener) Implements jakarta. Doc from jakarta. Registers the given
The given AsyncListener will receive an AsyncListener instances will be notified in the order in which they were added.
If
| |
| addListener | back to summary |
|---|---|
| public void addListener(final AsyncListener listener, final ServletRequest servletRequest, final ServletResponse servletResponse) Implements jakarta. Doc from jakarta. Registers the given
The given AsyncListener will receive an AsyncListener instances will be notified in the order in which they were added.
The given ServletRequest and ServletResponse objects will be made available to the given AsyncListener via the
| |
| asyncExecutor | back to summary |
|---|---|
| private Executor asyncExecutor() | |
| complete | back to summary |
|---|---|
| public synchronized void complete() Implements jakarta. Doc from jakarta. Completes the asynchronous operation that was started on the request that was used to initialze this AsyncContext, closing the response that was used to initialize this AsyncContext.
Any listeners of type
It is legal to call this method any time after a call to
| |
| completeInternal | back to summary |
|---|---|
| public synchronized void completeInternal(boolean forceComplete) | |
| createListener | back to summary |
|---|---|
| public <T extends AsyncListener> T createListener(final Class<T> clazz) throws ServletException Implements jakarta. Doc from jakarta. Instantiates the given
The returned AsyncListener instance may be further customized before it is registered with this AsyncContext via a
call to one of the The given AsyncListener class must define a zero argument constructor, which is used to instantiate it. This method supports resource injection if the given clazz represents a Managed Bean. See the Jakarta EE platform and CDI specifications for additional details about Managed Beans and resource injection. This method supports any annotations applicable to AsyncListener.
| |
| dispatch | back to summary |
|---|---|
| public void dispatch() Implements jakarta. Doc from jakarta. Dispatches the request and response objects of this AsyncContext to the servlet container.
If the asynchronous cycle was started with The following sequence illustrates how this will work:
This method returns immediately after passing the request and response objects to a container managed thread, on which the dispatch operation will be performed. If this method is called before the container-initiated dispatch that called startAsync has returned to the container, the dispatch operation will be delayed until after the container-initiated dispatch has returned to the container.
The dispatcher type of the request is set to DispatcherType.ASYNC. Unlike
Control over the request and response is delegated to the dispatch target, and the response will be closed when the
dispatch target has completed execution, unless Any errors or exceptions that may occur during the execution of this method must be caught and handled by the container, as follows:
There can be at most one asynchronous dispatch operation per asynchronous cycle, which is started by a call to one of
the
| |
| dispatch | back to summary |
|---|---|
| public void dispatch(final String path) Implements jakarta. Doc from jakarta. Dispatches the request and response objects of this AsyncContext to the given path.
The path parameter is interpreted in the same way as in
All path related query methods of the request must reflect the dispatch target, while the original request URI,
context path, path info, servlet path, and query string may be recovered from the
There can be at most one asynchronous dispatch operation per asynchronous cycle, which is started by a call to one of
the
See | |
| dispatch | back to summary |
|---|---|
| public void dispatch(final ServletContext context, final String path) Implements jakarta. Doc from jakarta. Dispatches the request and response objects of this AsyncContext to the given path scoped to the given context.
The path parameter is interpreted in the same way as in
All path related query methods of the request must reflect the dispatch target, while the original request URI,
context path, path info, servlet path, and query string may be recovered from the
There can be at most one asynchronous dispatch operation per asynchronous cycle, which is started by a call to one of
the
See
| |
| dispatchAsyncRequest | back to summary |
|---|---|
| private void dispatchAsyncRequest(final ServletDispatcher servletDispatcher, final ServletPathMatch pathInfo, final HttpServerExchange exchange) | |
| doDispatch | back to summary |
|---|---|
| private synchronized void doDispatch(final Runnable runnable) | |
| getRequest | back to summary |
|---|---|
| public ServletRequest getRequest() Implements jakarta. Doc from jakarta. Gets the request that was used to initialize this AsyncContext by calling
| |
| getResponse | back to summary |
|---|---|
| public ServletResponse getResponse() Implements jakarta. Doc from jakarta. Gets the response that was used to initialize this AsyncContext by calling
| |
| getTimeout | back to summary |
|---|---|
| public long getTimeout() Implements jakarta. Doc from jakarta. Gets the timeout (in milliseconds) for this AsyncContext.
This method returns the container's default timeout for asynchronous operations, or the timeout value passed to the
most recent invocation of A timeout value of zero or less indicates no timeout.
| |
| handleCompletedBeforeInitialRequestDone | back to summary |
|---|---|
| public void handleCompletedBeforeInitialRequestDone() | |
| handleError | back to summary |
|---|---|
| public void handleError(final Throwable error) | |
| hasOriginalRequestAndResponse | back to summary |
|---|---|
| public boolean hasOriginalRequestAndResponse() Implements jakarta. Doc from jakarta. Checks if this AsyncContext was initialized with the original or application-wrapped request and response objects. This information may be used by filters invoked in the outbound direction, after a request was put into asynchronous mode, to determine whether any request and/or response wrappers that they added during their inbound invocation need to be preserved for the duration of the asynchronous operation, or may be released.
| |
| initialRequestDone | back to summary |
|---|---|
| public synchronized void initialRequestDone() Called by the container when the initial request is finished. If this request has a dispatch or complete call pending then this will be started. | |
| initialRequestFailed | back to summary |
|---|---|
| public synchronized void initialRequestFailed() | |
| isCompletedBeforeInitialRequestDone | back to summary |
|---|---|
| public boolean isCompletedBeforeInitialRequestDone() | |
| isDispatched | back to summary |
|---|---|
| public boolean isDispatched() | |
| isInitialRequestDone | back to summary |
|---|---|
| public boolean isInitialRequestDone() | |
| onAsyncComplete | back to summary |
|---|---|
| private void onAsyncComplete() | |
| onAsyncCompleteAndRespond | back to summary |
|---|---|
| private void onAsyncCompleteAndRespond() | |
| onAsyncError | back to summary |
|---|---|
| private void onAsyncError(final Throwable t) | |
| onAsyncStart | back to summary |
|---|---|
| private void onAsyncStart(final AsyncContext newAsyncContext) | |
| onAsyncTimeout | back to summary |
|---|---|
| private void onAsyncTimeout() | |
| processAsyncTask | back to summary |
|---|---|
| private synchronized void processAsyncTask() | |
| setTimeout | back to summary |
|---|---|
| public synchronized void setTimeout(final long timeout) Implements jakarta. Doc from jakarta. Sets the timeout (in milliseconds) for this AsyncContext.
The timeout applies to this AsyncContext once the container-initiated dispatch during which one of the
The timeout will expire if neither the
If
The default value is
| |
| setupRequestContext | back to summary |
|---|---|
| private void setupRequestContext(final boolean setupRequired) | |
| start | back to summary |
|---|---|
| public void start(final Runnable run) Implements jakarta. Doc from jakarta. Causes the container to dispatch a thread, possibly from a managed thread pool, to run the specified Runnable. The container may propagate appropriate contextual information to the Runnable. | |
| tearDownRequestContext | back to summary |
|---|---|
| private void tearDownRequestContext(final boolean setupRequired) | |
| updateTimeout | back to summary |
|---|---|
| public void updateTimeout() | |
| Modifier and Type | Field and Description |
|---|---|
| pack-priv final AsyncListener | |
| pack-priv final ServletRequest | |
| pack-priv final ServletResponse |
| Access | Constructor and Description |
|---|---|
| private | BoundAsyncListener(final AsyncListener asyncListener, final ServletRequest servletRequest, final ServletResponse servletResponse)
|
| asyncListener | back to summary |
|---|---|
| pack-priv final AsyncListener asyncListener | |
| servletRequest | back to summary |
|---|---|
| pack-priv final ServletRequest servletRequest | |
| servletResponse | back to summary |
|---|---|
| pack-priv final ServletResponse servletResponse | |
| BoundAsyncListener | back to summary |
|---|---|
| private BoundAsyncListener(final AsyncListener asyncListener, final ServletRequest servletRequest, final ServletResponse servletResponse) | |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public void |
| task | back to summary |
|---|---|
| private final Runnable task | |
| TaskDispatchRunnable | back to summary |
|---|---|
| private TaskDispatchRunnable(final Runnable task) | |
| run | back to summary |
|---|---|
| public void run() Implements java. Doc from java. Runs this operation.
| |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public void |
| TimeoutTask | back to summary |
|---|---|
| private TimeoutTask() | |
| run | back to summary |
|---|---|
| public void run() Implements java. Doc from java. Runs this operation.
| |