LoadBalancerProviders. The default instance
loads providers at runtime through the Java service provider mechanism.
| Modifier and Type | Class and Description |
|---|---|
| private static class |
| Modifier and Type | Field and Description |
|---|---|
| private final LinkedHashSet | |
| private final LinkedHashMap | |
| private static final Iterable | |
| private static LoadBalancerRegistry | |
| private static final Logger |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| private synchronized void | |
| public synchronized void | deregister(LoadBalancerProvider
the provider that was added to the register via provider)register.Deregisters a provider. |
| public static synchronized LoadBalancerRegistry | getDefaultRegistry()
Returns the default registry that loads providers via the Java service loader mechanism. |
| pack-priv static List | |
| public synchronized LoadBalancerProvider | getProvider(String policy)
Returns the effective provider for the given load-balancing policy, or |
| pack-priv synchronized Map | |
| private synchronized void | |
| public synchronized void |
| allProviders | back to summary |
|---|---|
| private final LinkedHashSet<LoadBalancerProvider> allProviders | |
| effectiveProviders | back to summary |
|---|---|
| private final LinkedHashMap<String, LoadBalancerProvider> effectiveProviders | |
| HARDCODED_CLASSES | back to summary |
|---|---|
| private static final Iterable<Class<?>> HARDCODED_CLASSES | |
| instance | back to summary |
|---|---|
| private static LoadBalancerRegistry instance | |
| logger | back to summary |
|---|---|
| private static final Logger logger | |
| LoadBalancerRegistry | back to summary |
|---|---|
| public LoadBalancerRegistry() | |
| addProvider | back to summary |
|---|---|
| private synchronized void addProvider(LoadBalancerProvider provider) | |
| deregister | back to summary |
|---|---|
| public synchronized 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
| |
| getDefaultRegistry | back to summary |
|---|---|
| public static synchronized LoadBalancerRegistry getDefaultRegistry() Returns the default registry that loads providers via the Java service loader mechanism. | |
| getHardCodedClasses | back to summary |
|---|---|
pack-priv static List
| |
| getProvider | back to summary |
|---|---|
| public synchronized LoadBalancerProvider getProvider(String policy) Returns the effective provider for the given load-balancing policy, or
| |
| providers | back to summary |
|---|---|
| pack-priv synchronized Map Returns effective providers in a new map.
| |
| refreshProviderMap | back to summary |
|---|---|
| private synchronized void refreshProviderMap() | |
| register | back to summary |
|---|---|
| public synchronized void register(LoadBalancerProvider provider) Register a provider. If the provider's If more than one provider with the same | |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| public int | getPriority(LoadBalancerProvider provider)
Implements io. |
| public boolean | isAvailable(LoadBalancerProvider provider)
Implements io. |
| LoadBalancerPriorityAccessor | back to summary |
|---|---|
| pack-priv LoadBalancerPriorityAccessor() | |
| getPriority | back to summary |
|---|---|
| public int getPriority(LoadBalancerProvider provider) Implements io. Doc from io. A priority, from 0 to 10 that this provider should be used, taking the current environment into consideration. 5 should be considered the default, and then tweaked based on environment detection. A priority of 0 does not imply that the provider wouldn't work; just that it should be last in line.
| |
| isAvailable | back to summary |
|---|---|
| public boolean isAvailable(LoadBalancerProvider provider) Implements io. Doc from io. Checks this provider is available for use, taking the current environment into consideration.
If
| |