spring-framework / org.springframework.web.context.request.async / StandardServletAsyncWebRequest

StandardServletAsyncWebRequest

open class StandardServletAsyncWebRequest : ServletWebRequest, AsyncWebRequest, AsyncListener

A Servlet 3.0 implementation of 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.

Author
Rossen Stoyanchev

Since
3.2

Constructors

<init>

StandardServletAsyncWebRequest(request: HttpServletRequest, response: HttpServletResponse)

Create a new instance for the given request/response pair.

Functions

addCompletionHandler

open fun addCompletionHandler(runnable: Runnable): Unit

addErrorHandler

open fun addErrorHandler(exceptionHandler: Consumer<Throwable>): Unit

addTimeoutHandler

open fun addTimeoutHandler(timeoutHandler: Runnable): Unit

dispatch

open fun dispatch(): Unit

isAsyncComplete

open fun isAsyncComplete(): Boolean

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

open fun isAsyncStarted(): Boolean

onComplete

open fun onComplete(event: AsyncEvent): Unit

onError

open fun onError(event: AsyncEvent): Unit

onStartAsync

open fun onStartAsync(event: AsyncEvent): Unit

onTimeout

open fun onTimeout(event: AsyncEvent): Unit

setTimeout

open fun setTimeout(timeout: Long): Unit

In Servlet 3 async processing, the timeout period begins after the container processing thread has exited.

startAsync

open fun startAsync(): Unit