Class GrpcClients

java.lang.Object
com.codename1.io.grpc.GrpcClients

public final class GrpcClients extends Object

Runtime registry that wires @GrpcClient-annotated interfaces to the build-time-generated implementations. The generated cn1app.GrpcClientBootstrap calls register(Class, Factory) for every gRPC interface in the project; user code reaches them via the static of(String baseUrl) factory that cn1:generate-grpc puts on each interface, and that factory in turn calls create(Class, String) here.

Mirrors RestClients.

  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static interface 
    Factory the generated bootstrap registers per API interface.
  • Method Summary

    Modifier and Type
    Method
    Description
    static <T> T
    create(java.lang.Class<T> apiType, String baseUrl)
    Returns a freshly-built client for the requested API.
    static <T> void
    register(java.lang.Class<T> apiType, GrpcClients.Factory<T> factory)
    Registers a factory for a @GrpcClient-annotated interface.

    Methods inherited from class Object

    clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • register

      public static <T> void register(java.lang.Class<T> apiType, GrpcClients.Factory<T> factory)
      Registers a factory for a @GrpcClient-annotated interface.
    • create

      public static <T> T create(java.lang.Class<T> apiType, String baseUrl)
      Returns a freshly-built client for the requested API.