public abstract class AbstractClientConnectionFactory extends AbstractConnectionFactory
DEFAULT_REPLY_TIMEOUT, lifecycleMonitor
EXPRESSION_PARSER, logger
コンストラクターと説明 |
---|
AbstractClientConnectionFactory(StringSE host, int port) ホストとポートへの接続を確立するファクトリを構築します。 |
修飾子と型 | メソッドと説明 |
---|---|
protected TcpConnectionSupport | buildNewConnection() |
void | enableManualListenerRegistration() このファクトリによって作成された接続に自動的に(デフォルト)または TcpListener を追加するかどうかを設定します。 |
void | forceClose(TcpConnection connection) 接続を強制的に閉じ、共有接続の場合はフィールドを null にします。 |
TcpConnectionSupport | getConnection() 接続を取得します。 AbstractConnectionFactory.setSingleUse(boolean) が true で呼び出された場合、新しい接続が返されます。そうでない場合は、接続が開いたままである間、すべてのリクエストに対して単一の接続が再利用されます。 |
protected java.util.function.PredicateSE<TcpConnectionSupport> | getConnectionTest() 新しい接続をテストするために呼び出される Predicate SE を取得します。接続を受け入れるには true を返し、拒否を false に返します。 |
protected java.time.Duration | getConnectTimeout() |
protected TcpConnectionSupport | getTheConnection() |
protected void | initializeConnection(TcpConnectionSupport connection, SocketSE socket) (デ) シリアライザー、singleUse などの属性を新しい接続に転送します。 |
protected TcpConnectionSupport | obtainConnection() |
protected TcpConnectionSupport | obtainNewConnection() |
protected TcpConnectionSupport | obtainSharedConnection() |
void | setConnectionTest(java.util.function.PredicateSE<TcpConnectionSupport> connectionTest) 新しい接続をテストするために呼び出される Predicate SE を設定します。接続を受け入れるには true を返し、拒否を false に返します。 |
void | setConnectTimeout(int connectTimeout) 接続タイムアウトを秒単位で設定します。 |
protected void | setTheConnection(TcpConnectionSupport theConnection) |
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
afterPropertiesSet, extractTypeIfPossible, generateId, getApplicationContext, getApplicationContextId, getBeanDescription, getBeanFactory, getBeanName, getChannelResolver, getComponentName, getComponentType, getConversionService, getExpression, getIntegrationProperties, getIntegrationProperty, getMessageBuilderFactory, getTaskScheduler, isInitialized, setApplicationContext, setBeanFactory, setBeanName, setChannelResolver, setComponentName, setConversionService, setMessageBuilderFactory, setPrimaryExpression, setTaskScheduler
cloneSE, equalsSE, finalizeSE, getClassSE, hashCodeSE, notifySE, notifyAllSE, waitSE, waitSE, waitSE
public AbstractClientConnectionFactory(StringSE host, int port)
host
- ザホスト。port
- ポート。public void setConnectTimeout(int connectTimeout)
connectTimeout
- タイムアウト。protected java.time.Duration getConnectTimeout()
public void enableManualListenerRegistration()
TcpListener
を追加するかどうかを設定します。デフォルトでは、ファクトリはリスナーを自動的に構成します。手動登録が行われると、リスナーが登録されるまで受信メッセージが遅延します。@Nullable protected java.util.function.PredicateSE<TcpConnectionSupport> getConnectionTest()
Predicate
SE を取得します。接続を受け入れるには true を返し、拒否を false に返します。public void setConnectionTest(@Nullable java.util.function.PredicateSE<TcpConnectionSupport> connectionTest)
Predicate
SE を設定します。接続を受け入れるには true を返し、拒否を false に返します。connectionTest
- 述語。public TcpConnectionSupport getConnection() throws InterruptedExceptionSE
AbstractConnectionFactory.setSingleUse(boolean)
が true で呼び出された場合、新しい接続が返されます。そうでない場合は、接続が開いたままである間、すべてのリクエストに対して単一の接続が再利用されます。InterruptedExceptionSE
- 中断された場合。protected TcpConnectionSupport obtainConnection() throws InterruptedExceptionSE
@Nullable protected final TcpConnectionSupport obtainSharedConnection() throws InterruptedExceptionSE
protected final TcpConnectionSupport obtainNewConnection() throws InterruptedExceptionSE
protected TcpConnectionSupport buildNewConnection()
protected void initializeConnection(TcpConnectionSupport connection, SocketSE socket)
connection
- 新しい接続。socket
- 新しいソケット。protected void setTheConnection(TcpConnectionSupport theConnection)
theConnection
- 設定する theConnection@Nullable protected TcpConnectionSupport getTheConnection()
public void forceClose(TcpConnection connection)
connection
- 接続。