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.

  • Method Details

    • register

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

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