org.springframework.web.servlet.config.annotation

## Class AsyncSupportConfigurer

- java.lang.Object
- - org.springframework.web.servlet.config.annotation.AsyncSupportConfigurer

    public class AsyncSupportConfigurer
    extends Object

Helps with configuring options for asynchronous request processing.

Since:
  3.2
Author:
  Rossen Stoyanchev

### Constructor Summary

Constructors
Constructor and Description
`AsyncSupportConfigurer()`

### Method Summary

Methods
`protected List<CallableProcessingInterceptor>` `getCallableInterceptors()`
`protected List<DeferredResultProcessingInterceptor>` `getDeferredResultInterceptors()`
`protected AsyncTaskExecutor` `getTaskExecutor()`
`protected Long` `getTimeout()`
`AsyncSupportConfigurer` `registerCallableInterceptors(CallableProcessingInterceptor... interceptors)` Configure lifecycle interceptors with callbacks around concurrent request execution that starts when a controller returns a `Callable`.
`AsyncSupportConfigurer` `registerDeferredResultInterceptors(DeferredResultProcessingInterceptor... interceptors)` Configure lifecycle interceptors with callbacks around concurrent request execution that starts when a controller returns a `DeferredResult`.
`AsyncSupportConfigurer` `setDefaultTimeout(long timeout)` Specify the amount of time, in milliseconds, before asynchronous request handling times out.
`AsyncSupportConfigurer` `setTaskExecutor(AsyncTaskExecutor taskExecutor)` Set the default `AsyncTaskExecutor` to use when a controller method returns a `Callable`.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Constructor Detail

#### AsyncSupportConfigurer

    public AsyncSupportConfigurer()

### Method Detail

#### setTaskExecutor

    public AsyncSupportConfigurer setTaskExecutor(AsyncTaskExecutor taskExecutor)

Set the default `AsyncTaskExecutor` to use when a controller method returns a `Callable`. Controller methods can override this default on a per-request basis by returning a `WebAsyncTask`.

By default a `SimpleAsyncTaskExecutor` instance is used, and it's highly recommended to change that default in production since the simple executor does not re-use threads.

Parameters:
  `taskExecutor` - the task executor instance to use by default

#### setDefaultTimeout

    public AsyncSupportConfigurer setDefaultTimeout(long timeout)

Specify the amount of time, in milliseconds, before asynchronous request handling times out. In Servlet 3, the timeout begins after the main request processing thread has exited and ends when the request is dispatched again for further processing of the concurrently produced result.

If this value is not set, the default timeout of the underlying implementation is used, e.g. 10 seconds on Tomcat with Servlet 3.

Parameters:
  `timeout` - the timeout value in milliseconds

#### registerCallableInterceptors

    public AsyncSupportConfigurer registerCallableInterceptors(CallableProcessingInterceptor... interceptors)

Configure lifecycle interceptors with callbacks around concurrent request execution that starts when a controller returns a `Callable`.

Parameters:
  `interceptors` - the interceptors to register

#### registerDeferredResultInterceptors

    public AsyncSupportConfigurer registerDeferredResultInterceptors(DeferredResultProcessingInterceptor... interceptors)

Configure lifecycle interceptors with callbacks around concurrent request execution that starts when a controller returns a `DeferredResult`.

Parameters:
  `interceptors` - the interceptors to register

#### getTaskExecutor

    protected AsyncTaskExecutor getTaskExecutor()

#### getTimeout

    protected Long getTimeout()

#### getCallableInterceptors

    protected List<CallableProcessingInterceptor> getCallableInterceptors()

#### getDeferredResultInterceptors

    protected List<DeferredResultProcessingInterceptor> getDeferredResultInterceptors()