public class AsyncAnnotationAdvisor extends AbstractPointcutAdvisor implements BeanFactoryAware
Async
アノテーションを介して非同期メソッドの実行をアクティブ化するアドバイザー。このアノテーションは、実装クラスおよびサービスインターフェースのメソッドレベルおよび型レベルで使用できます。 このアドバイザは EJB 3.1 javax.ejb.Asynchronous
アノテーションも検出し、Spring 自体の Async
とまったく同じように扱います。さらに、カスタム非同期アノテーション型は、"asyncAnnotationType"
プロパティを通じて指定される場合があります。
Async
, AnnotationAsyncExecutionInterceptor
, 直列化された形式 EMPTY_ADVICE
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
コンストラクターと説明 |
---|
AsyncAnnotationAdvisor() Bean スタイルの構成用に新しい AsyncAnnotationAdvisor を作成します。 |
AsyncAnnotationAdvisor(ExecutorSE executor, AsyncUncaughtExceptionHandler exceptionHandler) 指定されたタスクエグゼキューターの新しい AsyncAnnotationAdvisor を作成します。 |
AsyncAnnotationAdvisor(SupplierSE<ExecutorSE> executor, SupplierSE<AsyncUncaughtExceptionHandler> exceptionHandler) 指定されたタスクエグゼキューターの新しい AsyncAnnotationAdvisor を作成します。 |
修飾子と型 | メソッドと説明 |
---|---|
protected Advice | buildAdvice(SupplierSE<ExecutorSE> executor, SupplierSE<AsyncUncaughtExceptionHandler> exceptionHandler) |
protected Pointcut | buildPointcut(SetSE<ClassSE<? extends AnnotationSE>> asyncAnnotationTypes) 指定された非同期アノテーション型がある場合は、そのポイントカットを計算します。 |
Advice | getAdvice() このアスペクトのアドバイス部分を返します。 |
Pointcut | getPointcut() このアドバイザーを駆動するポイントカットを取得します。 |
void | setAsyncAnnotationType(ClassSE<? extends AnnotationSE> asyncAnnotationType) 「非同期」アノテーション型を設定します。 |
void | setBeanFactory(BeanFactory beanFactory) 修飾子でエグゼキュータを検索するときに使用する BeanFactory を設定します。 |
equals, getOrder, hashCode, isPerInstance, setOrder
cloneSE, finalizeSE, getClassSE, notifySE, notifyAllSE, toStringSE, waitSE, waitSE, waitSE
public AsyncAnnotationAdvisor()
AsyncAnnotationAdvisor
を作成します。public AsyncAnnotationAdvisor(@Nullable ExecutorSE executor, @Nullable AsyncUncaughtExceptionHandler exceptionHandler)
AsyncAnnotationAdvisor
を作成します。executor
- 非同期メソッドに使用するタスクエグゼキュータ (デフォルトのエグゼキューター解決をトリガーする null
にすることができます)exceptionHandler
- 非同期メソッドの実行によってスローされた予期しない例外を処理するために使用する AsyncUncaughtExceptionHandler
AsyncExecutionInterceptor.getDefaultExecutor(BeanFactory)
public AsyncAnnotationAdvisor(@Nullable SupplierSE<ExecutorSE> executor, @Nullable SupplierSE<AsyncUncaughtExceptionHandler> exceptionHandler)
AsyncAnnotationAdvisor
を作成します。executor
- 非同期メソッドに使用するタスクエグゼキュータ (デフォルトのエグゼキューター解決をトリガーする null
にすることができます)exceptionHandler
- 非同期メソッドの実行によってスローされた予期しない例外を処理するために使用する AsyncUncaughtExceptionHandler
AsyncExecutionInterceptor.getDefaultExecutor(BeanFactory)
public void setAsyncAnnotationType(ClassSE<? extends AnnotationSE> asyncAnnotationType)
デフォルトの非同期アノテーション型は、Async
アノテーションと EJB 3.1 javax.ejb.Asynchronous
アノテーション(存在する場合)です。
この setter プロパティは、開発者が独自の(Spring 固有ではない)アノテーション型を提供して、メソッドが非同期で実行されることを示すことができるようにするために存在します。
asyncAnnotationType
- 目的のアノテーション型 public void setBeanFactory(BeanFactory beanFactory)
BeanFactory
を設定します。BeanFactoryAware
の setBeanFactory
beanFactory
- 所有 BeanFactory(非 null
)。Bean は、ファクトリのメソッドをすぐに呼び出すことができます。BeanInitializationException
public Advice getAdvice()
Advisor
Advisor
の getAdvice
MethodInterceptor
, BeforeAdvice
, ThrowsAdvice
, AfterReturningAdvice
public Pointcut getPointcut()
PointcutAdvisor
PointcutAdvisor
の getPointcut
protected Advice buildAdvice(@Nullable SupplierSE<ExecutorSE> executor, @Nullable SupplierSE<AsyncUncaughtExceptionHandler> exceptionHandler)
protected Pointcut buildPointcut(SetSE<ClassSE<? extends AnnotationSE>> asyncAnnotationTypes)
asyncAnnotationTypes
- イントロスペクトする非同期アノテーション型 null