Package io.deephaven.server.jetty
Class JettyBackedGrpcServer
java.lang.Object
io.deephaven.server.jetty.JettyBackedGrpcServer
- All Implemented Interfaces:
GrpcServer
-
Constructor Summary
ConstructorDescriptionJettyBackedGrpcServer
(JettyConfig config, GrpcFilter filter, JsPlugins jsPlugins) -
Method Summary
Modifier and TypeMethodDescriptionvoid
Server must stop accepting new streams, but let existing streams continue for now.int
getPort()
After the server is started, this will return the port it is using.void
join()
Blocks as long as the server is running, unless this thread is interrupted.void
start()
Starts the server, if possible.void
stopWithTimeout
(long timeout, TimeUnit unit) Stops the server, using the specified timeout as a deadline.
-
Constructor Details
-
JettyBackedGrpcServer
-
-
Method Details
-
start
Description copied from interface:GrpcServer
Starts the server, if possible. Otherwise, throws an exception. If successful, returns.- Specified by:
start
in interfaceGrpcServer
- Throws:
IOException
- if there is an error on startup
-
join
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 interfaceGrpcServer
- Throws:
InterruptedException
-
beginShutdown
public void beginShutdown()Description copied from interface:GrpcServer
Server must stop accepting new streams, but let existing streams continue for now.- Specified by:
beginShutdown
in interfaceGrpcServer
-
stopWithTimeout
Description copied from interface:GrpcServer
Stops the server, using the specified timeout as a deadline. Returns immediately. CallGrpcServer.join()
to block until this is completed.- Specified by:
stopWithTimeout
in interfaceGrpcServer
- Parameters:
timeout
- time to allow for a graceful shutdown before giving up and haltingunit
- 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 interfaceGrpcServer
- Returns:
- the tcp port that the server is listening on after it has started
-