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 voidblockUntilShutdown()Await termination on the main thread since the grpc library uses daemon threads.voidstart()Start serving requests.voidstop()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 IOExceptionStart serving requests.- Throws:
IOException- IO exception.
-
stop
public void stop()
Stop serving requests and shutdown resources.
-
blockUntilShutdown
public void blockUntilShutdown() throws InterruptedExceptionAwait termination on the main thread since the grpc library uses daemon threads.- Throws:
InterruptedException- Interrupted Exception.
-
-