public class

AsyncAnnotationAdvisor

extends AbstractPointcutAdvisor
java.lang.Object
   ↳ org.springframework.aop.support.AbstractPointcutAdvisor
     ↳ org.springframework.scheduling.annotation.AsyncAnnotationAdvisor

Class Overview

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.

See Also

Summary

[Expand]
Inherited Constants
From interface org.springframework.core.Ordered
Public Constructors
AsyncAnnotationAdvisor()
Create a new ConcurrencyAnnotationBeanPostProcessor for bean-style configuration.
AsyncAnnotationAdvisor(Executor executor)
Create a new ConcurrencyAnnotationBeanPostProcessor for the given task executor.
Public Methods
Advice getAdvice()
Pointcut getPointcut()
void setAsyncAnnotationType(Class<? extends Annotation> asyncAnnotationType)
Set the 'async' annotation type.
void setTaskExecutor(Executor executor)
Specify the task executor to use for asynchronous methods.
Protected Methods
Advice buildAdvice(Executor executor)
Pointcut buildPointcut(Set<Class<? extends Annotation>> asyncAnnotationTypes)
Calculate a pointcut for the given target class, if any.
[Expand]
Inherited Methods
From class org.springframework.aop.support.AbstractPointcutAdvisor
From class java.lang.Object
From interface org.springframework.aop.Advisor
From interface org.springframework.aop.PointcutAdvisor
From interface org.springframework.core.Ordered

Public Constructors

public AsyncAnnotationAdvisor ()

Create a new ConcurrencyAnnotationBeanPostProcessor for bean-style configuration.

public AsyncAnnotationAdvisor (Executor executor)

Create a new ConcurrencyAnnotationBeanPostProcessor for the given task executor.

Parameters
executor the task executor to use for asynchronous methods

Public Methods

public Advice getAdvice ()

public Pointcut getPointcut ()

public void setAsyncAnnotationType (Class<? extends Annotation> asyncAnnotationType)

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.

Parameters
asyncAnnotationType the desired annotation type

public void setTaskExecutor (Executor executor)

Specify the task executor to use for asynchronous methods.

Protected Methods

protected Advice buildAdvice (Executor executor)

protected Pointcut buildPointcut (Set<Class<? extends Annotation>> asyncAnnotationTypes)

Calculate a pointcut for the given target class, if any.

Returns
  • the applicable Pointcut object, or null if none