クラス ContentEnricher
java.lang.ObjectSE
org.springframework.integration.context.IntegrationObjectSupport
org.springframework.integration.handler.MessageHandlerSupport
org.springframework.integration.handler.AbstractMessageHandler
org.springframework.integration.handler.AbstractMessageProducingHandler
org.springframework.integration.handler.AbstractReplyProducingMessageHandler
org.springframework.integration.transformer.ContentEnricher
- 実装されているすべてのインターフェース:
org.reactivestreams.Subscriber<Message<?>>、Aware、BeanClassLoaderAware、BeanFactoryAware、BeanNameAware、DisposableBean、InitializingBean、ApplicationContextAware、Lifecycle、Ordered、ComponentSourceAware、ExpressionCapable、Orderable、MessageProducer、HeaderPropagationAware、IntegrationPattern、NamedComponent、IntegrationManagement、ManageableLifecycle、TrackableComponent、MessageHandler、reactor.core.CoreSubscriber<Message<?>>
public class ContentEnricher
extends AbstractReplyProducingMessageHandler
implements ManageableLifecycle
Content Enricher は、静的な値でメッセージのペイロードを増やすか、リクエストチャネルを介して下流のメッセージフローをオプションで呼び出し、応答メッセージの値を元のペイロードに適用することにより、メッセージのペイロードを増やすことができるメッセージ Transformer です。
- 導入:
- 2.1
- 作成者:
- Mark Fisher, Gunnar Hillert, Gary Russell, Artem Bilan, Liujiong, Kris Jacyna
ネストされたクラスの要約
クラス org.springframework.integration.handler.AbstractReplyProducingMessageHandler から継承されたネストクラス / インターフェース
AbstractReplyProducingMessageHandler.RequestHandlerインターフェース org.springframework.integration.support.management.IntegrationManagement から継承されたネストクラス / インターフェース
IntegrationManagement.ManagementOverridesフィールドのサマリー
クラス org.springframework.integration.handler.AbstractMessageProducingHandler から継承されたフィールド
messagingTemplateクラス org.springframework.integration.context.IntegrationObjectSupport から継承されたフィールド
EXPRESSION_PARSER, loggerインターフェース org.springframework.integration.support.management.IntegrationManagement から継承されたフィールド
METER_PREFIX, RECEIVE_COUNTER_NAME, SEND_TIMER_NAMEインターフェース org.springframework.core.Ordered から継承されたフィールド
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCEコンストラクターの概要
コンストラクターメソッドのサマリー
修飾子と型メソッド説明protected voiddoInit()コンテンツエンリッチャーを初期化します。サブクラスはこのメソッドを実装して、コンポーネント型情報を提供できます。このコンポーネントが実装するパターン型を返します。protected ObjectSEhandleRequestMessage(Message<?> requestMessage) サブクラスはこのメソッドを実装して、リクエストメッセージを処理する必要があります。booleanライフサイクルの実装。voidsetErrorChannel(MessageChannel errorChannel) コンテンツエンリッチャーエラーチャネルを設定して、ダウンストリームフローで例外が発生した場合に、エラー処理フローがエンリッチメントに使用する代替オブジェクトを返すことができるようにします。voidsetErrorChannelName(StringSE errorChannelName) voidsetHeaderExpressions(MapSE<StringSE, HeaderValueMessageProcessor<?>> headerExpressions) ターゲット MessageHeaders を強化するときに評価するHeaderValueMessageProcessorのマップを提供します。voidsetIntegrationEvaluationContext(EvaluationContext evaluationContext) voidsetNullResultHeaderExpressions(MapSE<StringSE, HeaderValueMessageProcessor<?>> nullResultHeaderExpressions) voidsetNullResultPropertyExpressions(MapSE<StringSE, Expression> nullResultPropertyExpressions) voidsetPropertyExpressions(MapSE<StringSE, Expression> propertyExpressions) ターゲットペイロードを強化するときに評価する式のマップを提供します。voidsetReplyChannel(MessageChannel replyChannel) コンテンツエンリッチャーの返信チャネルを設定します。voidsetReplyChannelName(StringSE replyChannelName) voidsetReplyTimeout(LongSE replyTimeout) 応答メッセージを受信するためのタイムアウト値を設定します。voidsetRequestChannel(MessageChannel requestChannel) コンテンツエンリッチャーリクエストチャネルを設定します。voidsetRequestChannelName(StringSE requestChannelName) voidsetRequestPayloadExpression(Expression requestPayloadExpression) デフォルトでは、元のメッセージのペイロードが、リクエストチャネルに送信される実際のペイロードとして使用されます。voidsetRequestTimeout(LongSE requestTimeout) リクエストメッセージを送信するためのタイムアウト値を設定します。voidsetShouldClonePayload(boolean shouldClonePayload) ペイロードオブジェクトを複製してターゲットオブジェクトを作成するかどうかを指定します。voidstart()ライフサイクルの実装。voidstop()ライフサイクルの実装。クラス org.springframework.integration.handler.AbstractReplyProducingMessageHandler から継承されたメソッド
doInvokeAdvisedRequestHandler, getBeanClassLoader, getRequiresReply, handleMessageInternal, hasAdviceChain, onInit, setAdviceChain, setBeanClassLoader, setRequiresReplyクラス org.springframework.integration.handler.AbstractMessageProducingHandler から継承されたメソッド
addNotPropagatedHeaders, createOutputMessage, getNotPropagatedHeaders, getOutputChannel, isAsync, messageBuilderForReply, produceOutput, resolveErrorChannel, sendErrorMessage, sendOutput, sendOutputs, setAsync, setNotPropagatedHeaders, setOutputChannel, setOutputChannelName, setSendTimeout, setupMessageProcessor, shouldCopyRequestHeaders, shouldSplitOutput, updateNotPropagatedHeadersクラス org.springframework.integration.handler.AbstractMessageHandler から継承されたメソッド
handleMessage, onComplete, onError, onNext, onSubscribe, setObservationConventionクラス org.springframework.integration.handler.MessageHandlerSupport から継承されたメソッド
buildSendTimer, destroy, getManagedName, getManagedType, getMetricsCaptor, getObservationRegistry, getOrder, getOverrides, isLoggingEnabled, isObserved, registerMetricsCaptor, registerObservationRegistry, sendTimer, setLoggingEnabled, setManagedName, setManagedType, setOrder, setShouldTrack, shouldTrackクラス org.springframework.integration.context.IntegrationObjectSupport から継承されたメソッド
afterPropertiesSet, extractTypeIfPossible, generateId, getApplicationContext, getApplicationContextId, getBeanDescription, getBeanFactory, getBeanName, getChannelResolver, getComponentDescription, getComponentName, getComponentSource, getConversionService, getExpression, getIntegrationProperties, getMessageBuilderFactory, getTaskScheduler, isInitialized, setApplicationContext, setBeanFactory, setBeanName, setChannelResolver, setComponentDescription, setComponentName, setComponentSource, setConversionService, setMessageBuilderFactory, setPrimaryExpression, setTaskScheduler, toStringクラス java.lang.ObjectSE から継承されたメソッド
clone, equalsSE, finalize, getClass, hashCode, notify, notifyAll, wait, waitSE, waitSEインターフェース reactor.core.CoreSubscriber から継承されたメソッド
currentContextインターフェース org.springframework.integration.support.management.IntegrationManagement から継承されたメソッド
getThisAsインターフェース org.springframework.integration.support.context.NamedComponent から継承されたメソッド
getBeanName, getComponentName
コンストラクターの詳細
ContentEnricher
public ContentEnricher()
メソッドの詳細
setNullResultPropertyExpressions
public void setNullResultPropertyExpressions(MapSE<StringSE, Expression> nullResultPropertyExpressions) setNullResultHeaderExpressions
public void setNullResultHeaderExpressions(MapSE<StringSE, HeaderValueMessageProcessor<?>> nullResultHeaderExpressions) setPropertyExpressions
ターゲットペイロードを強化するときに評価する式のマップを提供します。キーは単にプロパティ名である必要があり、値はルートオブジェクトとしての応答メッセージに対して評価される式である必要があります。- パラメーター:
propertyExpressions- プロパティ式。
setHeaderExpressions
ターゲット MessageHeaders を強化するときに評価するHeaderValueMessageProcessorのマップを提供します。キーは単にヘッダー名である必要があり、値はルートオブジェクトとしての応答メッセージに対して評価される式である必要があります。- パラメーター:
headerExpressions- ヘッダー式。
setRequestChannel
コンテンツエンリッチャーリクエストチャネルを設定します。指定した場合、内部ゲートウェイが初期化されます。リクエストチャネルの設定はオプションです。リクエストチャネルを設定しないことは、メッセージペイロードが静的な値のみで強化される状況で役立ちます。- パラメーター:
requestChannel- リクエストチャネル。
setRequestChannelName
setReplyChannel
コンテンツエンリッチャーの返信チャネルを設定します。指定されていないが、リクエストチャネルが設定されている場合、匿名の応答チャネルがリクエストごとに自動的に作成されます。- パラメーター:
replyChannel- 返信チャンネル。
setReplyChannelName
setErrorChannel
コンテンツエンリッチャーエラーチャネルを設定して、ダウンストリームフローで例外が発生した場合に、エラー処理フローがエンリッチメントに使用する代替オブジェクトを返すことができるようにします。- パラメーター:
errorChannel- エラーチャネル。- 導入:
- 4.1
setErrorChannelName
setRequestTimeout
リクエストメッセージ送信時のタイムアウト値を設定します。明示的に構成されていない場合、デフォルトは 30 秒です。- パラメーター:
requestTimeout- ミリ秒単位のタイムアウト値。null であってはなりません。
setReplyTimeout
応答メッセージ受信時のタイムアウト値を設定します。明示的に構成されていない場合、デフォルトは 30 秒です。- パラメーター:
replyTimeout- ミリ秒単位のタイムアウト値。null であってはなりません。
setRequestPayloadExpression
デフォルトでは、元のメッセージのペイロードが、リクエストチャネルに送信される実際のペイロードとして使用されます。この setter の値として SpEL 式を提供することにより、元のペイロードのサブセット、ヘッダー値、その他の解決可能な SpEL 式を、リクエストチャネルに送信されるペイロードのベースとして使用できます。
式の評価では、完全なメッセージをルートオブジェクトとして使用できます。
たとえば、(特に)次の SpEL 式が可能です。
- payload.foo
- headers.foobar
- 新しい java.util.Date()
- "foo" + "bar"
より高度なロジックが必要な場合(メッセージヘッダーの変更など)、追加のダウンストリームトランスフォーマーを使用してください。
- パラメーター:
requestPayloadExpression- リクエストペイロード式。
setShouldClonePayload
public void setShouldClonePayload(boolean shouldClonePayload) ペイロードオブジェクトを複製してターゲットオブジェクトを作成するかどうかを指定します。これは、Cloneable を実装するペイロード型にのみ適用されます。- パラメーター:
shouldClonePayload- ペイロードを複製する必要がある場合は true。
setIntegrationEvaluationContext
getComponentType
クラスからコピーされた説明:IntegrationObjectSupportサブクラスはこのメソッドを実装して、コンポーネント型情報を提供できます。- 次で指定:
- インターフェース
NamedComponentのgetComponentType - オーバーライド:
- クラス
MessageHandlerSupportのgetComponentType
getIntegrationPatternType
インターフェースからコピーされた説明:IntegrationPatternこのコンポーネントが実装するパターン型を返します。- 次で指定:
- インターフェース
IntegrationPatternのgetIntegrationPatternType - オーバーライド:
- クラス
AbstractReplyProducingMessageHandlerのgetIntegrationPatternType - 戻り値:
- このコンポーネントが実装する
IntegrationPatternType
doInit
protected void doInit()コンテンツエンリッチャーを初期化します。requestChannel が設定されている場合は、内部ゲートウェイをインスタンス化します。- オーバーライド:
- クラス
AbstractReplyProducingMessageHandlerのdoInit
handleRequestMessage
クラスからコピーされた説明:AbstractReplyProducingMessageHandlerサブクラスはこのメソッドを実装して、リクエストメッセージを処理する必要があります。戻り値は、メッセージ、MessageBuilder、任意のプレーンオブジェクトです。基本クラスは、これらの開始点のいずれかからの返信メッセージの最終的な作成を処理します。戻り値が null の場合、メッセージフローはここで終了します。- 次で指定:
- クラス
AbstractReplyProducingMessageHandlerのhandleRequestMessage - パラメーター:
requestMessage- リクエストメッセージ。- 戻り値:
- メッセージを処理した結果、または
null
start
public void start()ライフサイクルの実装。requestChannel が定義されていない場合、ゲートウェイは初期化されないため、このメソッドは効果がありません。- 次で指定:
- インターフェース
Lifecycleのstart - 次で指定:
- インターフェース
ManageableLifecycleのstart
stop
public void stop()ライフサイクルの実装。requestChannel が定義されていない場合、ゲートウェイは初期化されないため、このメソッドは効果がありません。- 次で指定:
- インターフェース
Lifecycleのstop - 次で指定:
- インターフェース
ManageableLifecycleのstop
isRunning
public boolean isRunning()ライフサイクル実装。requestChannel が定義されていない場合、ゲートウェイが初期化されていないため、このメソッドは常に true を返します。- 次で指定:
- インターフェース
LifecycleのisRunning - 次で指定:
- インターフェース
ManageableLifecycleのisRunning