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)
Set the default
AsyncTaskExecutor to use when a controller method
returns a Callable . |
public AsyncSupportConfigurer setTaskExecutor(AsyncTaskExecutor taskExecutor)
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.
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, e.g. 10 seconds on Tomcat with Servlet 3.
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 registerprotected AsyncTaskExecutor getTaskExecutor()
protected Long getTimeout()
protected List<CallableProcessingInterceptor> getCallableInterceptors()
protected List<DeferredResultProcessingInterceptor> getDeferredResultInterceptors()