クラス TcpNetServerConnectionFactory
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.TcpNetServerConnectionFactory
- 実装されているすべてのインターフェース:
RunnableSE、Aware、BeanFactoryAware、BeanNameAware、InitializingBean、ApplicationContextAware、ApplicationEventPublisherAware、Lifecycle、ExpressionCapable、OrderlyShutdownCapable、ConnectionFactory、TcpServerConnectionFactory、NamedComponent、ManageableLifecycle、SchedulingAwareRunnable
public class TcpNetServerConnectionFactory extends AbstractServerConnectionFactory
- 導入:
- 2.0
- 作成者:
- Gary Russell, Artem Bilan, M á rio Dias
フィールドのサマリー
クラス org.springframework.integration.ip.tcp.connection.AbstractConnectionFactory から継承されたフィールド
DEFAULT_REPLY_TIMEOUT, lifecycleMonitorクラス org.springframework.integration.context.IntegrationObjectSupport から継承されたフィールド
EXPRESSION_PARSER, loggerコンストラクターの概要
コンストラクター コンストラクター 説明 TcpNetServerConnectionFactory(int port)ポートの受信接続を待機します。メソッドのサマリー
修飾子と型 メソッド 説明 protected ServerSocketSEcreateServerSocket(int port, int backlog, InetAddressSE whichNic)新しいServerSocketSE を作成します。StringSEgetComponentType()サブクラスはこのメソッドを実装して、コンポーネント型情報を提供できます。intgetPort()このサーバーがリッスンしているポートを返します。protected ServerSocketSEgetServerSocket()SocketAddressSEgetServerSocketAddress()基になるServerSocketがバインドされているSocketAddressSE を返します。protected TcpSocketFactorySupportgetTcpSocketFactorySupport()voidrun()リスナーが登録されていない場合は、終了します。voidsetTcpNetConnectionSupport(TcpNetConnectionSupport connectionSupport)接続オブジェクトの作成に使用するTcpNetConnectionSupportを設定します。voidsetTcpSocketFactorySupport(TcpSocketFactorySupport tcpSocketFactorySupport)voidstop()サーバーの停止。クラス org.springframework.integration.ip.tcp.connection.AbstractServerConnectionFactory から継承されたメソッド
afterShutdown, beforeShutdown, getBacklog, getConnection, getLocalAddress, initializeConnection, isListening, isLongLived, isShuttingDown, postProcessServerSocket, publishServerExceptionEvent, publishServerListeningEvent, setBacklog, setListening, setLocalAddress, startクラス org.springframework.integration.ip.tcp.connection.AbstractConnectionFactory から継承されたメソッド
addConnection, checkActive, closeConnection, delayRead, doAccept, 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クラス org.springframework.integration.context.IntegrationObjectSupport から継承されたメソッド
afterPropertiesSet, extractTypeIfPossible, generateId, getApplicationContext, getApplicationContextId, getBeanDescription, getBeanFactory, getBeanName, getChannelResolver, getComponentName, getConversionService, getExpression, getIntegrationProperties, getIntegrationProperty, getMessageBuilderFactory, getTaskScheduler, isInitialized, setApplicationContext, setBeanFactory, setBeanName, setChannelResolver, setComponentName, setConversionService, setMessageBuilderFactory, setPrimaryExpression, setTaskScheduler
コンストラクターの詳細
TcpNetServerConnectionFactory
public TcpNetServerConnectionFactory(int port)ポートの受信接続を待機します。- パラメーター:
port- ポート。
メソッドの詳細
getComponentType
クラスからコピーされた説明:IntegrationObjectSupportサブクラスはこのメソッドを実装して、コンポーネント型情報を提供できます。- 次で指定:
- インターフェース
NamedComponentのgetComponentType - オーバーライド:
- クラス
IntegrationObjectSupportのgetComponentType
getPort
public int getPort()インターフェースからコピーされた説明:TcpServerConnectionFactoryこのサーバーがリッスンしているポートを返します。ファクトリがランダムポート (0) でリッスンするように構成されている場合、ファクトリの起動後に実際のポートが返されます。ファクトリが停止すると、以前の値を返す場合があります。- 次で指定:
- インターフェース
TcpServerConnectionFactoryのgetPort - オーバーライド:
- クラス
AbstractConnectionFactoryのgetPort - 戻り値:
- 港
getServerSocketAddress
インターフェースからコピーされた説明:TcpServerConnectionFactory基になるServerSocketがバインドされているSocketAddressSE を返します。- 次で指定:
- インターフェース
TcpServerConnectionFactoryのgetServerSocketAddress - オーバーライド:
- クラス
AbstractServerConnectionFactoryのgetServerSocketAddress - 戻り値:
- ソケットアドレス。
setTcpSocketFactorySupport
setTcpNetConnectionSupport
接続オブジェクトの作成に使用するTcpNetConnectionSupportを設定します。- パラメーター:
connectionSupport- 接続サポート。- 導入:
- 5.0
run
public void run()リスナーが登録されていない場合は、終了します。受信接続を受け入れ、新しい接続ごとに TcpConnections を作成します。{AbstractServerConnectionFactory.initializeConnection(TcpConnectionSupport, Socket)を呼び出し、タスクエグゼキュータを使用して接続Runnable.run()を実行します。サーバーソケット / チャネルの I/O エラーがログに記録され、ファクトリが停止します。createServerSocket
protected ServerSocketSE createServerSocket(int port, int backlog, @Nullable InetAddressSE whichNic) throws IOExceptionSE新しいServerSocketSE を作成します。このデフォルトの実装では、デフォルトのServerSocketFactorySE を使用します。オーバーライドして他のメカニズムを使用する- パラメーター:
port- ポート。backlog- サーバーソケットのバックログ。whichNic- 特定のネットワークインターフェースにバインドする場合は InetAddress。すべてのインターフェースにバインドするように構成されている場合は、null に設定します。- 戻り値:
- サーバーソケット。
- 例外:
IOExceptionSE- IOException。
stop
public void stop()クラスからコピーされた説明:AbstractConnectionFactoryサーバーの停止。- 次で指定:
- インターフェース
Lifecycleのstop - 次で指定:
- インターフェース
ManageableLifecycleのstop - オーバーライド:
- クラス
AbstractConnectionFactoryのstop
getServerSocket
- 戻り値:
- serverSocket
getTcpSocketFactorySupport