Interface AsyncWebRequest
- All Superinterfaces:
- NativeWebRequest, RequestAttributes, WebRequest
- All Known Implementing Classes:
- StandardServletAsyncWebRequest
Extends 
NativeWebRequest with methods for asynchronous request processing.- Since:
- 3.2
- Author:
- Rossen Stoyanchev
- 
Field SummaryFields inherited from interface RequestAttributesREFERENCE_REQUEST, REFERENCE_SESSION, SCOPE_REQUEST, SCOPE_SESSION
- 
Method SummaryModifier and TypeMethodDescriptionvoidaddCompletionHandler(Runnable runnable) Add a handler to invoke when request processing completes.voidaddErrorHandler(Consumer<Throwable> exceptionHandler) Add a handler to invoke when an error occurred while concurrent handling of a request.voidaddTimeoutHandler(Runnable runnable) Add a handler to invoke when concurrent handling has timed out.voiddispatch()Dispatch the request to the container in order to resume processing after concurrent execution in an application thread.booleanWhether asynchronous processing has completed.booleanWhether the request is in async mode following a call tostartAsync().voidsetTimeout(@Nullable Long timeout) Set the time required for concurrent handling to complete.voidMark the start of asynchronous request processing so that when the main processing thread exits, the response remains open for further processing in another thread.Methods inherited from interface NativeWebRequestgetNativeRequest, getNativeRequest, getNativeResponse, getNativeResponseMethods inherited from interface RequestAttributesgetAttribute, getAttributeNames, getSessionId, getSessionMutex, registerDestructionCallback, removeAttribute, resolveReference, setAttributeMethods inherited from interface WebRequestcheckNotModified, checkNotModified, checkNotModified, getContextPath, getDescription, getHeader, getHeaderNames, getHeaderValues, getLocale, getParameter, getParameterMap, getParameterNames, getParameterValues, getRemoteUser, getUserPrincipal, isSecure, isUserInRole
- 
Method Details- 
setTimeoutSet the time required for concurrent handling to complete. This property should not be set when concurrent handling is in progress, i.e. whenisAsyncStarted()istrue.- Parameters:
- timeout- amount of time in milliseconds;- nullmeans no timeout, i.e. rely on the default timeout of the container.
 
- 
addTimeoutHandlerAdd a handler to invoke when concurrent handling has timed out.
- 
addErrorHandler
- 
addCompletionHandlerAdd a handler to invoke when request processing completes.
- 
startAsyncvoid startAsync()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.- Throws:
- IllegalStateException- if async processing has completed or is not supported
 
- 
isAsyncStartedboolean isAsyncStarted()Whether the request is in async mode following a call tostartAsync(). Returns "false" if asynchronous processing never started, has completed, or the request was dispatched for further processing.
- 
dispatchvoid dispatch()Dispatch the request to the container in order to resume processing after concurrent execution in an application thread.
- 
isAsyncCompleteboolean isAsyncComplete()Whether asynchronous processing has completed.
 
-