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

AsyncAnnotationAdvisor

open class AsyncAnnotationAdvisor : AbstractPointcutAdvisor, BeanFactoryAware

Advisor that activates asynchronous method execution through the Async annotation. This annotation can be used at the method and type level in implementation classes as well as in service interfaces.

This advisor detects the EJB 3.1 javax.ejb.Asynchronous annotation as well, treating it exactly like Spring's own Async. Furthermore, a custom async annotation type may get specified through the "asyncAnnotationType" property.

Author
Juergen Hoeller

Since
3.0

See Also
AsyncAnnotationAsyncExecutionInterceptor

Constructors

<init>

AsyncAnnotationAdvisor()

Create a new AsyncAnnotationAdvisor for bean-style configuration.

AsyncAnnotationAdvisor(executor: Executor, exceptionHandler: AsyncUncaughtExceptionHandler)

Create a new AsyncAnnotationAdvisor for the given task executor.

Functions

getAdvice

open fun getAdvice(): Advice

getPointcut

open fun getPointcut(): Pointcut

setAsyncAnnotationType

open fun setAsyncAnnotationType(asyncAnnotationType: Class<out Annotation>): Unit

Set the 'async' annotation type.

The default async annotation type is the Async annotation, as well as the EJB 3.1 javax.ejb.Asynchronous annotation (if present).

This setter property exists so that developers can provide their own (non-Spring-specific) annotation type to indicate that a method is to be executed asynchronously.

setBeanFactory

open fun setBeanFactory(beanFactory: BeanFactory): Unit

Set the BeanFactory to be used when looking up executors by qualifier.

setTaskExecutor

open fun setTaskExecutor(executor: Executor): Unit

Specify the default task executor to use for asynchronous methods.