public class AsyncAnnotationBeanPostProcessor extends AbstractAdvisingBeanPostProcessor implements BeanFactoryAware
Asyncannotation at class or method-level by adding a corresponding
AsyncAnnotationAdvisorto the exposed proxy (either an existing AOP proxy or a newly generated proxy that implements all of the target's interfaces).
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
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.
AbstractAdvisingBeanPostProcessor.setBeforeExistingAdvisors(boolean), Serialized Form
|Constructor and Description|
|Modifier and Type||Method and Description|
Set the 'async' annotation type to be detected at either class or method level.
Callback that supplies the owning factory to a bean instance.
getOrder, isEligible, isEligible, postProcessAfterInitialization, postProcessBeforeInitialization, setBeanClassLoader, setBeforeExistingAdvisors, setOrder
copyFrom, isExposeProxy, isFrozen, isOpaque, isOptimize, isProxyTargetClass, setExposeProxy, setFrozen, setOpaque, setOptimize, setProxyTargetClass, toString
public void setAsyncAnnotationType(Class<? extends Annotation> asyncAnnotationType)
Asyncannotation and the EJB 3.1
javax.ejb.Asynchronousannotation 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 type
public void setExecutor(Executor executor)
Executorto use when invoking methods asynchronously.
public void setBeanFactory(BeanFactory beanFactory)
Invoked after the population of normal bean properties
but before an initialization callback such as
InitializingBean.afterPropertiesSet() or a custom init-method.