spring-framework / org.springframework.scheduling.annotation / AnnotationAsyncExecutionInterceptor

AnnotationAsyncExecutionInterceptor

open class AnnotationAsyncExecutionInterceptor : 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.

Author
Chris Beams

Author
Stephane Nicoll

Since
3.1.2

See Also
org.springframework.scheduling.annotation.Asyncorg.springframework.scheduling.annotation.AsyncAnnotationAdvisor

Constructors

<init>

AnnotationAsyncExecutionInterceptor(defaultExecutor: Executor)

Create a new AnnotationAsyncExecutionInterceptor with the given executor and a simple AsyncUncaughtExceptionHandler.

AnnotationAsyncExecutionInterceptor(defaultExecutor: Executor, exceptionHandler: AsyncUncaughtExceptionHandler)

Create a new AnnotationAsyncExecutionInterceptor with the given executor.

Inherited Functions

getOrder

open fun getOrder(): Int

invoke

open fun invoke(invocation: MethodInvocation): Any

Intercept the given method invocation, submit the actual calling of the method to the correct task executor and return immediately to the caller.