クラス 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
フィールド概要
インターフェース org.springframework.context.SmartLifecycle から継承されたフィールド
DEFAULT_PHASEコンストラクター概要
コンストラクターコンストラクター説明GrpcServerLifecycle(GrpcServerFactory factory, DurationSE shutdownGracePeriod, org.springframework.context.ApplicationEventPublisher eventPublisher) 新しい GrpcServerLifecycle を作成します。方法の概要
クラス ObjectSE から継承されたメソッド
clone, equalsSE, finalize, getClass, hashCode, notify, notifyAll, toString, wait, waitSE, waitSEインターフェース org.springframework.context.SmartLifecycle から継承されたメソッド
isPauseable
コンストラクターの詳細
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
- 次で指定:
- インターフェース
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
createAndStartGrpcServer
gRPC サーバーを作成して起動します。- 例外:
IOExceptionSE- サーバーがポートをバインドできない場合。
stopAndReleaseGrpcServer
protected void stopAndReleaseGrpcServer()gRPC サーバーの正常なシャットダウンを開始し、サーバーへの参照を解放します。この呼び出しは、サーバーが完全にシャットダウンされるまで待機します。