Package io.grpc

Class LoadBalancerRegistry

    • Constructor Detail

      • LoadBalancerRegistry

        public LoadBalancerRegistry()
    • Method Detail

      • register

        public void register​(LoadBalancerProvider provider)
        Register a provider.

        If the provider's isAvailable() returns false, this method will throw IllegalArgumentException.

        If more than one provider with the same policy name are registered, the one with the highest priority will be effective. If there are more than one name-sake providers rank the highest priority, the one registered first will be effective.

      • deregister

        public void deregister​(LoadBalancerProvider provider)
        Deregisters a provider. No-op if the provider is not in the registry. If there are more than one providers with the same policy name as the deregistered one in the registry, one of them will become the effective provider for that policy, per the rule documented in register(io.grpc.LoadBalancerProvider).
        Parameters:
        provider - the provider that was added to the register via register(io.grpc.LoadBalancerProvider).
      • getDefaultRegistry

        public static LoadBalancerRegistry getDefaultRegistry()
        Returns the default registry that loads providers via the Java service loader mechanism.