@Retention(CLASS)
@Target(METHOD)
public @interface RpcMethod
RpcMethod
contains a limited subset of information about the RPC to assist
Java Annotation Processors.
This annotation is used by the gRPC stub compiler to annotate MethodDescriptor
getters. Users should not annotate their own classes with this annotation. Not all stubs may
have this annotation, so consumers should not assume that it is present.
Modifier and Type | Required Element | Description |
---|---|---|
java.lang.String |
fullMethodName |
The fully qualified method name.
|
io.grpc.MethodDescriptor.MethodType |
methodType |
The call type of the method.
|
java.lang.Class<?> |
requestType |
The request type of the method.
|
java.lang.Class<?> |
responseType |
The response type of the method.
|
java.lang.String fullMethodName
MethodDescriptor.generateFullMethodName(String, String)
.java.lang.Class<?> requestType
Class.isAssignableFrom(Class)
the request type ReqT
of the
MethodDescriptor
. Additionally, if the request MethodDescriptor.Marshaller
is a MethodDescriptor.ReflectableMarshaller
, the request type should be assignable
from MethodDescriptor.ReflectableMarshaller#getMessageClass()
.java.lang.Class<?> responseType
Class.isAssignableFrom(Class)
the response type RespT
of the
MethodDescriptor
. Additionally, if the response MethodDescriptor.Marshaller
is a MethodDescriptor.ReflectableMarshaller
, the response type should be assignable
from MethodDescriptor.ReflectableMarshaller#getMessageClass()
.