クラス TcpNioServerConnectionFactory
java.lang.ObjectSE
org.springframework.integration.context.IntegrationObjectSupport
org.springframework.integration.ip.tcp.connection.AbstractConnectionFactory
org.springframework.integration.ip.tcp.connection.AbstractServerConnectionFactory
org.springframework.integration.ip.tcp.connection.TcpNioServerConnectionFactory
- 実装済みのインターフェース一覧:
RunnableSE, Aware, BeanFactoryAware, BeanNameAware, InitializingBean, ApplicationContextAware, ApplicationEventPublisherAware, Lifecycle, ComponentSourceAware, ExpressionCapable, OrderlyShutdownCapable, ConnectionFactory, TcpServerConnectionFactory, NamedComponent, ManageableLifecycle, SchedulingAwareRunnable
/** Implements a server connection factory that produces
TcpNioConnection s using a ServerSocketChannelSE . Must have a TcpListener registered.- 導入:
- 2.0
- 作成者:
- Gary Russell, Artem Bilan, Ngoc Nhan
ネストされたクラスの概要
クラス AbstractConnectionFactory から継承されたネストクラス / インターフェース
AbstractConnectionFactory.PendingIOフィールド概要
クラス AbstractConnectionFactory から継承されたフィールド
connections, connectionsMonitor, DEFAULT_REPLY_TIMEOUT, lifecycleMonitorクラス IntegrationObjectSupport から継承されたフィールド
EXPRESSION_PARSER, loggerコンストラクター概要
コンストラクター方法の概要
修飾子と型メソッド説明protected voiddoAccept(SelectorSE selectorForNewSocket, ServerSocketChannelSE server, long now) protected MapSE<SocketChannelSE, TcpNioConnection> intgetPort()このサーバーがリッスンしているポートを返します。protected @Nullable ServerSocketChannelSE@Nullable SocketAddressSE基になるServerSocketがバインドされているSocketAddressSE を返します。protected booleanvoidrun()リスナーが登録されていない場合は、終了します。voidsetMultiAccept(boolean multiAccept) セレクターキーの反復ごとに 1 つの接続のみを受け入れるには、falseに設定します。voidsetTcpNioConnectionSupport(TcpNioConnectionSupport tcpNioSupport) 使用するTcpNioConnectionSupportを設定します。voidsetUsingDirectBuffers(boolean usingDirectBuffers) ダイレクトバッファを使用するには、true に設定します。voidstop()サーバーの停止。クラス AbstractServerConnectionFactory から継承されたメソッド
afterShutdown, beforeShutdown, getBacklog, getConnection, getLocalAddress, initializeConnection, isListening, isLongLived, isShuttingDown, postProcessServerSocket, publishServerExceptionEvent, publishServerListeningEvent, setBacklog, setListening, setLocalAddress, startクラス AbstractConnectionFactory から継承されたメソッド
addConnection, checkActive, closeConnection, delayRead, getApplicationEventPublisher, getDelayedReads, getDeserializer, getHost, getLifecycleMonitor, getListener, getMapper, getOpenConnectionIds, 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, toString, unregisterSender, wrapConnectionクラス 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クラス ObjectSE から継承されたメソッド
clone, equalsSE, finalize, getClass, hashCode, notify, notifyAll, wait, waitSE, waitSEインターフェース SchedulingAwareRunnable から継承されたメソッド
getQualifier
コンストラクターの詳細
TcpNioServerConnectionFactory
public TcpNioServerConnectionFactory(int port) ポートの受信接続を待機します。- パラメーター:
port- ポート。
方法の詳細
setMultiAccept
public void setMultiAccept(boolean multiAccept) falseに設定すると、セレクタキーの反復処理ごとに 1 つの接続のみを受け入れます。これは、既存のソケットへの過剰な読み取りを避けるために必要になる場合があります。デフォルトでは、OP_ACCEPT操作の準備ができると、接続がなくなるまでループで接続を受け入れ続けます。- パラメーター:
multiAccept- 一度に 1 つずつ接続を受け入れる場合は false。- 導入:
- 5.1.4
getComponentType
- 次で指定:
- インターフェース
NamedComponent内のgetComponentType - オーバーライド:
- クラス
AbstractConnectionFactoryのgetComponentType
getPort
public int getPort()インターフェースからコピーされた説明:TcpServerConnectionFactoryこのサーバーがリッスンしているポートを返します。ファクトリがランダムポート (0) でリッスンするように構成されている場合、ファクトリの起動後に実際のポートが返されます。ファクトリが停止すると、以前の値を返す場合があります。- 次で指定:
- インターフェース
TcpServerConnectionFactory内のgetPort - オーバーライド:
- クラス
AbstractConnectionFactoryのgetPort - 戻り値:
- 港
getServerSocketAddress
インターフェースからコピーされた説明:TcpServerConnectionFactory基になるServerSocketがバインドされているSocketAddressSE を返します。- 戻り値:
- ソケットアドレス。
run
public void run()リスナーが登録されていない場合は、終了します。受信接続を受け入れ、新しい接続ごとに TcpConnections を作成します。{AbstractServerConnectionFactory.initializeConnection(TcpConnectionSupport, Socket)を呼び出し、タスクエグゼキュータを使用して接続Runnable.run()を実行します。サーバーソケット / チャネルの I/O エラーがログに記録され、ファクトリが停止します。doAccept
- オーバーライド:
- クラス
AbstractConnectionFactoryのdoAccept - パラメーター:
selectorForNewSocket- セレクタ。server- サーバーソケットチャネル。now- 現在の時刻。
stop
public void stop()クラスからコピーされた説明:AbstractConnectionFactoryサーバーの停止。- 次で指定:
- インターフェース
Lifecycle内のstop - 次で指定:
- インターフェース
ManageableLifecycle内のstop - オーバーライド:
- クラス
AbstractConnectionFactoryのstop
setUsingDirectBuffers
public void setUsingDirectBuffers(boolean usingDirectBuffers) ダイレクトバッファを使用するには、true に設定します。- パラメーター:
usingDirectBuffers- 直接の場合は true。
setTcpNioConnectionSupport
使用するTcpNioConnectionSupportを設定します。- パラメーター:
tcpNioSupport-TcpNioConnectionSupport
getServerChannel
- 戻り値:
- serverChannel
isUsingDirectBuffers
protected boolean isUsingDirectBuffers()- 戻り値:
- usingDirectBuffers
getConnections
- 戻り値:
- 接続