Package 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
Description
`AsyncSupportConfigurer()`

## Method Summary

Modifier and Type
Method
Description
`protected List<org.springframework.web.context.request.async.CallableProcessingInterceptor>`
`getCallableInterceptors()`
`protected List<org.springframework.web.context.request.async.DeferredResultProcessingInterceptor>`
`getDeferredResultInterceptors()`
`protected org.springframework.core.task.AsyncTaskExecutor`
`getTaskExecutor()`
`protected Long`
`getTimeout()`
`AsyncSupportConfigurer`
`registerCallableInterceptors(org.springframework.web.context.request.async.CallableProcessingInterceptor... interceptors)`
Configure lifecycle interceptors with callbacks around concurrent request execution that starts when a controller returns a `Callable`.
`AsyncSupportConfigurer`
`registerDeferredResultInterceptors(org.springframework.web.context.request.async.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(org.springframework.core.task.AsyncTaskExecutor taskExecutor)`
The provided task executor is used for the following: Handle `Callable` controller method return values.

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

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

## Constructor Details

### AsyncSupportConfigurer

public AsyncSupportConfigurer()

## Method Details

### setTaskExecutor

public AsyncSupportConfigurer setTaskExecutor(org.springframework.core.task.AsyncTaskExecutor taskExecutor)
The provided task executor is used for the following:

1. Handle `Callable` controller method return values.
2. Perform blocking writes when streaming to the response through a reactive (for example, Reactor, RxJava) controller method return value.

If your application has controllers with such return types, please configure an `AsyncTaskExecutor` as the one used by default is not suitable for production under load.

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.

Parameters:
  `timeout` - the timeout value in milliseconds

### registerCallableInterceptors

public AsyncSupportConfigurer registerCallableInterceptors(org.springframework.web.context.request.async.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(org.springframework.web.context.request.async.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

@Nullable protected org.springframework.core.task.AsyncTaskExecutor getTaskExecutor()

### getTimeout

@Nullable protected Long getTimeout()

### getCallableInterceptors

protected List<org.springframework.web.context.request.async.CallableProcessingInterceptor> getCallableInterceptors()

### getDeferredResultInterceptors

protected List<org.springframework.web.context.request.async.DeferredResultProcessingInterceptor> getDeferredResultInterceptors()