クラス AbstractConnectionFactory

java.lang.ObjectSE
org.springframework.integration.context.IntegrationObjectSupport
org.springframework.integration.ip.tcp.connection.AbstractConnectionFactory
実装されているすべてのインターフェース:
AwareBeanFactoryAwareBeanNameAwareInitializingBeanApplicationContextAwareApplicationEventPublisherAwareLifecycleComponentSourceAwareExpressionCapableConnectionFactoryNamedComponentManageableLifecycle
既知の直属サブクラス
AbstractClientConnectionFactoryAbstractServerConnectionFactory

public abstract class AbstractConnectionFactory extends IntegrationObjectSupport implements ConnectionFactory, ApplicationEventPublisherAware
すべての接続ファクトリの基本クラス。
導入:
2.0
作成者:
Gary Russell, Artem Bilan, Christian Tzolov, Ngoc Nhan
  • フィールドの詳細

  • コンストラクターの詳細

    • AbstractConnectionFactory

      public AbstractConnectionFactory(int port)
    • AbstractConnectionFactory

      public AbstractConnectionFactory(StringSE host, int port)
  • メソッドの詳細

    • setApplicationEventPublisher

      public void setApplicationEventPublisher(ApplicationEventPublisher applicationEventPublisher)
      次で指定:
      インターフェース ApplicationEventPublisherAwaresetApplicationEventPublisher 
    • getApplicationEventPublisher

      @Nullable public ApplicationEventPublisher getApplicationEventPublisher()
    • setSocketAttributes

      protected void setSocketAttributes(SocketSE socket) throws SocketExceptionSE
      ソケットのソケット属性を設定します。
      パラメーター:
      socket - ソケット。
      例外:
      SocketExceptionSE - SocketException。
    • getSoTimeout

      public int getSoTimeout()
      戻り値:
      soTimeout
    • setSoTimeout

      public void setSoTimeout(int soTimeout)
      パラメーター:
      soTimeout - 設定する soTimeout(ミリ秒単位)
    • getSoReceiveBufferSize

      public int getSoReceiveBufferSize()
      戻り値:
      soReceiveBufferSize
    • setSoReceiveBufferSize

      public void setSoReceiveBufferSize(int soReceiveBufferSize)
      パラメーター:
      soReceiveBufferSize - 設定する soReceiveBufferSize
    • getSoSendBufferSize

      public int getSoSendBufferSize()
      戻り値:
      soSendBufferSize
    • setSoSendBufferSize

      public void setSoSendBufferSize(int soSendBufferSize)
      パラメーター:
      soSendBufferSize - 設定する soSendBufferSize
    • isSoTcpNoDelay

      public boolean isSoTcpNoDelay()
      戻り値:
      soTcpNoDelay
    • setSoTcpNoDelay

      public void setSoTcpNoDelay(boolean soTcpNoDelay)
      パラメーター:
      soTcpNoDelay - 設定する soTcpNoDelay
    • getSoLinger

      public int getSoLinger()
      戻り値:
      soLinger
    • setSoLinger

      public void setSoLinger(int soLinger)
      パラメーター:
      soLinger - 設定する soLinger
    • isSoKeepAlive

      public boolean isSoKeepAlive()
      戻り値:
      soKeepAlive
    • setSoKeepAlive

      public void setSoKeepAlive(boolean soKeepAlive)
      パラメーター:
      soKeepAlive - 設定する soKeepAlive
    • getSoTrafficClass

      public int getSoTrafficClass()
      戻り値:
      soTrafficClass
    • setSoTrafficClass

      public void setSoTrafficClass(int soTrafficClass)
      パラメーター:
      soTrafficClass - 設定する soTrafficClass
    • setHost

      public void setHost(StringSE host)
      ホストを設定します。ファクトリを停止する必要があります。
      パラメーター:
      host - ザホスト。
      導入:
      5.0
    • getHost

      public StringSE getHost()
      戻り値:
      ザホスト
    • setPort

      public void setPort(int port)
      ポートを設定します。ファクトリを停止する必要があります。
      パラメーター:
      port - ポート。
      導入:
      5.0
    • getPort

      public int getPort()
      戻り値:
    • getListener

      @Nullable public TcpListener getListener()
      戻り値:
      リスナー
    • getSender

      @Nullable public TcpSender getSender()
      戻り値:
      存在する場合、最初の送信者。
    • getSenders

      public ListSE<TcpSender> getSenders()
      送信者のリストを返します。
      戻り値:
      送信者。
      導入:
      5.4
    • getSerializer

      public Serializer<?> getSerializer()
      戻り値:
      シリアライザー
    • getDeserializer

      public Deserializer<?> getDeserializer()
      戻り値:
      デシリアライザー
    • getMapper

      public TcpMessageMapper getMapper()
      戻り値:
      マッパー
    • registerListener

      public void registerListener(TcpListener listenerToRegister)
      ペイロードが入力データから変換された後、メッセージを受信するために TcpListener を登録します。
      パラメーター:
      listenerToRegister - TcpListener。
    • registerSender

      public void registerSender(TcpSender senderToRegister)
      TcpSender を登録します。サーバーソケットの場合、接続情報を提供するために使用されるため、送信者は受信メッセージに返信するために使用できます。
      パラメーター:
      senderToRegister - 送り主
    • unregisterSender

      public boolean unregisterSender(TcpSender sender)
      TcpSender の登録を解除します。
      パラメーター:
      sender - 送り主。
      戻り値:
      送信者が登録されている場合は true。
    • setTaskExecutor

      public void setTaskExecutor(ExecutorSE taskExecutor)
      パラメーター:
      taskExecutor - 設定する taskExecutor
    • setDeserializer

      public void setDeserializer(Deserializer<?> deserializer)
      パラメーター:
      deserializer - 設定するデシリアライザー
    • setSerializer

      public void setSerializer(Serializer<?> serializer)
      パラメーター:
      serializer - 設定するシリアライザー
    • setMapper

      public void setMapper(TcpMessageMapper mapper)
      パラメーター:
      mapper - 設定するマッパー。デフォルトは TcpMessageMapper です
    • isSingleUse

      public boolean isSingleUse()
      戻り値:
      singleUse
    • setSingleUse

      public void setSingleUse(boolean singleUse)
      true の場合、このファクトリによって作成されたソケットが 1 回使用されます。
      パラメーター:
      singleUse - 設定する singleUse。
    • setLeaveOpen

      public void setLeaveOpen(boolean leaveOpen)
      true の場合、このファクトリによって作成されたソケットが再利用されます。setSingleUse(boolean) の逆。
      パラメーター:
      leaveOpen - 設定する keepOpen。
      導入:
      5.0
    • setInterceptorFactoryChain

      public void setInterceptorFactoryChain(TcpConnectionInterceptorFactoryChain interceptorFactoryChain)
    • setLookupHost

      public void setLookupHost(boolean lookupHost)
      true の場合、リモート IP アドレスで DNS 逆引き参照が行われます。デフォルト false: すべての環境 (例: Docker コンテナー) が信頼できる DNS 解決を実行するわけではありません。
      パラメーター:
      lookupHost - 設定する lookupHost
    • isLookupHost

      public boolean isLookupHost()
      戻り値:
      lookupHost
    • setNioHarvestInterval

      public void setNioHarvestInterval(int nioHarvestInterval)
      soTimeout が 0 の場合、閉じられた NIO 接続をクリーンアップする頻度。クリーンアッププロセスはタイムアウト処理の一部として実行されるため、soTimeout > 0 の場合は無視されます。デフォルトは 2000 ミリ秒です。
      パラメーター:
      nioHarvestInterval - ミリ秒単位の間隔。
    • setSslHandshakeTimeout

      public void setSslHandshakeTimeout(int sslHandshakeTimeout)
      SSL ハンドシェイクデータを待機するときに使用されるハンドシェイクタイムアウトを設定します。NIO を使用する場合、SSL 接続にのみ適用されます。
      パラメーター:
      sslHandshakeTimeout - タイムアウト。
      導入:
      4.3.6
    • getSslHandshakeTimeout

      @Nullable protected IntegerSE getSslHandshakeTimeout()
      戻り値:
      ハンドシェイクのタイムアウト。
      導入:
      4.3.6
      関連事項:
    • getDelayedReads

      protected BlockingQueueSE<org.springframework.integration.ip.tcp.connection.AbstractConnectionFactory.PendingIO> getDelayedReads()
    • getReadDelay

      protected long getReadDelay()
    • setReadDelay

      public void setReadDelay(long readDelay)
      スレッドが不十分なために前回の試行が失敗した後、読み取りを再試行するまでの遅延(ミリ秒単位)。デフォルトは 100。
      パラメーター:
      readDelay - readDelay を設定します。
    • getLifecycleMonitor

      protected ObjectSE getLifecycleMonitor()
    • onInit

      protected void onInit()
      クラスからコピーされた説明: IntegrationObjectSupport
      サブクラスは、初期化ロジック用にこれを実装できます。
      オーバーライド:
      クラス IntegrationObjectSupportonInit 
    • start

      public void start()
      次で指定:
      インターフェース Lifecyclestart 
      次で指定:
      インターフェース ManageableLifecyclestart 
    • getTaskExecutor

      protected ExecutorSE getTaskExecutor()
      taskExecutor を作成します (提供されていない場合)。
      戻り値:
      エグゼキューター。
    • stop

      public void stop()
      サーバーの停止。
      次で指定:
      インターフェース Lifecyclestop 
      次で指定:
      インターフェース ManageableLifecyclestop 
    • wrapConnection

      protected TcpConnectionSupport wrapConnection(TcpConnectionSupport connectionArg)
    • processNioSelections

      protected void processNioSelections(int selectionCount, SelectorSE selector, @Nullable ServerSocketChannelSE server, MapSE<SocketChannelSE, TcpNioConnection> connectionMap)
      期限切れの接続をタイムアウトし、selectionCount > 0 の場合は、選択された鍵を処理します。connections フィールドおよび connections パラメーターから閉じた接続を削除します。
      パラメーター:
      selectionCount - IO イベントの数。0 の場合、おそらくクローズによって起こされました。
      selector - セレクタ。
      server - サーバーソケットチャネル。
      connectionMap - 接続のマップ。
    • delayRead

      protected void delayRead(SelectorSE selector, long now, SelectionKeySE key)
    • doAccept

      protected void doAccept(SelectorSE selector, ServerSocketChannelSE server, long now)
      パラメーター:
      selector - セレクタ。
      server - サーバーソケットチャネル。
      now - 現在の時刻。
    • addConnection

      protected void addConnection(TcpConnectionSupport connection)
    • harvestClosedConnections

      protected void harvestClosedConnections()
      閉じられた接続を削除して this.connections をクリーンアップします。
    • isRunning

      public boolean isRunning()
      次で指定:
      インターフェース LifecycleisRunning 
      次で指定:
      インターフェース ManageableLifecycleisRunning 
    • isActive

      protected boolean isActive()
      戻り値:
      アクティブ
    • setActive

      protected void setActive(boolean active)
      パラメーター:
      active - 設定するアクティブ
    • checkActive

      protected void checkActive()
    • getTcpSocketSupport

      protected TcpSocketSupport getTcpSocketSupport()
    • setTcpSocketSupport

      public void setTcpSocketSupport(TcpSocketSupport tcpSocketSupport)
    • getOpenConnectionIds

      public ListSE<StringSE> getOpenConnectionIds()
      (現在)開いている TcpConnection 接続 ID のリストを返します。たとえば、開いているすべての接続へのブロードキャスト操作を許可します。
      戻り値:
      接続 ID のリスト。
    • closeConnection

      public boolean closeConnection(StringSE connectionId)
      指定された接続 ID の接続を閉じます。
      パラメーター:
      connectionId - 接続 ID。
      戻り値:
      接続が閉じられた場合は true。
    • toString

      public StringSE toString()
      オーバーライド:
      クラス IntegrationObjectSupporttoString