クラス TransactionalApplicationListenerMethodAdapter
java.lang.ObjectSE
org.springframework.context.event.ApplicationListenerMethodAdapter
org.springframework.transaction.event.TransactionalApplicationListenerMethodAdapter
- 実装されたすべてのインターフェース:
EventListenerSE
、ApplicationListener<ApplicationEvent>
、GenericApplicationListener
、SmartApplicationListener
、Ordered
、TransactionalApplicationListener<ApplicationEvent>
public class TransactionalApplicationListenerMethodAdapter
extends ApplicationListenerMethodAdapter
implements TransactionalApplicationListener<ApplicationEvent>
イベントの処理を
TransactionalEventListener
アノテーション付きメソッドに委譲する GenericApplicationListener
アダプター。通常の EventListener
アノテーション付きメソッドとまったく同じ機能をサポートしますが、イベント発行者のトランザクションコンテキストを認識します。Spring のトランザクション管理を有効にすると、TransactionalEventListener
の処理が自動的に有効になります。それ以外の場合は、TransactionalEventListenerFactory
型の Bean を登録する必要があります。
- 導入:
- 5.3
- 作成者:
- Stephane Nicoll, Juergen Hoeller
- 関連事項:
ネストされたクラスのサマリー
インターフェース org.springframework.transaction.event.TransactionalApplicationListener から継承されたネストクラス / インターフェース
TransactionalApplicationListener.SynchronizationCallback
フィールドサマリー
クラス org.springframework.context.event.ApplicationListenerMethodAdapter から継承されたフィールド
logger
インターフェース org.springframework.core.Ordered から継承されたフィールド
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
コンストラクターのサマリー
コンストラクターコンストラクター説明TransactionalApplicationListenerMethodAdapter
(StringSE beanName, ClassSE<?> targetClass, MethodSE method) 新しい TransactionalApplicationListenerMethodAdapter を作成します。方法の概要
修飾子と型メソッド説明void
トランザクション同期内の処理時に呼び出されるコールバックを追加します。リスナーが呼び出されるTransactionPhase
を返します。void
アプリケーションイベントを処理します。クラス org.springframework.context.event.ApplicationListenerMethodAdapter から継承されたメソッド
doInvoke, getCondition, getDefaultListenerId, getDetailedErrorMessage, getListenerId, getOrder, getTargetBean, getTargetMethod, handleAsyncError, handleResult, isDefaultExecution, processEvent, resolveArguments, shouldHandle, supportsEventType, supportsSourceType, toString
クラス java.lang.ObjectSE から継承されたメソッド
clone, equalsSE, finalize, getClass, hashCode, notify, notifyAll, wait, waitSE, waitSE
インターフェース org.springframework.context.event.GenericApplicationListener から継承されたメソッド
supportsEventType
インターフェース org.springframework.transaction.event.TransactionalApplicationListener から継承されたメソッド
getListenerId, getOrder, processEvent, supportsAsyncExecution
コンストラクターの詳細
TransactionalApplicationListenerMethodAdapter
public TransactionalApplicationListenerMethodAdapter(StringSE beanName, ClassSE<?> targetClass, MethodSE method) 新しい TransactionalApplicationListenerMethodAdapter を作成します。- パラメーター:
beanName
- リスナーメソッドを呼び出す Bean の名前targetClass
- メソッドが宣言されているターゲットクラスmethod
- 呼び出すリスナーメソッド
メソッドの詳細
getTransactionPhase
インターフェースからコピーされた説明:TransactionalApplicationListener
リスナーが呼び出されるTransactionPhase
を返します。デフォルトのフェーズは
TransactionPhase.AFTER_COMMIT
です。- 次で指定:
- インターフェース
TransactionalApplicationListener<ApplicationEvent>
のgetTransactionPhase
addCallback
インターフェースからコピーされた説明:TransactionalApplicationListener
トランザクション同期内の処理時、つまり実際のトランザクション中にTransactionalApplicationListener.processEvent(E)
がトリガーされたときに呼び出されるコールバックを追加します。- 次で指定:
- インターフェース
TransactionalApplicationListener<ApplicationEvent>
のaddCallback
- パラメーター:
callback
- 適用する同期コールバック
onApplicationEvent
インターフェースからコピーされた説明:ApplicationListener
アプリケーションイベントを処理します。- 次で指定:
- インターフェース
ApplicationListener<ApplicationEvent>
のonApplicationEvent
- オーバーライド:
- クラス
ApplicationListenerMethodAdapter
のonApplicationEvent
- パラメーター:
event
- 応答するイベント