类 AsyncAnnotationAdvisor

java.lang.Object
cn.taketoday.core.OrderedSupport
cn.taketoday.aop.support.AbstractPointcutAdvisor
cn.taketoday.scheduling.annotation.AsyncAnnotationAdvisor
所有已实现的接口:
Advisor, PointcutAdvisor, Aware, BeanFactoryAware, cn.taketoday.core.Ordered, Serializable

public class AsyncAnnotationAdvisor extends AbstractPointcutAdvisor implements 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 jakarta.ejb.Asynchronous annotation as well, treating it exactly like own Async. Furthermore, a custom async annotation type may get specified through the "asyncAnnotationType" property.

从以下版本开始:
4.0
作者:
Juergen Hoeller
另请参阅:
  • 构造器详细资料

  • 方法详细资料

    • setAsyncAnnotationType

      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 jakarta.ejb.Asynchronous annotation (if present).

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

      参数:
      asyncAnnotationType - the desired annotation type
    • setBeanFactory

      public void setBeanFactory(BeanFactory beanFactory)
      Set the BeanFactory to be used when looking up executors by qualifier.
      指定者:
      setBeanFactory 在接口中 BeanFactoryAware
    • getAdvice

      public Advice getAdvice()
      指定者:
      getAdvice 在接口中 Advisor
    • getPointcut

      public Pointcut getPointcut()
      指定者:
      getPointcut 在接口中 PointcutAdvisor
    • buildAdvice

      protected Advice buildAdvice(@Nullable Supplier<Executor> executor, @Nullable Supplier<AsyncUncaughtExceptionHandler> exceptionHandler)
    • buildPointcut

      protected Pointcut buildPointcut(Set<Class<? extends Annotation>> asyncAnnotationTypes)
      Calculate a pointcut for the given async annotation types, if any.
      参数:
      asyncAnnotationTypes - the async annotation types to introspect
      返回:
      the applicable Pointcut object, or null if none