Class DataServiceServer
- java.lang.Object
-
- es.bsc.dataclay.communication.grpc.services.dataservice.DataServiceServer
-
public final class DataServiceServer extends Object
A sample gRPC server that serve the DataServiceServer service.
-
-
Constructor Summary
Constructors Constructor Description DataServiceServer(int port, DataService ds)
Create a DataServiceServer server listening onport
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
blockUntilShutdown()
Await termination on the main thread since the grpc library uses daemon threads.void
start()
Start serving requests.void
stop()
Stop serving requests and shutdown resources.
-
-
-
Constructor Detail
-
DataServiceServer
public DataServiceServer(int port, DataService ds)
Create a DataServiceServer server listening onport
.- Parameters:
port
- Portds
- DS implementation
-
-
Method Detail
-
start
public void start() throws IOException
Start serving requests.- Throws:
IOException
- IO exception.
-
stop
public void stop()
Stop serving requests and shutdown resources.
-
blockUntilShutdown
public void blockUntilShutdown() throws InterruptedException
Await termination on the main thread since the grpc library uses daemon threads.- Throws:
InterruptedException
- Interrupted Exception.
-
-