public class AsyncAnnotationBeanPostProcessor
extends org.springframework.aop.framework.autoproxy.AbstractBeanFactoryAwareAdvisingPostProcessor
Async annotation at class or
 method-level by adding a corresponding AsyncAnnotationAdvisor to the
 exposed proxy (either an existing AOP proxy or a newly generated proxy that
 implements all of the target's interfaces).
 The TaskExecutor responsible for the asynchronous execution may
 be provided as well as the annotation type that indicates a method should be
 invoked asynchronously. If no annotation type is specified, this post-
 processor will detect both Spring's @Async annotation as well
 as the EJB 3.1 javax.ejb.Asynchronous annotation.
 
For methods having a void return type, any exception thrown
 during the asynchronous method invocation cannot be accessed by the
 caller. An AsyncUncaughtExceptionHandler can be specified to handle
 these cases.
 
Note: The underlying async advisor applies before existing advisors by default, in order to switch to async execution as early as possible in the invocation chain.
Async, 
AsyncAnnotationAdvisor, 
AbstractAdvisingBeanPostProcessor.setBeforeExistingAdvisors(boolean), 
ScheduledAnnotationBeanPostProcessor, 
Serialized Form| Modifier and Type | Field and Description | 
|---|---|
| static String | DEFAULT_TASK_EXECUTOR_BEAN_NAMEThe default name of the  TaskExecutorbean to pick up: "taskExecutor". | 
| protected Log | logger | 
| Constructor and Description | 
|---|
| AsyncAnnotationBeanPostProcessor() | 
| Modifier and Type | Method and Description | 
|---|---|
| void | configure(Supplier<Executor> executor,
         Supplier<org.springframework.aop.interceptor.AsyncUncaughtExceptionHandler> exceptionHandler)Configure this post-processor with the given executor and exception handler suppliers,
 applying the corresponding default if a supplier is not resolvable. | 
| void | setAsyncAnnotationType(Class<? extends Annotation> asyncAnnotationType)Set the 'async' annotation type to be detected at either class or method
 level. | 
| void | setBeanFactory(org.springframework.beans.factory.BeanFactory beanFactory) | 
| void | setExceptionHandler(org.springframework.aop.interceptor.AsyncUncaughtExceptionHandler exceptionHandler)Set the  AsyncUncaughtExceptionHandlerto use to handle uncaught
 exceptions thrown by asynchronous method executions. | 
| void | setExecutor(Executor executor)Set the  Executorto use when invoking methods asynchronously. | 
isEligible, prepareProxyFactorycustomizeProxyFactory, isEligible, postProcessAfterInitialization, postProcessBeforeInitialization, setBeforeExistingAdvisorsevaluateProxyInterfaces, getOrder, getProxyClassLoader, isConfigurationCallbackInterface, isInternalLanguageInterface, setBeanClassLoader, setOrder, setProxyClassLoaderpublic static final String DEFAULT_TASK_EXECUTOR_BEAN_NAME
TaskExecutor bean to pick up: "taskExecutor".
 Note that the initial lookup happens by type; this is just the fallback in case of multiple executor beans found in the context.
AsyncExecutionAspectSupport.DEFAULT_TASK_EXECUTOR_BEAN_NAME, 
Constant Field Valuesprotected final Log logger
public void configure(@Nullable
                      Supplier<Executor> executor,
                      @Nullable
                      Supplier<org.springframework.aop.interceptor.AsyncUncaughtExceptionHandler> exceptionHandler)
public void setExecutor(Executor executor)
Executor to use when invoking methods asynchronously.
 If not specified, default executor resolution will apply: searching for a
 unique TaskExecutor bean in the context, or for an Executor
 bean named "taskExecutor" otherwise. If neither of the two is resolvable,
 a local default executor will be created within the interceptor.
AsyncExecutionInterceptor.getDefaultExecutor(BeanFactory), 
DEFAULT_TASK_EXECUTOR_BEAN_NAMEpublic void setExceptionHandler(org.springframework.aop.interceptor.AsyncUncaughtExceptionHandler exceptionHandler)
AsyncUncaughtExceptionHandler to use to handle uncaught
 exceptions thrown by asynchronous method executions.public void setAsyncAnnotationType(Class<? extends Annotation> asyncAnnotationType)
Async annotation and the EJB 3.1
 javax.ejb.Asynchronous annotation will be detected.
 This setter property exists so that developers can provide their own (non-Spring-specific) annotation type to indicate that a method (or all methods of a given class) should be invoked asynchronously.
asyncAnnotationType - the desired annotation typepublic void setBeanFactory(org.springframework.beans.factory.BeanFactory beanFactory)
setBeanFactory in interface org.springframework.beans.factory.BeanFactoryAwaresetBeanFactory in class org.springframework.aop.framework.autoproxy.AbstractBeanFactoryAwareAdvisingPostProcessor