| Modifier and Type | Class and Description |
|---|---|
| public static class |
| Modifier and Type | Field and Description |
|---|---|
| pack-priv volatile ServletChannelState |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public void | addListener(final AsyncListener
the AsyncListener to be registered listener, final ServletRequest the ServletRequest that will be included in the AsyncEvent request, final ServletResponse the ServletResponse that will be included in the AsyncEvent response)Implements jakarta. AsyncListener with the most recent asynchronous cycle that was started by a call to one
of the ServletRequest#startAsync methods.
|
| public void | addListener(AsyncListener
the AsyncListener to be registered listener)Implements jakarta. AsyncListener with the most recent asynchronous cycle that was started by a call to one
of the ServletRequest#startAsync methods.
|
| public void | complete()
Implements jakarta. |
| public <T extends AsyncListener> T | createListener(Class<T>
the AsyncListener class to instantiate clazz)Implements jakarta. AsyncListener class.
|
| public void | dispatch()
Implements jakarta. |
| public void | dispatch(String
the path of the dispatch target, scoped to the ServletContext from which this AsyncContext was
initialized path)Implements jakarta. |
| public void | dispatch(ServletContext
the ServletContext of the dispatch target context, String the path of the dispatch target, scoped to the given ServletContext path)Implements jakarta. |
| public ServletRequest | getRequest()
Implements jakarta. ServletRequest#startAsync() or
ServletRequest#startAsync(ServletRequest, ServletResponse).
|
| public ServletResponse | getResponse()
Implements jakarta. ServletRequest#startAsync() or
ServletRequest#startAsync(ServletRequest, ServletResponse).
|
| public long | getTimeout()
Implements jakarta. |
| public boolean | hasOriginalRequestAndResponse()
Implements jakarta. |
| public void | |
| public void | setTimeout(long
the timeout in milliseconds timeout)Implements jakarta. |
| public void | start(final Runnable
the asynchronous handler task)Implements jakarta. |
| pack-priv ServletChannelState |
| _state | back to summary |
|---|---|
| pack-priv volatile ServletChannelState _state | |
| AsyncContextState | back to summary |
|---|---|
| public AsyncContextState(ServletChannelState state) | |
| addListener | back to summary |
|---|---|
| public void addListener(final AsyncListener listener, final ServletRequest request, final ServletResponse response) 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
| |
| addListener | back to summary |
|---|---|
| public void addListener(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
| |
| complete | back to summary |
|---|---|
| public 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
| |
| createListener | back to summary |
|---|---|
| public <T extends AsyncListener> T createListener(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(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(ServletContext context, 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
| |
| 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.
| |
| 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.
| |
| reset | back to summary |
|---|---|
| public void reset() | |
| setTimeout | back to summary |
|---|---|
| public void setTimeout(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
| |
| start | back to summary |
|---|---|
| public void start(final Runnable task) 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. | |
| state | back to summary |
|---|---|
| pack-priv ServletChannelState state() | |
| Modifier and Type | Field and Description |
|---|---|
| private final AsyncListener | |
| private final ServletRequest | |
| private final ServletResponse |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public AsyncListener | |
| public void | onComplete(AsyncEvent
the AsyncEvent indicating that an asynchronous operation has been completed event)Implements jakarta. |
| public void | onError(AsyncEvent
the AsyncEvent indicating that an asynchronous operation has failed to complete event)Implements jakarta. |
| public void | onStartAsync(AsyncEvent
the AsyncEvent indicating that a new asynchronous cycle is being initiated event)Implements jakarta. ServletRequest#startAsync methods.
|
| public void | onTimeout(AsyncEvent
the AsyncEvent indicating that an asynchronous operation has timed out event)Implements jakarta. |
| _listener | back to summary |
|---|---|
| private final AsyncListener _listener | |
| _request | back to summary |
|---|---|
| private final ServletRequest _request | |
| _response | back to summary |
|---|---|
| private final ServletResponse _response | |
| WrappedAsyncListener | back to summary |
|---|---|
| public WrappedAsyncListener(AsyncListener listener, ServletRequest request, ServletResponse response) | |
| getListener | back to summary |
|---|---|
| public AsyncListener getListener() | |
| onComplete | back to summary |
|---|---|
| public void onComplete(AsyncEvent event) throws IOException Implements jakarta. Doc from jakarta. Notifies this AsyncListener that an asynchronous operation has been completed.
The
In addition, if this AsyncListener had been registered via a call to
| |
| onError | back to summary |
|---|---|
| public void onError(AsyncEvent event) throws IOException Implements jakarta. Doc from jakarta. Notifies this AsyncListener that an asynchronous operation has failed to complete.
The
In addition, if this AsyncListener had been registered via a call to
| |
| onStartAsync | back to summary |
|---|---|
| public void onStartAsync(AsyncEvent event) throws IOException Implements jakarta. Doc from jakarta. Notifies this AsyncListener that a new asynchronous cycle is being initiated via a call to one of the
The
In addition, if this AsyncListener had been registered via a call to
This AsyncListener will not receive any events related to the new asynchronous cycle unless it registers itself (via
a call to
| |
| onTimeout | back to summary |
|---|---|
| public void onTimeout(AsyncEvent event) throws IOException Implements jakarta. Doc from jakarta. Notifies this AsyncListener that an asynchronous operation has timed out.
The
In addition, if this AsyncListener had been registered via a call to
| |