クラス AbstractClientConnectionFactory
java.lang.ObjectSE
org.springframework.integration.context.IntegrationObjectSupport
org.springframework.integration.ip.tcp.connection.AbstractConnectionFactory
org.springframework.integration.ip.tcp.connection.AbstractClientConnectionFactory
- 実装されているすべてのインターフェース:
Aware、BeanFactoryAware、BeanNameAware、InitializingBean、ApplicationContextAware、ApplicationEventPublisherAware、Lifecycle、ComponentSourceAware、ExpressionCapable、ConnectionFactory、NamedComponent、ManageableLifecycle
- 既知の直属サブクラス
CachingClientConnectionFactory、FailoverClientConnectionFactory、TcpNetClientConnectionFactory、TcpNioClientConnectionFactory、ThreadAffinityClientConnectionFactory
クライアント接続ファクトリの抽象クラス。クライアント接続ファクトリは発信接続を確立します。
- 導入:
- 2.0
- 作成者:
- Gary Russell, Artem Bilan, Trung Pham
フィールドのサマリー
クラス org.springframework.integration.ip.tcp.connection.AbstractConnectionFactory から継承されたフィールド
connections, connectionsMonitor, DEFAULT_REPLY_TIMEOUT, lifecycleMonitorクラス org.springframework.integration.context.IntegrationObjectSupport から継承されたフィールド
EXPRESSION_PARSER, loggerコンストラクターの概要
コンストラクターメソッドのサマリー
修飾子と型メソッド説明protected TcpConnectionSupportvoidこのファクトリによって作成された接続に自動的に(デフォルト)またはTcpListenerを追加するかどうかを設定します。voidforceClose(TcpConnection connection) 接続を強制的に閉じ、共有接続の場合はフィールドを null にします。接続を取得します。AbstractConnectionFactory.setSingleUse(boolean)が true で呼び出された場合、新しい接続が返されます。それ以外の場合、接続が開いたままの状態で、単一の接続がすべてのリクエストに再利用されます。protected PredicateSE<TcpConnectionSupport> 新しい接続をテストするために呼び出されるPredicateSE を取得します。接続を受け入れるには true を返し、拒否を false に返します。protected DurationSEprotected TcpConnectionSupportprotected voidinitializeConnection(TcpConnectionSupport connection, SocketSE socket) (デ) シリアライザー、singleUse などの属性を新しい接続に転送します。protected TcpConnectionSupportprotected final TcpConnectionSupportprotected final TcpConnectionSupportvoidsetConnectionTest(PredicateSE<TcpConnectionSupport> connectionTest) 新しい接続をテストするために呼び出されるPredicateSE を設定します。接続を受け入れるには true を返し、拒否を false に返します。voidsetConnectTimeout(int connectTimeout) 接続タイムアウトを秒単位で設定します。protected voidsetTheConnection(TcpConnectionSupport theConnection) クラス org.springframework.integration.ip.tcp.connection.AbstractConnectionFactory から継承されたメソッド
addConnection, checkActive, closeConnection, delayRead, doAccept, getApplicationEventPublisher, getDelayedReads, getDeserializer, getHost, getLifecycleMonitor, getListener, getMapper, getOpenConnectionIds, getPort, getReadDelay, getSender, getSenders, getSerializer, getSoLinger, getSoReceiveBufferSize, getSoSendBufferSize, getSoTimeout, getSoTrafficClass, getSslHandshakeTimeout, getTaskExecutor, getTcpSocketSupport, harvestClosedConnections, isActive, isLookupHost, isRunning, isSingleUse, isSoKeepAlive, isSoTcpNoDelay, onInit, processNioSelections, registerListener, registerSender, setActive, setApplicationEventPublisher, setDeserializer, setHost, setInterceptorFactoryChain, setLeaveOpen, setLookupHost, setMapper, setNioHarvestInterval, setPort, setReadDelay, setSerializer, setSingleUse, setSocketAttributes, setSoKeepAlive, setSoLinger, setSoReceiveBufferSize, setSoSendBufferSize, setSoTcpNoDelay, setSoTimeout, setSoTrafficClass, setSslHandshakeTimeout, setTaskExecutor, setTcpSocketSupport, start, stop, toString, unregisterSender, wrapConnectionクラス org.springframework.integration.context.IntegrationObjectSupport から継承されたメソッド
afterPropertiesSet, extractTypeIfPossible, generateId, getApplicationContext, getApplicationContextId, getBeanDescription, getBeanFactory, getBeanName, getChannelResolver, getComponentDescription, getComponentName, getComponentSource, getComponentType, getConversionService, getExpression, getIntegrationProperties, getMessageBuilderFactory, getTaskScheduler, isInitialized, setApplicationContext, setBeanFactory, setBeanName, setChannelResolver, setComponentDescription, setComponentName, setComponentSource, setConversionService, setMessageBuilderFactory, setPrimaryExpression, setTaskScheduler
コンストラクターの詳細
AbstractClientConnectionFactory
ホストとポートへの接続を確立するファクトリを構築します。- パラメーター:
host- ザホスト。port- ポート。
メソッドの詳細
setConnectTimeout
public void setConnectTimeout(int connectTimeout) 接続タイムアウトを秒単位で設定します。デフォルトは 60 です。- パラメーター:
connectTimeout- タイムアウト。- 導入:
- 5.2
getConnectTimeout
enableManualListenerRegistration
public void enableManualListenerRegistration()このファクトリによって作成された接続に自動的に(デフォルト)またはTcpListenerを追加するかどうかを設定します。デフォルトでは、ファクトリはリスナーを自動的に構成します。手動登録が行われると、リスナーが登録されるまで受信メッセージが遅延します。- 導入:
- 1.4.5
getConnectionTest
新しい接続をテストするために呼び出されるPredicateSE を取得します。接続を受け入れるには true を返し、拒否を false に返します。- 戻り値:
- 述語。
- 導入:
- 5.3
setConnectionTest
新しい接続をテストするために呼び出されるPredicateSE を設定します。接続を受け入れるには true を返し、拒否を false に返します。- パラメーター:
connectionTest- 述語。- 導入:
- 5.3
getConnection
接続を取得します。AbstractConnectionFactory.setSingleUse(boolean)が true で呼び出された場合、新しい接続が返されます。それ以外の場合、接続が開いたままの状態で、単一の接続がすべてのリクエストに再利用されます。- 例外:
InterruptedExceptionSE- 中断された場合。
obtainConnection
obtainNewConnection
buildNewConnection
initializeConnection
(デ) シリアライザ、singleUse などの属性を新しい接続に転送します。接続ファクトリに TCPListener (レスポンスの読み取り用) への参照がある場合、または単一使用の接続の場合、接続が実行されます。単一使用の接続では、ソケットのタイムアウト後に接続を閉じるために、接続から読み取る必要があります。- パラメーター:
connection- 新しい接続。socket- 新しいソケット。
setTheConnection
- パラメーター:
theConnection- 設定する theConnection
getTheConnection
- 戻り値:
- theConnection
forceClose
接続を強制的に閉じ、共有接続の場合はフィールドを null にします。- パラメーター:
connection- 接続。