Class AnnotationAsyncExecutionInterceptor
- java.lang.Object
- org.springframework.aop.interceptor.AsyncExecutionAspectSupport
- org.springframework.aop.interceptor.AsyncExecutionInterceptor
- org.springframework.scheduling.annotation.AnnotationAsyncExecutionInterceptor
 
 
 
- All Implemented Interfaces:
- Advice,- Interceptor,- MethodInterceptor,- Aware,- BeanFactoryAware,- Ordered
 - public class AnnotationAsyncExecutionInterceptor extends AsyncExecutionInterceptor Specialization of- AsyncExecutionInterceptorthat delegates method execution to an- Executorbased on the- Asyncannotation. Specifically designed to support use of- Async.value()executor qualification mechanism introduced in Spring 3.1.2. Supports detecting qualifier metadata via- @Asyncat the method or declaring class level. See- getExecutorQualifier(Method)for details.- Since:
- 3.1.2
- Author:
- Chris Beams, Stephane Nicoll
- See Also:
- Async,- AsyncAnnotationAdvisor
 
- Field Summary- Fields inherited from class org.springframework.aop.interceptor.AsyncExecutionAspectSupport- DEFAULT_TASK_EXECUTOR_BEAN_NAME, logger
 - Fields inherited from interface org.springframework.core.Ordered- HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
 
 - Constructor Summary- Constructors - Constructor - Description - AnnotationAsyncExecutionInterceptor(Executor defaultExecutor)Create a new- AnnotationAsyncExecutionInterceptorwith the given executor and a simple- AsyncUncaughtExceptionHandler.- AnnotationAsyncExecutionInterceptor(Executor defaultExecutor, AsyncUncaughtExceptionHandler exceptionHandler)Create a new- AnnotationAsyncExecutionInterceptorwith the given executor.
 - Method Summary- All Methods Instance Methods Concrete Methods - Modifier and Type - Method - Description - protected String- getExecutorQualifier(Method method)Return the qualifier or bean name of the executor to be used when executing the given method, specified via- Async.value()at the method or declaring class level.- Methods inherited from class org.springframework.aop.interceptor.AsyncExecutionInterceptor- getDefaultExecutor, getOrder, invoke
 - Methods inherited from class org.springframework.aop.interceptor.AsyncExecutionAspectSupport- determineAsyncExecutor, doSubmit, findQualifiedExecutor, handleError, setBeanFactory, setExceptionHandler, setExecutor
 
 
- Constructor Detail- AnnotationAsyncExecutionInterceptor- public AnnotationAsyncExecutionInterceptor(Executor defaultExecutor) Create a new- AnnotationAsyncExecutionInterceptorwith the given executor and a simple- AsyncUncaughtExceptionHandler.- Parameters:
- defaultExecutor- the executor to be used by default if no more specific executor has been qualified at the method level using- Async.value(); as of 4.2.6, a local executor for this interceptor will be built otherwise
 
 - AnnotationAsyncExecutionInterceptor- public AnnotationAsyncExecutionInterceptor(Executor defaultExecutor, AsyncUncaughtExceptionHandler exceptionHandler) Create a new- AnnotationAsyncExecutionInterceptorwith the given executor.- Parameters:
- defaultExecutor- the executor to be used by default if no more specific executor has been qualified at the method level using- Async.value(); as of 4.2.6, a local executor for this interceptor will be built otherwise
- exceptionHandler- the- AsyncUncaughtExceptionHandlerto use to handle exceptions thrown by asynchronous method executions with- voidreturn type
 
 
 - Method Detail- getExecutorQualifier- protected String getExecutorQualifier(Method method) Return the qualifier or bean name of the executor to be used when executing the given method, specified via- Async.value()at the method or declaring class level. If- @Asyncis specified at both the method and class level, the method's- #valuetakes precedence (even if empty string, indicating that the default executor should be used preferentially).- Overrides:
- getExecutorQualifierin class- AsyncExecutionInterceptor
- Parameters:
- method- the method to inspect for executor qualifier metadata
- Returns:
- the qualifier if specified, otherwise empty string indicating that the default executor should be used
- See Also:
- AsyncExecutionAspectSupport.determineAsyncExecutor(Method)