Channel to initiate a call.
Provides the name of the operation to execute as well as Marshaller instances
used to parse and serialize request and response messages.
Can be constructed manually but will often be generated by stub code generators.
| Modifier and Type | Class and Description |
|---|---|
| public static class | |
| public static interface | MethodDescriptor.Marshaller<
type of serializable message T>A typed abstraction over message serialization and deserialization, a.k.a. marshalling and unmarshalling. |
| public static enum | MethodDescriptor.MethodType
The call type of a method. |
| public static interface | MethodDescriptor.PrototypeMarshaller<T>
A marshaller that uses a fixed instance of the type it produces. |
| public static interface | MethodDescriptor.ReflectableMarshaller<T>
A marshaller that supports retrieving it's type parameter |
| Modifier and Type | Field and Description |
|---|---|
| private final String | |
| private final boolean | |
| private final AtomicReferenceArray | |
| private final MethodDescriptor. | |
| private final MethodDescriptor. | |
| private final boolean | |
| private final boolean | |
| private final Object | |
| private final String | |
| private final MethodDescriptor. |
| Access | Constructor and Description |
|---|---|
| private | MethodDescriptor(MethodDescriptor.
|
| Modifier and Type | Method and Description |
|---|---|
| public static <RequestT, ResponseT> MethodDescriptor | create(MethodDescriptor.
the call type of this method type,the fully qualified name of this method fullMethodName, MethodDescriptor.the marshaller used to encode and decode requests requestMarshaller,the marshaller used to encode and decode responses responseMarshaller
Deprecated
use
Creates a new newBuilder().
MethodDescriptor.
|
| public static String | extractBareMethodName(String fullMethodName)
Extract the method name out of a fully qualified method name. |
| public static String | extractFullServiceName(String fullMethodName)
Extract the fully qualified service name out of a fully qualified method name. |
| public static String | generateFullMethodName(String
the fully qualified service name that is prefixed with the package name fullServiceName, String the short method name methodName)Generate the fully qualified method name. |
| public String | |
| public String | |
| pack-priv final Object | Returns: a transport specific representation of the method name.the unique ID of the transport, given by
transportOrdinal)InternalKnownTransport#ordinal.Gets the cached "raw" method name for this Method Descriptor. |
| public MethodDescriptor. | |
| public MethodDescriptor. | |
| public Object | |
| public String | |
| public MethodDescriptor. | |
| public boolean | |
| public boolean | |
| public boolean | isSampledToLocalTracing()
Returns whether RPCs for this method may be sampled into the local tracing store. |
| public static <ReqT, RespT> MethodDescriptor. | |
| public static <ReqT, RespT> MethodDescriptor. | newBuilder(MethodDescriptor.
Creates a new builder for a |
| public ReqT | Returns: a parsed instance of the message.the serialized message as a byte stream. input)Parse an incoming request message. |
| public RespT | Returns: parsed response message object.stream containing response message to parse. input)Parse a response payload from the given |
| pack-priv final void | setRawMethodName(int transportOrdinal, Object o)
Safely, but weakly, sets the raw method name for this Method Descriptor. |
| public InputStream | Returns: serialized request message.to serialize using the request requestMessage)Marshaller.Convert a request message to an |
| public InputStream | Returns: the serialized message as a byte stream.the response message to serialize. response)Serialize an outgoing response message. |
| public MethodDescriptor. | |
| public <NewReqT, NewRespT> MethodDescriptor. | toBuilder(MethodDescriptor.
Turns this descriptor into a builder, replacing the request and response marshallers. |
| public String |
| fullMethodName | back to summary |
|---|---|
| private final String fullMethodName | |
| idempotent | back to summary |
|---|---|
| private final boolean idempotent | |
| rawMethodNames | back to summary |
|---|---|
| private final AtomicReferenceArray<Object> rawMethodNames | |
| requestMarshaller | back to summary |
|---|---|
| private final MethodDescriptor. | |
| responseMarshaller | back to summary |
|---|---|
| private final MethodDescriptor. | |
| safe | back to summary |
|---|---|
| private final boolean safe | |
| sampledToLocalTracing | back to summary |
|---|---|
| private final boolean sampledToLocalTracing | |
| schemaDescriptor | back to summary |
|---|---|
| private final Object schemaDescriptor
| |
| serviceName | back to summary |
|---|---|
| private final String serviceName
| |
| type | back to summary |
|---|---|
| private final MethodDescriptor. | |
| MethodDescriptor | back to summary |
|---|---|
| private MethodDescriptor(MethodDescriptor. | |
| create | back to summary |
|---|---|
| public static <RequestT, ResponseT> MethodDescriptor Deprecated use Creates a new
| |
| extractBareMethodName | back to summary |
|---|---|
| public static String extractBareMethodName(String fullMethodName) Extract the method name out of a fully qualified method name. May return
| |
| extractFullServiceName | back to summary |
|---|---|
| public static String extractFullServiceName(String fullMethodName) Extract the fully qualified service name out of a fully qualified method name. May return
| |
| generateFullMethodName | back to summary |
|---|---|
| public static String generateFullMethodName(String fullServiceName, String methodName) Generate the fully qualified method name. This matches the name | |
| getBareMethodName | back to summary |
|---|---|
| public String getBareMethodName() A convenience method for
| |
| getFullMethodName | back to summary |
|---|---|
| public String getFullMethodName() The fully qualified name of the method.
| |
| getRawMethodName | back to summary |
|---|---|
| pack-priv final Object getRawMethodName(int transportOrdinal) Gets the cached "raw" method name for this Method Descriptor. The raw name is transport
specific, and should be set using
| |
| getRequestMarshaller | back to summary |
|---|---|
| public MethodDescriptor. Returns the marshaller for the request type. Allows introspection of the request marshaller.
| |
| getResponseMarshaller | back to summary |
|---|---|
| public MethodDescriptor. Returns the marshaller for the response type. Allows introspection of the response marshaller.
| |
| getSchemaDescriptor | back to summary |
|---|---|
| public Object getSchemaDescriptor() Returns the schema descriptor for this method. A schema descriptor is an object that is not
used by gRPC core but includes information related to the service method. The type of the
object is specific to the consumer, so both the code setting the schema descriptor and the code
calling
| |
| getServiceName | back to summary |
|---|---|
| public String getServiceName() A convenience method for
| |
| getType | back to summary |
|---|---|
| public MethodDescriptor. The call type of the method.
| |
| isIdempotent | back to summary |
|---|---|
| public boolean isIdempotent() Returns whether this method is idempotent.
| |
| isSafe | back to summary |
|---|---|
| public boolean isSafe() Returns whether this method is safe. A safe request does nothing except retrieval so it has no side effects on the server side.
| |
| isSampledToLocalTracing | back to summary |
|---|---|
| public boolean isSampledToLocalTracing() Returns whether RPCs for this method may be sampled into the local tracing store. | |
| newBuilder | back to summary |
|---|---|
| public static <ReqT, RespT> MethodDescriptor. Creates a new builder for a
| |
| newBuilder | back to summary |
|---|---|
| public static <ReqT, RespT> MethodDescriptor. Creates a new builder for a
| |
| parseRequest | back to summary |
|---|---|
| public ReqT parseRequest(InputStream input) Parse an incoming request message.
| |
| parseResponse | back to summary |
|---|---|
| public RespT parseResponse(InputStream input) Parse a response payload from the given
| |
| setRawMethodName | back to summary |
|---|---|
| pack-priv final void setRawMethodName(int transportOrdinal, Object o) Safely, but weakly, sets the raw method name for this Method Descriptor. This should only be
called by the transport. See | |
| streamRequest | back to summary |
|---|---|
| public InputStream streamRequest(ReqT requestMessage) Convert a request message to an
| |
| streamResponse | back to summary |
|---|---|
| public InputStream streamResponse(RespT response) Serialize an outgoing response message. The returned InputStream should be closed by the caller.
| |
| toBuilder | back to summary |
|---|---|
| public MethodDescriptor. Turns this descriptor into a builder.
| |
| toBuilder | back to summary |
|---|---|
| public <NewReqT, NewRespT> MethodDescriptor. Turns this descriptor into a builder, replacing the request and response marshallers.
| |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Doc from java. Returns a string representation of the object. | |
MethodDescriptor.
| Modifier and Type | Field and Description |
|---|---|
| private String | |
| private boolean | |
| private MethodDescriptor. | |
| private MethodDescriptor. | |
| private boolean | |
| private boolean | |
| private Object | |
| private MethodDescriptor. |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public MethodDescriptor | |
| public MethodDescriptor. | |
| public MethodDescriptor. | |
| public MethodDescriptor. | setRequestMarshaller(MethodDescriptor.
the marshaller to use. requestMarshallerSets the request marshaller. |
| public MethodDescriptor. | setResponseMarshaller(MethodDescriptor.
the marshaller to use. responseMarshallerSets the response marshaller. |
| public MethodDescriptor. | |
| public MethodDescriptor. | setSampledToLocalTracing(boolean value)
Sets whether RPCs for this method may be sampled into the local tracing store. |
| public MethodDescriptor. | setSchemaDescriptor(Object
an object that describes the service structure. Should be immutable. schemaDescriptor)Sets the schema descriptor for this builder. |
| public MethodDescriptor. |
| fullMethodName | back to summary |
|---|---|
| private String fullMethodName | |
| idempotent | back to summary |
|---|---|
| private boolean idempotent | |
| requestMarshaller | back to summary |
|---|---|
| private MethodDescriptor. | |
| responseMarshaller | back to summary |
|---|---|
| private MethodDescriptor. | |
| safe | back to summary |
|---|---|
| private boolean safe | |
| sampledToLocalTracing | back to summary |
|---|---|
| private boolean sampledToLocalTracing | |
| schemaDescriptor | back to summary |
|---|---|
| private Object schemaDescriptor | |
| type | back to summary |
|---|---|
| private MethodDescriptor. | |
| Builder | back to summary |
|---|---|
| private Builder() | |
| build | back to summary |
|---|---|
| public MethodDescriptor Builds the method descriptor.
| |
| setFullMethodName | back to summary |
|---|---|
| public MethodDescriptor. Sets the fully qualified (service and method) method name.
| |
| setIdempotent | back to summary |
|---|---|
| public MethodDescriptor. Sets whether the method is idempotent. If true, calling this method more than once doesn't
have additional side effects. If
| |
| setRequestMarshaller | back to summary |
|---|---|
| public MethodDescriptor. Sets the request marshaller.
| |
| setResponseMarshaller | back to summary |
|---|---|
| public MethodDescriptor. Sets the response marshaller.
| |
| setSafe | back to summary |
|---|---|
| public MethodDescriptor. Sets whether this method is safe. If true, calling this method any number of times doesn't
have side effects. If
| |
| setSampledToLocalTracing | back to summary |
|---|---|
| public MethodDescriptor. Sets whether RPCs for this method may be sampled into the local tracing store. If true, sampled traces of this method may be kept in memory by tracing libraries.
| |
| setSchemaDescriptor | back to summary |
|---|---|
| public MethodDescriptor. Sets the schema descriptor for this builder. A schema descriptor is an object that is not
used by gRPC core but includes information related to the methods. The type of the object
is specific to the consumer, so both the code calling this and the code calling
| |
| setType | back to summary |
|---|---|
| public MethodDescriptor. Sets the method type.
| |
Stub implementations will define implementations of this interface for each of the request and response messages provided by a service.
| Modifier and Type | Method and Description |
|---|---|
| public T | Returns: parsed valueof bytes for serialized value stream)Given an |
| public InputStream | Returns: serialized value as stream of bytes.to serialize. value)Given a message, produce an |
| parse | back to summary |
|---|---|
| public T parse(InputStream stream) Given an
| |
| stream | back to summary |
|---|---|
| public InputStream stream(T value) Given a message, produce an
| |
| Modifier and Type | Field and Description |
|---|---|
| public static final MethodDescriptor. | BIDI_STREAMING
Zero or more request and response messages arbitrarily interleaved in time. |
| public static final MethodDescriptor. | CLIENT_STREAMING
Zero or more request messages with one response message. |
| public static final MethodDescriptor. | SERVER_STREAMING
One request message followed by zero or more response messages. |
| public static final MethodDescriptor. | UNARY
One request message followed by one response message. |
| public static final MethodDescriptor. | UNKNOWN
Cardinality and temporal relationships are not known. |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public final boolean | clientSendsOneMessage()
Returns |
| public final boolean | serverSendsOneMessage()
Returns |
| public static MethodDescriptor. | |
| public static MethodDescriptor. |
| BIDI_STREAMING | back to summary |
|---|---|
| public static final MethodDescriptor. Zero or more request and response messages arbitrarily interleaved in time. | |
| CLIENT_STREAMING | back to summary |
|---|---|
| public static final MethodDescriptor. Zero or more request messages with one response message. | |
| SERVER_STREAMING | back to summary |
|---|---|
| public static final MethodDescriptor. One request message followed by zero or more response messages. | |
| UNARY | back to summary |
|---|---|
| public static final MethodDescriptor. One request message followed by one response message. | |
| UNKNOWN | back to summary |
|---|---|
| public static final MethodDescriptor. Cardinality and temporal relationships are not known. Implementations should not make
buffering assumptions and should largely treat the same as | |
| MethodType | back to summary |
|---|---|
| private MethodType() | |
| clientSendsOneMessage | back to summary |
|---|---|
| public final boolean clientSendsOneMessage() Returns
| |
| serverSendsOneMessage | back to summary |
|---|---|
| public final boolean serverSendsOneMessage() Returns
| |
| valueOf | back to summary |
|---|---|
| public static MethodDescriptor. | |
| values | back to summary |
|---|---|
| public static MethodDescriptor. | |
| Modifier and Type | Method and Description |
|---|---|
| public T | getMessagePrototype()
An instance of the expected message type, typically used as a schema and helper for producing other message instances. |
| getMessagePrototype | back to summary |
|---|---|
| public T getMessagePrototype() An instance of the expected message type, typically used as a schema and helper for producing
other message instances. The It is generally expected this would return the same instance each invocation, but it is not a requirement.
| |
T at runtime.
| Modifier and Type | Method and Description |
|---|---|
| public Class | Returns: non-null base class for all objects produced and consumed by this marshallerReturns the |
| getMessageClass | back to summary |
|---|---|
| public Class Returns the
| |