クラス GrpcServerLifecycle

java.lang.ObjectSE
org.springframework.grpc.server.lifecycle.GrpcServerLifecycle
実装済みのインターフェース一覧:
org.springframework.context.Lifecycle, org.springframework.context.Phased, org.springframework.context.SmartLifecycle

public class GrpcServerLifecycle extends ObjectSE implements org.springframework.context.SmartLifecycle
gRPC サーバーを自動的に起動および停止するライフサイクル Bean。
作成者:
Michael ([email protected]), Dave Syer
  • コンストラクターの詳細

    • GrpcServerLifecycle

      public GrpcServerLifecycle(GrpcServerFactory factory, DurationSE shutdownGracePeriod, org.springframework.context.ApplicationEventPublisher eventPublisher)
      新しい GrpcServerLifecycle を作成します。
      パラメーター:
      factory - 使用するサーバーファクトリ。
      shutdownGracePeriod - サーバーが正常にシャットダウンするまでの待機時間。
      eventPublisher - 使用するイベント発行者。
  • 方法の詳細

    • start

      public void start()
      次で指定:
      インターフェース org.springframework.context.Lifecycle 内の start 
    • stop

      public void stop()
      次で指定:
      インターフェース org.springframework.context.Lifecycle 内の stop 
    • stop

      public void stop(RunnableSE callback)
      次で指定:
      インターフェース org.springframework.context.SmartLifecycle 内の stop 
    • isRunning

      public boolean isRunning()
      次で指定:
      インターフェース org.springframework.context.Lifecycle 内の isRunning 
    • getPhase

      public int getPhase()
      次で指定:
      インターフェース org.springframework.context.Phased 内の getPhase 
      次で指定:
      インターフェース org.springframework.context.SmartLifecycle 内の getPhase 
    • isAutoStartup

      public boolean isAutoStartup()
      次で指定:
      インターフェース org.springframework.context.SmartLifecycle 内の isAutoStartup 
    • getPort

      public int getPort()
    • getFactory

      public GrpcServerFactory getFactory()
      サーバーの作成に使用されたサーバーファクトリを取得します。
      戻り値:
      サーバーを作成するためのサーバーファクトリ
    • createAndStartGrpcServer

      protected void createAndStartGrpcServer() throws IOExceptionSE
      gRPC サーバーを作成して起動します。
      例外:
      IOExceptionSE - サーバーがポートをバインドできない場合。
    • stopAndReleaseGrpcServer

      protected void stopAndReleaseGrpcServer()
      gRPC サーバーの正常なシャットダウンを開始し、サーバーへの参照を解放します。この呼び出しは、サーバーが完全にシャットダウンされるまで待機します。