クラス ThreadStatePropagationChannelInterceptor<S>
java.lang.ObjectSE
org.springframework.integration.channel.interceptor.ThreadStatePropagationChannelInterceptor<S>
- 型パラメーター:
S- 伝播された状態オブジェクト型。
- 実装済みのインターフェース一覧:
ChannelInterceptor, ExecutorChannelInterceptor
public abstract class ThreadStatePropagationChannelInterceptor<S>
extends ObjectSE
implements ExecutorChannelInterceptor
あるメッセージフローのスレッドから、フローに含まれる
MessageChannel を介した別のスレッドへの ThreadSE(任意の? )状態の伝播を担当する ExecutorChannelInterceptor 実装。 伝播は、送信するメッセージと伝播する状態を保持する内部 Message 拡張機能を使用して preSend(Message, MessageChannel) 実装から実行されます。
伝搬状態コンテキストの抽出と作成は、PollableChannel の場合は postReceive(Message, MessageChannel) 実装から、AbstractExecutorChannel と ExecutorSubscribableChannel の場合は beforeHandle(Message, MessageChannel, MessageHandler) から実行されます。
重要。送信するメッセージを変更するインターセプター(MessageBuilder.withPayload(...)...build() など)は、状態をドロップして伝播する可能性があります。このようなインターセプターの組み合わせは適切に修正する必要があります。ほとんどの場合、インターセプターの並べ替えで課題を解決できます。
- 導入:
- 4.2
- 作成者:
- Artem Bilan, Gary Russell
コンストラクター概要
コンストラクター方法の概要
修飾子と型メソッド説明final Message<?> beforeHandle(Message<?> message, MessageChannel channel, MessageHandler handler) protected abstract @Nullable SobtainPropagatingContext(Message<?> message, MessageChannel channel) protected abstract voidpopulatePropagatedContext(@Nullable S state, Message<?> message, MessageChannel channel) final Message<?> postReceive(Message<?> message, MessageChannel channel) final Message<?> preSend(Message<?> message, MessageChannel channel) クラス ObjectSE から継承されたメソッド
clone, equalsSE, finalize, getClass, hashCode, notify, notifyAll, toString, wait, waitSE, waitSEインターフェース ChannelInterceptor から継承されたメソッド
afterReceiveCompletion, afterSendCompletion, postSend, preReceiveインターフェース ExecutorChannelInterceptor から継承されたメソッド
afterMessageHandled
コンストラクターの詳細
ThreadStatePropagationChannelInterceptor
public ThreadStatePropagationChannelInterceptor()
方法の詳細
preSend
- 次で指定:
- インターフェース
ChannelInterceptor内のpreSend
postReceive
- 次で指定:
- インターフェース
ChannelInterceptor内のpostReceive
beforeHandle
public final Message<?> beforeHandle(Message<?> message, MessageChannel channel, MessageHandler handler) - 次で指定:
- インターフェース
ExecutorChannelInterceptor内のbeforeHandle
obtainPropagatingContext
populatePropagatedContext
protected abstract void populatePropagatedContext(@Nullable S state, Message<?> message, MessageChannel channel)