Interface Service
- All Superinterfaces:
ServiceInvoker
- All Known Subinterfaces:
GrpcEventBusBridge, GrpcIoServiceBridge
- All Known Implementing Classes:
EventBusBridgeGrpcService, ReflectionService
A gRPC service.
- gives access to both the name and the service descriptor, which contains detailed information about the service's methods, input and output types, and other metadata defined in the protobuf service definition
- handle service calls
-
Field Summary
Fields inherited from interface ServiceInvoker
DEFAULT_INSTANCE -
Method Summary
Modifier and TypeMethodDescriptionclose()Close the service.com.google.protobuf.Descriptors.ServiceDescriptorGet the service descriptor that contains detailed information about the service.default booleanCheck if a method exists in this service.default Optional<com.google.protobuf.Descriptors.MethodDescriptor> methodDescriptor(String methodName) Get a method descriptor by service.default List<com.google.protobuf.Descriptors.MethodDescriptor> Get a list of all method descriptors for this service.default List<ServiceMethod<?, ?>> methods()Get the list of all methods implemented by this service.name()Get the name of the service.default StringpathOfMethod(String methodName) Get the full path for a method, which can be used for making gRPC calls.static ServiceBuilderservice(ServiceName serviceName, com.google.protobuf.Descriptors.ServiceDescriptor descriptor) Creates a new Service instance with the specified service name and descriptor.Methods inherited from interface ServiceInvoker
invoker
-
Method Details
-
service
static ServiceBuilder service(ServiceName serviceName, com.google.protobuf.Descriptors.ServiceDescriptor descriptor) Creates a new Service instance with the specified service name and descriptor.- Parameters:
serviceName- the name of the gRPC servicedescriptor- the service descriptor- Returns:
- a new Service instance
-
name
-
descriptor
com.google.protobuf.Descriptors.ServiceDescriptor descriptor()Get the service descriptor that contains detailed information about the service.- Returns:
- the service descriptor
-
methods
Get the list of all methods implemented by this service.- Returns:
- the list of service methods
-
close
-
methodDescriptors
Get a list of all method descriptors for this service.- Returns:
- list of method descriptors
-
methodDescriptor
-
hasMethod
Check if a method exists in this service.- Parameters:
methodName- the name of the method to check- Returns:
- true if the method exists, false otherwise
-
pathOfMethod
Get the full path for a method, which can be used for making gRPC calls. The format is "/package.ServiceName/MethodName".- Parameters:
methodName- the name of the method- Returns:
- the full path for the method
- Throws:
IllegalArgumentException- if the method does not exist
-