Bean post-processor that automatically applies asynchronous invocation
behavior to any bean that carries the 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
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.
Configure this post-processor with the given executor and exception handler suppliers,
applying the corresponding default if a supplier is not resolvable.
public void setExecutor(java.util.concurrent.Executor executor)
Set the 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.