AsyncWebRequest.
The servlet and all filters involved in an async request must have async
support enabled using the Servlet API or by adding an
<async-supported>true</async-supported> element to servlet and filter
declarations in web.xml.
| Modifier and Type | Field and Description |
|---|---|
| private final AtomicBoolean | |
| private AsyncContext | |
| private final List | |
| private final List | |
| private Long | |
| private final List |
| Access | Constructor and Description |
|---|---|
| public | StandardServletAsyncWebRequest(HttpServletRequest
current HTTP request request, HttpServletResponse current HTTP response response)Create a new instance for the given request/response pair. |
| Modifier and Type | Method and Description |
|---|---|
| public void | addCompletionHandler(Runnable runnable)
Implements org. |
| public void | addErrorHandler(Consumer<Throwable> exceptionHandler)
Implements org. |
| public void | addTimeoutHandler(Runnable timeoutHandler)
Implements org. |
| public void | dispatch()
Implements org. |
| public boolean | isAsyncComplete()
Implements org. |
| public boolean | isAsyncStarted()
Implements org. startAsync().
|
| public void | onComplete(AsyncEvent
Provides access to the objects associated with the event event)Implements jakarta. AsyncContext#complete() has been processed by the container.
|
| public void | onError(AsyncEvent
Provides access to the objects associated with the event event)Implements jakarta. |
| public void | onStartAsync(AsyncEvent
Provides access to the objects associated with the event event)Implements jakarta. ServletRequest#startAsync() after the completion of the
AsyncContext to which this listener was added.
|
| public void | onTimeout(AsyncEvent
Provides access to the objects associated with the event event)Implements jakarta. |
| public void | setTimeout(Long
amount of time in milliseconds; timeout)null means no
timeout, i.e. rely on the default timeout of the container.Implements org. |
| public void | startAsync()
Implements org. |
| asyncCompleted | back to summary |
|---|---|
| private final AtomicBoolean asyncCompleted | |
| asyncContext | back to summary |
|---|---|
| private AsyncContext asyncContext
| |
| completionHandlers | back to summary |
|---|---|
| private final List<Runnable> completionHandlers | |
| exceptionHandlers | back to summary |
|---|---|
| private final List<Consumer<Throwable>> exceptionHandlers | |
| timeout | back to summary |
|---|---|
| private Long timeout
| |
| timeoutHandlers | back to summary |
|---|---|
| private final List<Runnable> timeoutHandlers | |
| StandardServletAsyncWebRequest | back to summary |
|---|---|
| public StandardServletAsyncWebRequest(HttpServletRequest request, HttpServletResponse response) Create a new instance for the given request/response pair.
| |
| addCompletionHandler | back to summary |
|---|---|
| public void addCompletionHandler(Runnable runnable) Implements org. Doc from org. Add a handler to invoke when request processing completes.
| |
| addErrorHandler | back to summary |
|---|---|
| public void addErrorHandler(Consumer<Throwable> exceptionHandler) Implements org. Doc from org. Add a handler to invoke when an error occurred while concurrent handling of a request.
| |
| addTimeoutHandler | back to summary |
|---|---|
| public void addTimeoutHandler(Runnable timeoutHandler) Implements org. Doc from org. Add a handler to invoke when concurrent handling has timed out.
| |
| dispatch | back to summary |
|---|---|
| public void dispatch() Implements org. Doc from org. Dispatch the request to the container in order to resume processing after concurrent execution in an application thread.
| |
| isAsyncComplete | back to summary |
|---|---|
| public boolean isAsyncComplete() Implements org. Whether async request processing has completed. It is important to avoid use of request and response objects after async processing has completed. Servlet containers often re-use them.
| |
| isAsyncStarted | back to summary |
|---|---|
| public boolean isAsyncStarted() Implements org. Doc from org. Whether the request is in async mode following a call to
| |
| onComplete | back to summary |
|---|---|
| public void onComplete(AsyncEvent event) throws IOException Implements jakarta. Doc from jakarta. This event is fired after the call to
| |
| onError | back to summary |
|---|---|
| public void onError(AsyncEvent event) throws IOException Implements jakarta. Doc from jakarta. This event is fired if an error occurs during an asynchronous operation but before the container takes any action as a result of the error.
| |
| onStartAsync | back to summary |
|---|---|
| public void onStartAsync(AsyncEvent event) throws IOException Implements jakarta. Doc from jakarta. This event is fired if new call is made to
| |
| onTimeout | back to summary |
|---|---|
| public void onTimeout(AsyncEvent event) throws IOException Implements jakarta. Doc from jakarta. This event is fired if an asynchronous operation times out but before the container takes any action as a result of the timeout.
| |
| setTimeout | back to summary |
|---|---|
| public void setTimeout(Long timeout) Implements org. In Servlet 3 async processing, the timeout period begins after the container processing thread has exited.
| |
| startAsync | back to summary |
|---|---|
| public void startAsync() Implements org. Doc from org. Mark the start of asynchronous request processing so that when the main processing thread exits, the response remains open for further processing in another thread.
| |