接口 AsyncConfigurer
- 所有已知实现类:
AsyncConfigurerSupport
public interface AsyncConfigurer
Interface to be implemented by @Configurationclasses annotated with @EnableAsyncthat wish to customize theExecutorinstance used when processing async method invocations or theAsyncUncaughtExceptionHandlerinstance used to process exception thrown from async method withvoidreturn type.Consider using
AsyncConfigurerSupportproviding default implementations for both methods if only one element needs to be customized. Furthermore, backward compatibility of this interface will be insured in case new customization options are introduced in the future.See @
EnableAsyncfor usage examples.- 从以下版本开始:
- 3.1
- 作者:
- Chris Beams, Stephane Nicoll
- 另请参阅:
AbstractAsyncConfiguration,EnableAsync,AsyncConfigurerSupport
方法概要
所有方法 实例方法 默认方法 修饰符和类型 方法 说明 default ExecutorgetAsyncExecutor()TheExecutorinstance to be used when processing async method invocations.default AsyncUncaughtExceptionHandlergetAsyncUncaughtExceptionHandler()TheAsyncUncaughtExceptionHandlerinstance to be used when an exception is thrown during an asynchronous method execution withvoidreturn type.
方法详细资料
getAsyncExecutor
@Nullable default Executor getAsyncExecutor()
TheExecutorinstance to be used when processing async method invocations.
getAsyncUncaughtExceptionHandler
@Nullable default AsyncUncaughtExceptionHandler getAsyncUncaughtExceptionHandler()
TheAsyncUncaughtExceptionHandlerinstance to be used when an exception is thrown during an asynchronous method execution withvoidreturn type.