クラス TcpSendingMessageHandler
java.lang.ObjectSE
org.springframework.integration.context.IntegrationObjectSupport
org.springframework.integration.handler.MessageHandlerSupport
org.springframework.integration.handler.AbstractMessageHandler
org.springframework.integration.ip.tcp.outbound.TcpSendingMessageHandler
- 実装済みのインターフェース一覧:
org.reactivestreams.Subscriber<Message<?>>, Aware, BeanFactoryAware, BeanNameAware, DisposableBean, InitializingBean, ApplicationContextAware, Lifecycle, Ordered, ComponentSourceAware, ExpressionCapable, Orderable, IntegrationPattern, ClientModeCapable, TcpSender, NamedComponent, IntegrationManagement, ManageableLifecycle, TrackableComponent, MessageHandler, reactor.core.CoreSubscriber<Message<?>>
public class TcpSendingMessageHandler
extends AbstractMessageHandler
implements TcpSender, ManageableLifecycle, ClientModeCapable
TcpConnection を使用してデータを送信する Tcp 送信チャネルアダプター - 接続ファクトリがサーバーファクトリである場合、TcpListener が接続を所有します。クライアントファクトリの場合、このオブジェクトが接続を所有します。
- 導入:
- 2.0
- 作成者:
- Gary Russell, Artem Bilan, Christian Tzolov
ネストされたクラスの概要
インターフェース IntegrationManagement から継承されたネストクラス / インターフェース
IntegrationManagement.ManagementOverridesフィールド概要
フィールド修飾子と型フィールド説明static final longClientModeConnectionManager再スケジュールのデフォルトの再試行間隔。protected final LockSEクラス IntegrationObjectSupport から継承されたフィールド
EXPRESSION_PARSER, loggerインターフェース IntegrationManagement から継承されたフィールド
METER_PREFIX, RECEIVE_COUNTER_NAME, SEND_TIMER_NAMEインターフェース Ordered から継承されたフィールド
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCEコンストラクター概要
コンストラクター方法の概要
修飾子と型メソッド説明voidaddNewConnection(TcpConnection connection) TcpListenerが所有するソケットを使用している場合、このメソッドは新しい接続が確立されるたびに呼び出されます。protected TcpConnection実際に書き込みを行うメソッド。protected @Nullable ConnectionFactoryprotected MapSE<StringSE, TcpConnection> longprotected @Nullable ConnectionFactoryvoidhandleMessageInternal(Message<?> message) 指定されたメッセージ形式を使用して、基になるソケットにメッセージペイロードを書き込みます。booleanbooleanbooleanprotected TcpConnectionobtainConnection(Message<?> message) protected voidonInit()サブクラスは、初期化ロジック用にこれを実装できます。voidremoveDeadConnection(TcpConnection connection) TcpListenerが所有するソケットを使用している場合、このメソッドは接続が閉じられるたびに呼び出されます。voidすぐに接続の確立を試みてください。voidsetClientMode(boolean isClientMode) voidsetConnectionFactory(AbstractConnectionFactory connectionFactory) クライアントまたはサーバー接続ファクトリを設定します。この場合(送信アダプター)、ファクトリがサーバー接続ファクトリである場合、ソケットは受信チャネルアダプターによって所有され、このアダプターは応答の送信に使用されます。voidsetRetryInterval(long retryInterval) voidstart()voidstop()クラス AbstractMessageHandler から継承されたメソッド
handleMessage, onComplete, onError, onNext, onSubscribe, setObservationConventionクラス MessageHandlerSupport から継承されたメソッド
buildSendTimer, destroy, getIntegrationPatternType, getManagedName, getManagedType, getMetricsCaptor, getObservationRegistry, getOrder, getOverrides, isLoggingEnabled, isObserved, registerMetricsCaptor, registerObservationRegistry, sendTimer, setLoggingEnabled, setManagedName, setManagedType, setOrder, setShouldTrack, shouldTrackクラス 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クラス ObjectSE から継承されたメソッド
clone, equalsSE, finalize, getClass, hashCode, notify, notifyAll, wait, waitSE, waitSEインターフェース reactor.core.CoreSubscriber から継承されたメソッド
currentContextインターフェース IntegrationManagement から継承されたメソッド
getThisAsインターフェース NamedComponent から継承されたメソッド
getBeanName, getComponentName
フィールドの詳細
DEFAULT_RETRY_INTERVAL
public static final long DEFAULT_RETRY_INTERVALClientModeConnectionManager再スケジュールのデフォルトの再試行間隔。- 関連事項:
lifecycleMonitor
コンストラクターの詳細
TcpSendingMessageHandler
public TcpSendingMessageHandler()
方法の詳細
obtainConnection
handleMessageInternal
指定されたメッセージ形式を使用して、基になるソケットにメッセージペイロードを書き込みます。- 次で指定:
- クラス
AbstractMessageHandlerのhandleMessageInternal - 関連事項:
doWrite
実際に書き込みを行うメソッド。- パラメーター:
message- 書くメッセージ。- 戻り値:
- 接続。
setConnectionFactory
クライアントまたはサーバー接続ファクトリを設定します。この場合(送信アダプター)、ファクトリがサーバー接続ファクトリである場合、ソケットは受信チャネルアダプターによって所有され、このアダプターは応答の送信に使用されます。- パラメーター:
connectionFactory- 設定する connectionFactory
addNewConnection
インターフェースからコピーされた説明:TcpSenderTcpListenerが所有するソケットを使用している場合、このメソッドは新しい接続が確立されるたびに呼び出されます。- 次で指定:
- インターフェース
TcpSender内のaddNewConnection - パラメーター:
connection- 接続。
removeDeadConnection
インターフェースからコピーされた説明:TcpSenderTcpListenerが所有するソケットを使用している場合、このメソッドは接続が閉じられるたびに呼び出されます。- 次で指定:
- インターフェース
TcpSender内のremoveDeadConnection - パラメーター:
connection- 接続。
getComponentType
- 次で指定:
- インターフェース
NamedComponent内のgetComponentType - オーバーライド:
- クラス
MessageHandlerSupportのgetComponentType
onInit
protected void onInit()クラスからコピーされた説明:IntegrationObjectSupportサブクラスは、初期化ロジック用にこれを実装できます。- オーバーライド:
- クラス
IntegrationObjectSupportのonInit
start
public void start()- 次で指定:
- インターフェース
Lifecycle内のstart - 次で指定:
- インターフェース
ManageableLifecycle内のstart
stop
public void stop()- 次で指定:
- インターフェース
Lifecycle内のstop - 次で指定:
- インターフェース
ManageableLifecycle内のstop
isRunning
public boolean isRunning()- 次で指定:
- インターフェース
Lifecycle内のisRunning - 次で指定:
- インターフェース
ManageableLifecycle内のisRunning
getClientConnectionFactory
- 戻り値:
- clientConnectionFactory
getServerConnectionFactory
- 戻り値:
- serverConnectionFactory
getConnections
- 戻り値:
- 接続
isClientMode
public boolean isClientMode()- 次で指定:
- インターフェース
ClientModeCapable内のisClientMode - 戻り値:
- isClientMode
setClientMode
public void setClientMode(boolean isClientMode) - パラメーター:
isClientMode- 設定する isClientMode
getRetryInterval
public long getRetryInterval()- 戻り値:
- retryInterval
setRetryInterval
public void setRetryInterval(long retryInterval) - パラメーター:
retryInterval- 設定する retryInterval
isClientModeConnected
public boolean isClientModeConnected()- 次で指定:
- インターフェース
ClientModeCapable内のisClientModeConnected - 戻り値:
- エンドポイントがクライアントモードで実行されている場合は true。
retryConnection
public void retryConnection()インターフェースからコピーされた説明:ClientModeCapableすぐに接続の確立を試みてください。- 次で指定:
- インターフェース
ClientModeCapable内のretryConnection