public final class GrpcClients

  1. Object
  2. GrpcClients

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 types

interface GrpcClients.FactoryFactory the generated bootstrap registers per API interface.

Methods

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

Inherited methods

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.