クラス AbstractServerConnectionFactory

実装されているすべてのインターフェース:
RunnableSEAwareBeanFactoryAwareBeanNameAwareInitializingBeanApplicationContextAwareApplicationEventPublisherAwareLifecycleComponentSourceAwareExpressionCapableOrderlyShutdownCapableConnectionFactoryTcpServerConnectionFactoryNamedComponentManageableLifecycleSchedulingAwareRunnable
既知の直属サブクラス
TcpNetServerConnectionFactoryTcpNioServerConnectionFactory

public abstract class AbstractServerConnectionFactory extends AbstractConnectionFactory implements TcpServerConnectionFactory, SchedulingAwareRunnable, OrderlyShutdownCapable
すべてのサーバー接続ファクトリの基本クラス。サーバー接続ファクトリは、ポートで受信接続をリッスンし、新しい接続ごとに新しい TcpConnection オブジェクトを作成します。
導入:
2.0
作成者:
Gary Russell, Artem Bilan, Christian Tzolov
  • コンストラクターの詳細

    • AbstractServerConnectionFactory

      public AbstractServerConnectionFactory(int port)
      ファクトリがリッスンするポート。
      パラメーター:
      port - ポート。
  • メソッドの詳細

    • isLongLived

      public boolean isLongLived()
      次で指定:
      インターフェース SchedulingAwareRunnableisLongLived 
    • getServerSocketAddress

      @Nullable public SocketAddressSE getServerSocketAddress()
      インターフェースからコピーされた説明: TcpServerConnectionFactory
      基になる ServerSocket がバインドされている SocketAddressSE を返します。
      次で指定:
      インターフェース TcpServerConnectionFactorygetServerSocketAddress 
      戻り値:
      ソケットアドレス。
    • start

      public void start()
      次で指定:
      インターフェース Lifecyclestart 
      次で指定:
      インターフェース ManageableLifecyclestart 
      オーバーライド:
      クラス AbstractConnectionFactorystart 
    • getConnection

      public TcpConnection getConnection()
      ファクトリで複数の接続を管理しており、この方法では識別できないため、サポートされていません。
      次で指定:
      インターフェース ConnectionFactorygetConnection 
    • setListening

      protected void setListening(boolean listening)
      パラメーター:
      listening - セットを聞く
    • isListening

      public boolean isListening()
      戻り値:
      サーバーがポートでリッスンしている場合は true。
    • isShuttingDown

      protected boolean isShuttingDown()
    • initializeConnection

      protected void initializeConnection(TcpConnectionSupport connection, SocketSE socket)
      (デ)シリアライザー、マッパーなどの属性を新しい接続に転送します。シングルユースソケットの場合、DoS 攻撃を防ぐために、ソケットタイムアウト(デフォルトは 10 秒)を適用します。
      パラメーター:
      connection - 新しい接続。
      socket - 新しいソケット。
    • postProcessServerSocket

      protected void postProcessServerSocket(ServerSocketSE serverSocket)
    • getLocalAddress

      @Nullable public StringSE getLocalAddress()
      戻り値:
      localAddress
    • setLocalAddress

      public void setLocalAddress(StringSE localAddress)
      マルチホームシステムで使用され、サーバーがすべてのネットワークアダプターではなく特定のネットワークアドレスでリッスンするように強制します。
      パラメーター:
      localAddress - 必要なアダプターの IP アドレス。
    • getBacklog

      public int getBacklog()
      サーバー接続バックログ内のソケットの数。
      戻り値:
      バックログ。
    • setBacklog

      public void setBacklog(int backlog)
      接続バックログ内のソケットの数。デフォルト 5; 高い接続率が予想される場合は増加します。
      パラメーター:
      backlog - 設定するバックログ。
    • beforeShutdown

      public int beforeShutdown()
      インターフェースからコピーされた説明: OrderlyShutdownCapable
      シャットダウンが始まる前に呼び出されます。実装は、新しいメッセージの受け入れを停止する必要があります。オプションで、処理中のアクティブなメッセージの数を返すことができます。
      次で指定:
      インターフェース OrderlyShutdownCapablebeforeShutdown 
      戻り値:
      使用可能な場合、アクティブなメッセージの数。
    • afterShutdown

      public int afterShutdown()
      インターフェースからコピーされた説明: OrderlyShutdownCapable
      スケジューラー、エグゼキューターなどの通常のシャットダウンの後、シャットダウン遅延が経過した後、残りのアクティブなスケジューラー / エグゼキュータースレッドの強制シャットダウンの前に呼び出されます。オプションで、まだ処理中のアクティブなメッセージの数を返すことができます。
      次で指定:
      インターフェース OrderlyShutdownCapableafterShutdown 
      戻り値:
      使用可能な場合、アクティブなメッセージの数。
    • publishServerExceptionEvent

      protected void publishServerExceptionEvent(ExceptionSE ex)
    • publishServerListeningEvent

      protected void publishServerListeningEvent(int port)