Interface GrpcServerFactory
- All Known Implementing Classes:
AbstractGrpcServerFactory
,InProcessGrpcServerFactory
,NettyGrpcServerFactory
,ShadedNettyGrpcServerFactory
public interface GrpcServerFactory
A factory that can be used to create grpc servers.
- Since:
- 5/17/16
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addService
(GrpcServiceDefinition service) Adds the given grpc service definition to this factory.Creates a new grpc server with the stored options.Gets the IP address the created server will be bound to.int
getPort()
Gets the local port the created server will use to listen to requests.
-
Method Details
-
createServer
Server createServer()Creates a new grpc server with the stored options. The entire lifecycle management of the server should be managed by the calling class. This includes starting and stopping the server.- Returns:
- The newly created grpc server.
-
getAddress
String getAddress()Gets the IP address the created server will be bound to.- Returns:
- The IP address the server will be bound to.
-
getPort
int getPort()Gets the local port the created server will use to listen to requests.- Returns:
- Gets the local port the server will use.
-
addService
Adds the given grpc service definition to this factory. The created server will serve the services described by these definitions.Note: Adding a service does not effect servers that have already been created.
- Parameters:
service
- The service to add to the grpc server.
-