Annotation Type GrpcClient
Marks an interface as a gRPC client that the build-time annotation
processor wires up to a generated implementation: gRPC-Web in an
application, native gRPC over HTTP/2 in a backend. Each
abstract method must carry an Rpc annotation naming the gRPC
method, and at most one non-callback parameter -- the request
message, a @ProtoMessage-annotated POJO. In an application the
final parameter is an OnComplete<Response<ResponseMessage>>
callback; in a backend methods are blocking and may stream (see the
backend's com.codename1.backend.grpc package).
The fully qualified service path defaults to
<value()>/<methodName> -- for example
helloworld.Greeter/SayHello. Override per-method via
Rpc.service() when the service path needs to differ from the
interface-level default.
The processor emits a <SimpleName>Impl class in generated-sources
and registers it with the runtime's client registry
(com.codename1.io.grpc.GrpcClients in an application) so the
interface's static T of(String baseUrl) factory can return an
instance without the project source referencing the impl directly.
Mirrors com.codename1.annotations.rest.RestClient.
-
Optional Element Summary
Optional Elements
-
Element Details
-
value
String valueFully qualified gRPC service path (without leading slash), e.g.helloworld.Greeter. Combined with each method'sRpc.value()to form the request URI segment/<service>/<method>appended to thebaseUrl. Empty string means each method must specify the full service path viaRpc.service().- Default:
""
-