インターフェース IntegrationFlowContext
- すべての既知の実装クラス:
StandardIntegrationFlowContext
public interface IntegrationFlowContext
標準の Bean 登録フェーズではなく、
IntegrationFlow
の動的(手動)登録用のパブリック API。このコンポーネントの Bean は、フレームワークを介して自動的に提供されます。Bean 名は、大文字と小文字を区別しないクラス名に基づいています。使用する前に、ターゲットサービスに注入する必要があります。
典型的なユースケース、アルゴリズムは次のとおりです。
- ビジネスロジックに応じて
IntegrationFlow
インスタンスを作成します - オプションの
id
およびautoStartup
フラグを使用して、そのIntegrationFlow
をこのIntegrationFlowContext
に登録します。 - その
IntegrationFlow
のMessagingTemplate
を取得し(MessageChannel
から開始された場合)、メッセージをIntegrationFlow
に送信(または送受信)します。 - この
IntegrationFlowContext
からid
によってIntegrationFlow
を削除します
便宜上、関連する IntegrationFlowContext.IntegrationFlowRegistration
は登録後に返されます。ターゲット IntegrationFlow
へのアクセス、またはそのライフサイクルでの操作に使用できます。
- 導入:
- 5.0
- 作成者:
- Artem Bilan, Gary Russell, Artem Vozhdayenko
- 関連事項:
ネストされたクラスのサマリー
ネストされたクラス修飾子と型インターフェース説明static interface
static interface
アプリケーションコンテキストでIntegrationFlow
を登録するオプションの Builder パターン実装。メソッドのサマリー
修飾子と型メソッド説明getRegistrationById
(StringSE flowId) 統合フロー名のIntegrationFlowContext.IntegrationFlowRegistration
インスタンスへのマッピングの状態を提供します。default boolean
isUseIdAsPrefix
(StringSE flowId) true を返すと、フロー Bean 名の前にフロー ID とピリオドが付きます。messagingTemplateFor
(StringSE flowId) registration
(IntegrationFlow integrationFlow) アソシエイトは、IntegrationFlow
にIntegrationFlowContext.IntegrationFlowRegistrationBuilder
を提供して、アプリケーションコンテキストでの追加オプションとさらなる登録を実現しました。void
提供されたflowId
のIntegrationFlow
Bean(およびそれに依存するすべての Bean)を破棄し、そのすべてのローカルキャッシュをクリーンアップします。
メソッドの詳細
registration
IntegrationFlowContext.IntegrationFlowRegistrationBuilder registration(IntegrationFlow integrationFlow) アソシエイトは、IntegrationFlow
にIntegrationFlowContext.IntegrationFlowRegistrationBuilder
を提供して、アプリケーションコンテキストでの追加オプションとさらなる登録を実現しました。- パラメーター:
integrationFlow
- 登録するIntegrationFlow
- 戻り値:
- 提供された
IntegrationFlow
に関連付けられた IntegrationFlowRegistrationBuilder
getRegistrationById
- パラメーター:
flowId
- 取得する Bean 名- 戻り値:
- 提供された
id
またはnull
の IntegrationFlowRegistration
remove
提供されたflowId
のIntegrationFlow
Bean(およびそれに依存するすべての Bean)を破棄し、そのすべてのローカルキャッシュをクリーンアップします。- パラメーター:
flowId
- 破棄する Bean 名
messagingTemplateFor
提供されたflowId
のIntegrationFlow
の入力チャネルにデフォルトの宛先が設定されたMessagingTemplate
を取得します。この方法では、任意の
IntegrationFlow
Bean(手動で登録しただけでなく)を使用できます。IntegrationFlow
がMessageChannel
で始まらない場合、IllegalStateException
SE がスローされます。- パラメーター:
flowId
- 入力チャネルを取得するための Bean 名- 戻り値:
MessagingTemplate
インスタンス
getRegistry
MapSE<StringSE,IntegrationFlowContext.IntegrationFlowRegistration> getRegistry()統合フロー名のIntegrationFlowContext.IntegrationFlowRegistration
インスタンスへのマッピングの状態を提供します。- 戻り値:
- フロー ID のレジストリとその登録。
isUseIdAsPrefix
true を返すと、フロー Bean 名の前にフロー ID とピリオドが付きます。- パラメーター:
flowId
- フロー ID。- 戻り値:
- プレフィックスとして使用する場合は true。
- 導入:
- 5.0.6