Package io.grpc
Class ServiceDescriptor
- java.lang.Object
-
- io.grpc.ServiceDescriptor
-
public final class ServiceDescriptor extends Object
Descriptor for a service.- Since:
- 1.0.0
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ServiceDescriptor.Builder
A builder for aServiceDescriptor
.
-
Constructor Summary
Constructors Constructor Description ServiceDescriptor(String name, MethodDescriptor<?,?>... methods)
Constructs a new Service Descriptor.ServiceDescriptor(String name, Collection<MethodDescriptor<?,?>> methods)
Constructs a new Service Descriptor.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Collection<MethodDescriptor<?,?>>
getMethods()
A collection ofMethodDescriptor
instances describing the methods exposed by the service.String
getName()
Simple name of the service.Object
getSchemaDescriptor()
Returns the schema descriptor for this service.static ServiceDescriptor.Builder
newBuilder(String name)
Creates a new builder for aServiceDescriptor
.String
toString()
-
-
-
Constructor Detail
-
ServiceDescriptor
public ServiceDescriptor(String name, MethodDescriptor<?,?>... methods)
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
public ServiceDescriptor(String name, Collection<MethodDescriptor<?,?>> methods)
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
-
-
Method Detail
-
getName
public String getName()
Simple name of the service. It is not an absolute path.- Since:
- 1.0.0
-
getMethods
public Collection<MethodDescriptor<?,?>> 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
-
newBuilder
public static ServiceDescriptor.Builder newBuilder(String name)
Creates a new builder for aServiceDescriptor
.- Since:
- 1.1.0
-
-