Package io.grpc
Class ServiceDescriptor
java.lang.Object
io.grpc.ServiceDescriptor
Descriptor for a service.
- Since:
- 1.0.0
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final Collection
<MethodDescriptor<?, ?>> private final String
private final Object
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprivate
ServiceDescriptor
(String name, MethodDescriptor<?, ?>... methods) Constructs a new Service Descriptor.ServiceDescriptor
(String name, Collection<MethodDescriptor<?, ?>> methods) Constructs a new Service Descriptor. -
Method Summary
Modifier and TypeMethodDescriptionCollection
<MethodDescriptor<?, ?>> A collection ofMethodDescriptor
instances describing the methods exposed by the service.getName()
Simple name of the service.Returns the schema descriptor for this service.static ServiceDescriptor.Builder
newBuilder
(String name) Creates a new builder for aServiceDescriptor
.toString()
(package private) static void
validateMethodNames
(String serviceName, Collection<MethodDescriptor<?, ?>> methods)
-
Field Details
-
name
-
methods
-
schemaDescriptor
-
-
Constructor Details
-
ServiceDescriptor
Constructs a new Service Descriptor. Users are encouraged to usenewBuilder(java.lang.String)
instead.- Parameters:
name
- The name of the servicemethods
- The methods that are part of the service- Since:
- 1.0.0
-
ServiceDescriptor
Constructs a new Service Descriptor. Users are encouraged to usenewBuilder(java.lang.String)
instead.- Parameters:
name
- The name of the servicemethods
- The methods that are part of the service- Since:
- 1.0.0
-
ServiceDescriptor
-
-
Method Details
-
getName
Simple name of the service. It is not an absolute path.- Since:
- 1.0.0
-
getMethods
A collection ofMethodDescriptor
instances describing the methods exposed by the service.- Since:
- 1.0.0
-
getSchemaDescriptor
@Nullable @ExperimentalApi("https://github.com/grpc/grpc-java/issues/2222") public Object getSchemaDescriptor()Returns the schema descriptor for this service. A schema descriptor is an object that is not used by gRPC core but includes information related to the service. The type of the object is specific to the consumer, so both the code setting the schema descriptor and the code callinggetSchemaDescriptor()
must coordinate. For example, protobuf generated code sets this value, in order to be consumed by the server reflection service. See also:io.grpc.protobuf.ProtoFileDescriptorSupplier
.- Since:
- 1.1.0
-
validateMethodNames
-
newBuilder
Creates a new builder for aServiceDescriptor
.- Since:
- 1.1.0
-
toString
-