Class AbstractRoundRobinLoadBalancer
- java.lang.Object
-
- io.micronaut.http.client.loadbalance.AbstractRoundRobinLoadBalancer
-
- All Implemented Interfaces:
LoadBalancer
- Direct Known Subclasses:
DiscoveryClientRoundRobinLoadBalancer,ServiceInstanceListRoundRobinLoadBalancer
public abstract class AbstractRoundRobinLoadBalancer extends java.lang.Object implements LoadBalancer
- Since:
- 1.0
-
-
Field Summary
Fields Modifier and Type Field Description protected java.util.concurrent.atomic.AtomicIntegerindex
-
Constructor Summary
Constructors Constructor Description AbstractRoundRobinLoadBalancer()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected io.micronaut.discovery.ServiceInstancegetNextAvailable(java.util.List<io.micronaut.discovery.ServiceInstance> serviceInstances)abstract java.lang.StringgetServiceID()-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface io.micronaut.http.client.LoadBalancer
getContextPath, select, select
-
-
-
-
Method Detail
-
getServiceID
public abstract java.lang.String getServiceID()
- Returns:
- The service ID
-
getNextAvailable
protected io.micronaut.discovery.ServiceInstance getNextAvailable(java.util.List<io.micronaut.discovery.ServiceInstance> serviceInstances)
- Parameters:
serviceInstances- A list of service instances- Returns:
- The next available instance or a
NoAvailableServiceExceptionif none
-
-