public class GrpcFnServer<ServiceT extends FnService>
extends java.lang.Object
implements java.lang.AutoCloseable
gRPC Server
which manages a single FnService
. The lifetime of the
service is bound to the GrpcFnServer
.Modifier and Type | Method and Description |
---|---|
static <ServiceT extends FnService> |
allocatePortAndCreateFor(ServiceT service,
ServerFactory factory)
Create a
GrpcFnServer for the provided FnService running on an arbitrary
port. |
void |
close() |
static <ServiceT extends FnService> |
create(ServiceT service,
org.apache.beam.model.pipeline.v1.Endpoints.ApiServiceDescriptor endpoint,
ServerFactory factory)
Create a
GrpcFnServer for the provided FnService which will run at the
endpoint specified in the Endpoints.ApiServiceDescriptor . |
org.apache.beam.model.pipeline.v1.Endpoints.ApiServiceDescriptor |
getApiServiceDescriptor()
Get an
Endpoints.ApiServiceDescriptor describing the endpoint this GrpcFnServer is bound
to. |
io.grpc.Server |
getServer()
Get the underlying
Server contained by this GrpcFnServer . |
ServiceT |
getService()
Get the service exposed by this
GrpcFnServer . |
public static <ServiceT extends FnService> GrpcFnServer<ServiceT> allocatePortAndCreateFor(ServiceT service, ServerFactory factory) throws java.io.IOException
GrpcFnServer
for the provided FnService
running on an arbitrary
port.java.io.IOException
public static <ServiceT extends FnService> GrpcFnServer<ServiceT> create(ServiceT service, org.apache.beam.model.pipeline.v1.Endpoints.ApiServiceDescriptor endpoint, ServerFactory factory) throws java.io.IOException
GrpcFnServer
for the provided FnService
which will run at the
endpoint specified in the Endpoints.ApiServiceDescriptor
.java.io.IOException
public org.apache.beam.model.pipeline.v1.Endpoints.ApiServiceDescriptor getApiServiceDescriptor()
Endpoints.ApiServiceDescriptor
describing the endpoint this GrpcFnServer
is bound
to.public ServiceT getService()
GrpcFnServer
.public io.grpc.Server getServer()
Server
contained by this GrpcFnServer
.public void close() throws java.lang.Exception
close
in interface java.lang.AutoCloseable
java.lang.Exception