类 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
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
- 另请参阅:
-
字段概要
从类继承的字段 cn.taketoday.core.OrderedSupport
order从接口继承的字段 cn.taketoday.aop.Advisor
EMPTY_ADVICE从接口继承的字段 cn.taketoday.core.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE -
构造器概要
构造器构造器说明Create a newAsyncAnnotationAdvisorfor bean-style configuration.AsyncAnnotationAdvisor(Executor executor, AsyncUncaughtExceptionHandler exceptionHandler) Create a newAsyncAnnotationAdvisorfor the given task executor.AsyncAnnotationAdvisor(Supplier<Executor> executor, Supplier<AsyncUncaughtExceptionHandler> exceptionHandler) Create a newAsyncAnnotationAdvisorfor the given task executor. -
方法概要
修饰符和类型方法说明protected AdvicebuildAdvice(Supplier<Executor> executor, Supplier<AsyncUncaughtExceptionHandler> exceptionHandler) protected PointcutbuildPointcut(Set<Class<? extends Annotation>> asyncAnnotationTypes) Calculate a pointcut for the given async annotation types, if any.voidsetAsyncAnnotationType(Class<? extends Annotation> asyncAnnotationType) Set the 'async' annotation type.voidsetBeanFactory(BeanFactory beanFactory) Set theBeanFactoryto be used when looking up executors by qualifier.从类继承的方法 cn.taketoday.aop.support.AbstractPointcutAdvisor
equals, getOrder, hashCode, isPerInstance从类继承的方法 cn.taketoday.core.OrderedSupport
setOrder
-
构造器详细资料
-
AsyncAnnotationAdvisor
public AsyncAnnotationAdvisor()Create a newAsyncAnnotationAdvisorfor bean-style configuration. -
AsyncAnnotationAdvisor
public AsyncAnnotationAdvisor(@Nullable Executor executor, @Nullable AsyncUncaughtExceptionHandler exceptionHandler) Create a newAsyncAnnotationAdvisorfor the given task executor.- 参数:
executor- the task executor to use for asynchronous methods (can benullto trigger default executor resolution)exceptionHandler- theAsyncUncaughtExceptionHandlerto use to handle unexpected exception thrown by asynchronous method executions- 另请参阅:
-
AsyncAnnotationAdvisor
public AsyncAnnotationAdvisor(@Nullable Supplier<Executor> executor, @Nullable Supplier<AsyncUncaughtExceptionHandler> exceptionHandler) Create a newAsyncAnnotationAdvisorfor the given task executor.- 参数:
executor- the task executor to use for asynchronous methods (can benullto trigger default executor resolution)exceptionHandler- theAsyncUncaughtExceptionHandlerto use to handle unexpected exception thrown by asynchronous method executions- 另请参阅:
-
-
方法详细资料
-
setAsyncAnnotationType
Set the 'async' annotation type.The default async annotation type is the
Asyncannotation, as well as the EJB 3.1jakarta.ejb.Asynchronousannotation (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
Set theBeanFactoryto be used when looking up executors by qualifier.- 指定者:
setBeanFactory在接口中BeanFactoryAware
-
getAdvice
-
getPointcut
- 指定者:
getPointcut在接口中PointcutAdvisor
-
buildAdvice
protected Advice buildAdvice(@Nullable Supplier<Executor> executor, @Nullable Supplier<AsyncUncaughtExceptionHandler> exceptionHandler) -
buildPointcut
Calculate a pointcut for the given async annotation types, if any.- 参数:
asyncAnnotationTypes- the async annotation types to introspect- 返回:
- the applicable Pointcut object, or
nullif none
-