Class NoSupportAsyncWebRequest
- java.lang.Object
- org.springframework.web.context.request.AbstractRequestAttributes
- org.springframework.web.context.request.ServletRequestAttributes
- org.springframework.web.context.request.ServletWebRequest
- org.springframework.web.context.request.async.NoSupportAsyncWebRequest
- All Implemented Interfaces:
AsyncWebRequest,NativeWebRequest,RequestAttributes,WebRequest
public class NoSupportAsyncWebRequest extends ServletWebRequest implements AsyncWebRequest
AnAsyncWebRequestto use when there is no underlying async support.- Since:
- 3.2
- Author:
- Rossen Stoyanchev
Field Summary
Fields inherited from class org.springframework.web.context.request.ServletRequestAttributes
DESTRUCTION_CALLBACK_NAME_PREFIX, immutableValueTypes
Fields inherited from class org.springframework.web.context.request.AbstractRequestAttributes
requestDestructionCallbacks
Fields inherited from interface org.springframework.web.context.request.RequestAttributes
REFERENCE_REQUEST, REFERENCE_SESSION, SCOPE_GLOBAL_SESSION, SCOPE_REQUEST, SCOPE_SESSION
Constructor Summary
Constructors Constructor Description NoSupportAsyncWebRequest(HttpServletRequest request, HttpServletResponse response)
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddCompletionHandler(Runnable runnable)Add a handle to invoke when request processing completes.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.booleanisAsyncComplete()Whether asynchronous processing has completed.booleanisAsyncStarted()Whether the request is in async mode following a call toAsyncWebRequest.startAsync().voidsetTimeout(Long timeout)Set the time required for concurrent handling to complete.voidstartAsync()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.Methods inherited from class org.springframework.web.context.request.ServletWebRequest
checkNotModified, checkNotModified, checkNotModified, getContextPath, getDescription, getHeader, getHeaderNames, getHeaderValues, getHttpMethod, getLocale, getNativeRequest, getNativeRequest, getNativeResponse, getNativeResponse, getParameter, getParameterMap, getParameterNames, getParameterValues, getRemoteUser, getUserPrincipal, isNotModified, isSecure, isUserInRole, toString
Methods inherited from class org.springframework.web.context.request.ServletRequestAttributes
getAttribute, getAttributeNames, getRequest, getResponse, getSession, getSessionId, getSessionMutex, isImmutableSessionAttribute, registerDestructionCallback, registerSessionDestructionCallback, removeAttribute, resolveReference, setAttribute, updateAccessedSessionAttributes
Methods inherited from class org.springframework.web.context.request.AbstractRequestAttributes
isRequestActive, registerRequestDestructionCallback, removeRequestDestructionCallback, requestCompleted
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.springframework.web.context.request.NativeWebRequest
getNativeRequest, getNativeRequest, getNativeResponse, getNativeResponse
Methods inherited from interface org.springframework.web.context.request.RequestAttributes
getAttribute, getAttributeNames, getSessionId, getSessionMutex, registerDestructionCallback, removeAttribute, resolveReference, setAttribute
Methods inherited from interface org.springframework.web.context.request.WebRequest
checkNotModified, checkNotModified, checkNotModified, getContextPath, getDescription, getHeader, getHeaderNames, getHeaderValues, getLocale, getParameter, getParameterMap, getParameterNames, getParameterValues, getRemoteUser, getUserPrincipal, isSecure, isUserInRole
Constructor Detail
NoSupportAsyncWebRequest
public NoSupportAsyncWebRequest(HttpServletRequest request, HttpServletResponse response)
Method Detail
addCompletionHandler
public void addCompletionHandler(Runnable runnable)
Description copied from interface:AsyncWebRequestAdd a handle to invoke when request processing completes.- Specified by:
addCompletionHandlerin interfaceAsyncWebRequest
setTimeout
public void setTimeout(Long timeout)
Description copied from interface:AsyncWebRequestSet the time required for concurrent handling to complete. This property should not be set when concurrent handling is in progress, i.e. whenAsyncWebRequest.isAsyncStarted()istrue.- Specified by:
setTimeoutin interfaceAsyncWebRequest- Parameters:
timeout- amount of time in milliseconds;nullmeans no timeout, i.e. rely on the default timeout of the container.
addTimeoutHandler
public void addTimeoutHandler(Runnable runnable)
Description copied from interface:AsyncWebRequestAdd a handler to invoke when concurrent handling has timed out.- Specified by:
addTimeoutHandlerin interfaceAsyncWebRequest
isAsyncStarted
public boolean isAsyncStarted()
Description copied from interface:AsyncWebRequestWhether the request is in async mode following a call toAsyncWebRequest.startAsync(). Returns "false" if asynchronous processing never started, has completed, or the request was dispatched for further processing.- Specified by:
isAsyncStartedin interfaceAsyncWebRequest
startAsync
public void startAsync()
Description copied from interface:AsyncWebRequestMark the start of asynchronous request processing so that when the main processing thread exits, the response remains open for further processing in another thread.- Specified by:
startAsyncin interfaceAsyncWebRequest
isAsyncComplete
public boolean isAsyncComplete()
Description copied from interface:AsyncWebRequestWhether asynchronous processing has completed.- Specified by:
isAsyncCompletein interfaceAsyncWebRequest
dispatch
public void dispatch()
Description copied from interface:AsyncWebRequestDispatch the request to the container in order to resume processing after concurrent execution in an application thread.- Specified by:
dispatchin interfaceAsyncWebRequest