Class AnnotationAsyncExecutionInterceptor

All Implemented Interfaces:
Advice, Interceptor, MethodInterceptor, Aware, BeanFactoryAware, Ordered

public class AnnotationAsyncExecutionInterceptor extends AsyncExecutionInterceptor
Specialization of AsyncExecutionInterceptor that delegates method execution to an Executor based on the Async annotation. Specifically designed to support use of Async.value() executor qualification mechanism introduced in Spring 3.1.2. Supports detecting qualifier metadata via @Async at the method or declaring class level. See getExecutorQualifier(Method) for details.
Since:
3.1.2
Author:
Chris Beams, Stephane Nicoll
See Also:
  • Constructor Details

    • AnnotationAsyncExecutionInterceptor

      public AnnotationAsyncExecutionInterceptor(@Nullable Executor defaultExecutor)
      Create a new AnnotationAsyncExecutionInterceptor with 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(@Nullable Executor defaultExecutor, AsyncUncaughtExceptionHandler exceptionHandler)
      Create a new AnnotationAsyncExecutionInterceptor with 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 AsyncUncaughtExceptionHandler to use to handle exceptions thrown by asynchronous method executions with void return type
  • Method Details