Class JettyBackedGrpcServer

java.lang.Object
io.deephaven.server.jetty.JettyBackedGrpcServer
All Implemented Interfaces:
GrpcServer

@Singleton public class JettyBackedGrpcServer extends Object implements GrpcServer
  • Constructor Details

  • Method Details

    • start

      public void start() throws IOException
      Description copied from interface: GrpcServer
      Starts the server, if possible. Otherwise, throws an exception. If successful, returns.
      Specified by:
      start in interface GrpcServer
      Throws:
      IOException - if there is an error on startup
    • join

      public void join() throws InterruptedException
      Description copied from interface: GrpcServer
      Blocks as long as the server is running, unless this thread is interrupted. If stopWithTimeout has been called and the timeout has expired, this will return, and the server will be stopped.
      Specified by:
      join in interface GrpcServer
      Throws:
      InterruptedException
    • beginShutdown

      public void beginShutdown()
      Description copied from interface: GrpcServer
      Server must stop accepting new streams, but let existing streams continue for now.

      In theory the listening socket should be freed and available for another application to take it, but this is not rigorously tested.

      To complete shutdown, call stopWithTimeout() after any remaining calls have been completed to the server's satisfaction, which will terminate the remaining calls.
      Specified by:
      beginShutdown in interface GrpcServer
    • stopWithTimeout

      public void stopWithTimeout(long timeout, TimeUnit unit)
      Description copied from interface: GrpcServer
      Stops the server, using the specified timeout as a deadline. Returns immediately. Call GrpcServer.join() to block until this is completed.

      If pending calls do not matter, it is unnecessary to call beginShutdown() before this method.
      Specified by:
      stopWithTimeout in interface GrpcServer
      Parameters:
      timeout - time to allow for a graceful shutdown before giving up and halting
      unit - unit to apply to the timeout
    • getPort

      public int getPort()
      Description copied from interface: GrpcServer
      After the server is started, this will return the port it is using.
      Specified by:
      getPort in interface GrpcServer
      Returns:
      the tcp port that the server is listening on after it has started