- All Implemented Interfaces:
- Direct Known Subclasses:
MethodInterceptorthat processes method invocations asynchronously, using a given
AsyncTaskExecutor. Typically used with the
In terms of target method signatures, any parameter types are supported.
However, the return type is constrained to either
java.util.concurrent.Future. In the latter case, the Future handle
returned from the proxy will be an actual asynchronous Future that can be used
to track the result of the asynchronous method execution. However, since the
target method needs to implement the same signature, it will have to return
a temporary Future handle that just passes the return value through
When the return type is
java.util.concurrent.Future, any exception thrown
during the execution can be accessed and managed by the caller. With
return type however, such exceptions cannot be transmitted back. In that case an
AsyncUncaughtExceptionHandler can be registered to process such exceptions.
As of Spring 3.1.2 the
AnnotationAsyncExecutionInterceptor subclass is
preferred for use due to its support for executor qualification in conjunction with
Fields inherited from class org.springframework.aop.interceptor.AsyncExecutionAspectSupport
Method SummaryModifier and TypeMethodDescription
protected StringThis implementation is a no-op for compatibility in Spring 3.1.2.
getOrder()Get the order value of this object.Intercept the given method invocation, submit the actual calling of the method to the correct task executor and return immediately to the caller.
Methods inherited from class org.springframework.aop.interceptor.AsyncExecutionAspectSupport
configure, determineAsyncExecutor, doSubmit, findQualifiedExecutor, handleError, setBeanFactory, setExceptionHandler, setExecutor
(@Nullable Executor defaultExecutor, AsyncUncaughtExceptionHandler exceptionHandler)Create a new
invokeIntercept the given method invocation, submit the actual calling of the method to the correct task executor and return immediately to the caller.
getExecutorQualifierThis implementation is a no-op for compatibility in Spring 3.1.2. Subclasses may override to provide support for extracting qualifier information, e.g. via an annotation on the given method.
- Specified by:
method- the method to inspect for executor qualifier metadata
- See Also:
getDefaultExecutorThis implementation searches for a unique
TaskExecutorbean in the context, or for an
Executorbean named "taskExecutor" otherwise. If neither of the two is resolvable (e.g. if no
BeanFactorywas configured at all), this implementation falls back to a newly created
SimpleAsyncTaskExecutorinstance for local use if no default could be found.
beanFactory- the BeanFactory to use for a default executor lookup
- the default executor, or
nullif none available
- See Also:
getOrderpublic int getOrder()Description copied from interface:
OrderedGet the order value of this object.
Higher values are interpreted as lower priority. As a consequence, the object with the lowest value has the highest priority (somewhat analogous to Servlet
Same order values will result in arbitrary sort positions for the affected objects.