public abstract class AbstractConnectionFactory extends IntegrationObjectSupport implements ConnectionFactory, ApplicationEventPublisherAware
| 修飾子と型 | フィールドと説明 |
|---|---|
protected static int | DEFAULT_REPLY_TIMEOUT |
protected ObjectSE | lifecycleMonitor |
EXPRESSION_PARSER, logger| コンストラクターと説明 |
|---|
AbstractConnectionFactory(int port) |
AbstractConnectionFactory(StringSE host, int port) |
| 修飾子と型 | メソッドと説明 |
|---|---|
protected void | addConnection(TcpConnectionSupport connection) |
protected void | checkActive() |
boolean | closeConnection(StringSE connectionId) 指定された接続 ID の接続を閉じます。 |
protected void | delayRead(SelectorSE selector, long now, SelectionKeySE key) |
protected void | doAccept(SelectorSE selector, ServerSocketChannelSE server, long now) |
ApplicationEventPublisher | getApplicationEventPublisher() |
protected BlockingQueueSE<org.springframework.integration.ip.tcp.connection.AbstractConnectionFactory.PendingIO> | getDelayedReads() |
Deserializer<?> | getDeserializer() |
StringSE | getHost() |
protected ObjectSE | getLifecycleMonitor() |
TcpListener | getListener() |
TcpMessageMapper | getMapper() |
ListSE<StringSE> | getOpenConnectionIds()(現在)開いている TcpConnection 接続 ID のリストを返します。たとえば、開いているすべての接続へのブロードキャスト操作を許可します。 |
int | getPort() |
protected long | getReadDelay() |
TcpSender | getSender() |
ListSE<TcpSender> | getSenders() 送信者のリストを返します。 |
Serializer<?> | getSerializer() |
int | getSoLinger() |
int | getSoReceiveBufferSize() |
int | getSoSendBufferSize() |
int | getSoTimeout() |
int | getSoTrafficClass() |
protected IntegerSE | getSslHandshakeTimeout() |
protected ExecutorSE | getTaskExecutor()taskExecutor を作成します (提供されていない場合)。 |
protected TcpSocketSupport | getTcpSocketSupport() |
protected void | harvestClosedConnections() 閉じられた接続を削除して this.connections をクリーンアップします。 |
protected boolean | isActive() |
boolean | isLookupHost() |
boolean | isRunning() |
boolean | isSingleUse() |
boolean | isSoKeepAlive() |
boolean | isSoTcpNoDelay() |
protected void | onInit() サブクラスは、初期化ロジック用にこれを実装できます。 |
protected void | processNioSelections(int selectionCount, SelectorSE selector, ServerSocketChannelSE server, MapSE<SocketChannelSE, TcpNioConnection> connectionMap) 期限切れの接続をタイムアウトし、 selectionCount > 0 の場合は、選択された鍵を処理します。 |
void | registerListener(TcpListener listenerToRegister) ペイロードが入力データから変換された後、メッセージを受信するために TcpListener を登録します。 |
void | registerSender(TcpSender senderToRegister)TcpSender を登録します。サーバーソケットの場合、接続情報を提供するために使用されるため、送信者は受信メッセージに返信するために使用できます。 |
protected void | setActive(boolean active) |
void | setApplicationEventPublisher(ApplicationEventPublisher applicationEventPublisher) |
void | setDeserializer(Deserializer<?> deserializer) |
void | setHost(StringSE host) ホストを設定します。ファクトリを停止する必要があります。 |
void | setInterceptorFactoryChain(TcpConnectionInterceptorFactoryChain interceptorFactoryChain) |
void | setLeaveOpen(boolean leaveOpen)true の場合、このファクトリによって作成されたソケットが再利用されます。 |
void | setLookupHost(boolean lookupHost)true の場合、リモート IP アドレスで DNS 逆ルックアップが行われます。 |
void | setMapper(TcpMessageMapper mapper) |
void | setNioHarvestInterval(int nioHarvestInterval)soTimeout が 0 の場合に閉じられた NIO 接続をクリーンアップする頻度。 |
void | setPort(int port) ポートを設定します。ファクトリを停止する必要があります。 |
void | setReadDelay(long readDelay) 前の試行がスレッド不足のために失敗した後、読み取りを再試行するまでの遅延(ミリ秒)。 |
void | setSerializer(Serializer<?> serializer) |
void | setSingleUse(boolean singleUse)true の場合、このファクトリによって作成されたソケットが 1 回使用されます。 |
protected void | setSocketAttributes(SocketSE socket) ソケットのソケット属性を設定します。 |
void | setSoKeepAlive(boolean soKeepAlive) |
void | setSoLinger(int soLinger) |
void | setSoReceiveBufferSize(int soReceiveBufferSize) |
void | setSoSendBufferSize(int soSendBufferSize) |
void | setSoTcpNoDelay(boolean soTcpNoDelay) |
void | setSoTimeout(int soTimeout) |
void | setSoTrafficClass(int soTrafficClass) |
void | setSslHandshakeTimeout(int sslHandshakeTimeout)SSL ハンドシェイクデータを待機するときに使用されるハンドシェイクタイムアウトを設定します。NIO を使用する場合、SSL 接続にのみ適用されます。 |
void | setTaskExecutor(ExecutorSE taskExecutor) |
void | setTcpSocketSupport(TcpSocketSupport tcpSocketSupport) |
void | start() |
void | stop() サーバーの停止。 |
StringSE | toString() |
boolean | unregisterSender(TcpSender sender)TcpSender の登録を解除します。 |
protected TcpConnectionSupport | wrapConnection(TcpConnectionSupport connectionArg) |
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, setTaskSchedulercloneSE, equalsSE, finalizeSE, getClassSE, hashCodeSE, notifySE, notifyAllSE, waitSE, waitSE, waitSEgetConnectionprotected static final int DEFAULT_REPLY_TIMEOUT
protected final ObjectSE lifecycleMonitor
public AbstractConnectionFactory(int port)
public AbstractConnectionFactory(StringSE host, int port)
public void setApplicationEventPublisher(ApplicationEventPublisher applicationEventPublisher)
ApplicationEventPublisherAware の setApplicationEventPublisher @Nullable public ApplicationEventPublisher getApplicationEventPublisher()
protected void setSocketAttributes(SocketSE socket) throws SocketExceptionSE
socket - ソケット。SocketExceptionSE - SocketException。public int getSoTimeout()
public void setSoTimeout(int soTimeout)
soTimeout - 設定する soTimeoutpublic int getSoReceiveBufferSize()
public void setSoReceiveBufferSize(int soReceiveBufferSize)
soReceiveBufferSize - 設定する soReceiveBufferSizepublic int getSoSendBufferSize()
public void setSoSendBufferSize(int soSendBufferSize)
soSendBufferSize - 設定する soSendBufferSizepublic boolean isSoTcpNoDelay()
public void setSoTcpNoDelay(boolean soTcpNoDelay)
soTcpNoDelay - 設定する soTcpNoDelaypublic int getSoLinger()
public void setSoLinger(int soLinger)
soLinger - 設定する soLingerpublic boolean isSoKeepAlive()
public void setSoKeepAlive(boolean soKeepAlive)
soKeepAlive - 設定する soKeepAlivepublic int getSoTrafficClass()
public void setSoTrafficClass(int soTrafficClass)
soTrafficClass - 設定する soTrafficClasspublic void setHost(StringSE host)
host - ザホスト。public StringSE getHost()
public void setPort(int port)
port - ポート。public int getPort()
@Nullable public TcpListener getListener()
public Serializer<?> getSerializer()
public Deserializer<?> getDeserializer()
public TcpMessageMapper getMapper()
public void registerListener(TcpListener listenerToRegister)
listenerToRegister - TcpListener。public void registerSender(TcpSender senderToRegister)
senderToRegister - 送り主 public boolean unregisterSender(TcpSender sender)
sender - 送り主。public void setTaskExecutor(ExecutorSE taskExecutor)
taskExecutor - 設定する taskExecutorpublic void setDeserializer(Deserializer<?> deserializer)
deserializer - 設定するデシリアライザー public void setSerializer(Serializer<?> serializer)
serializer - 設定するシリアライザー public void setMapper(TcpMessageMapper mapper)
mapper - 設定するマッパー。デフォルトは TcpMessageMapper です public boolean isSingleUse()
public void setSingleUse(boolean singleUse)
singleUse - 設定する singleUse。public void setLeaveOpen(boolean leaveOpen)
setSingleUse(boolean) の逆。leaveOpen - 設定する keepOpen。public void setInterceptorFactoryChain(TcpConnectionInterceptorFactoryChain interceptorFactoryChain)
public void setLookupHost(boolean lookupHost)
lookupHost - 設定する lookupHostpublic boolean isLookupHost()
public void setNioHarvestInterval(int nioHarvestInterval)
soTimeout > 0 の場合は無視されます。デフォルトは 2000 ミリ秒です。nioHarvestInterval - ミリ秒単位の間隔。public void setSslHandshakeTimeout(int sslHandshakeTimeout)
sslHandshakeTimeout - タイムアウト。@Nullable protected IntegerSE getSslHandshakeTimeout()
setSslHandshakeTimeout(int)protected BlockingQueueSE<org.springframework.integration.ip.tcp.connection.AbstractConnectionFactory.PendingIO> getDelayedReads()
protected long getReadDelay()
public void setReadDelay(long readDelay)
readDelay - readDelay を設定します。protected ObjectSE getLifecycleMonitor()
protected void onInit()
IntegrationObjectSupportIntegrationObjectSupport の onInit public void start()
Lifecycle の start ManageableLifecycle の start protected ExecutorSE getTaskExecutor()
public void stop()
Lifecycle の stop ManageableLifecycle の stop protected TcpConnectionSupport wrapConnection(TcpConnectionSupport connectionArg)
protected void processNioSelections(int selectionCount,
SelectorSE selector,
@Nullable
ServerSocketChannelSE server,
MapSE<SocketChannelSE,TcpNioConnection> connectionMap)selectionCount > 0 の場合は、選択された鍵を処理します。connections フィールドおよび connections パラメーターから閉じた接続を削除します。selectionCount - IO イベントの数。0 の場合、おそらくクローズによって起こされました。selector - セレクタ。server - サーバーソケットチャネル。connectionMap - 接続のマップ。protected void delayRead(SelectorSE selector, long now, SelectionKeySE key)
protected void doAccept(SelectorSE selector, ServerSocketChannelSE server, long now)
selector - セレクタ。server - サーバーソケットチャネル。now - 現在の時刻。protected void addConnection(TcpConnectionSupport connection)
protected void harvestClosedConnections()
public boolean isRunning()
Lifecycle の isRunning ManageableLifecycle の isRunning protected boolean isActive()
protected void setActive(boolean active)
active - 設定するアクティブ protected void checkActive()
protected TcpSocketSupport getTcpSocketSupport()
public void setTcpSocketSupport(TcpSocketSupport tcpSocketSupport)
public ListSE<StringSE> getOpenConnectionIds()
TcpConnection 接続 ID のリストを返します。たとえば、開いているすべての接続へのブロードキャスト操作を許可します。public boolean closeConnection(StringSE connectionId)
connectionId - 接続 ID。public StringSE toString()
IntegrationObjectSupport の toString