Class GRpcServerManager

java.lang.Object
com.netflix.genie.web.agent.apis.rpc.servers.GRpcServerManager
All Implemented Interfaces:
AutoCloseable

public class GRpcServerManager extends Object implements AutoCloseable
A wrapper around a Server instance which implements AutoCloseable to control startup and shutdown along with the application.
Since:
4.0.0
  • Constructor Details

    • GRpcServerManager

      public GRpcServerManager(io.grpc.Server server) throws IllegalStateException
      Constructor.
      Parameters:
      server - The Server instance to manage
      Throws:
      IllegalStateException - If the server can't be started
  • Method Details

    • close

      public void close()
      Specified by:
      close in interface AutoCloseable
    • getServerPort

      public int getServerPort()
      Get the port the gRPC Server is listening on.
      Returns:
      The port or -1 if the server isn't currently listening on any port.