public class AsyncSupportConfigurer extends Object
Constructor and Description |
---|
AsyncSupportConfigurer() |
Modifier and Type | Method and Description |
---|---|
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)
The provided task executor is used to:
Handle
Callable controller method return values. |
public AsyncSupportConfigurer setTaskExecutor(AsyncTaskExecutor taskExecutor)
Callable
controller method return values.
By default only a SimpleAsyncTaskExecutor
is used. However when
using the above two use cases, it's recommended to configure an executor
backed by a thread pool such as ThreadPoolTaskExecutor
.
taskExecutor
- the task executor instance to use by defaultpublic AsyncSupportConfigurer setDefaultTimeout(long timeout)
If this value is not set, the default timeout of the underlying implementation is used.
timeout
- the timeout value in millisecondspublic AsyncSupportConfigurer registerCallableInterceptors(CallableProcessingInterceptor... interceptors)
Callable
.interceptors
- the interceptors to registerpublic AsyncSupportConfigurer registerDeferredResultInterceptors(DeferredResultProcessingInterceptor... interceptors)
DeferredResult
.interceptors
- the interceptors to register@Nullable protected AsyncTaskExecutor getTaskExecutor()
protected List<CallableProcessingInterceptor> getCallableInterceptors()
protected List<DeferredResultProcessingInterceptor> getDeferredResultInterceptors()