Package com.tangosol.net
Interface ServiceLoadBalancer<S extends Service,T extends ServiceLoad> 
- All Superinterfaces:
- Comparator<T>
- All Known Subinterfaces:
- ProxyServiceLoadBalancer
- All Known Implementing Classes:
- AbstractServiceLoadBalancer,- DefaultProxyServiceLoadBalancer,- SimpleServiceLoadBalancer
A ServiceLoadBalancer is a pluggable strategy for controlling the
 client load across individual members of a clustered Service.
- Since:
- Coherence 3.7
- Author:
- jh 2010.12.07
- 
Method SummaryModifier and TypeMethodDescriptiondefault intCompare to ServerLoad objects.getMemberList(Member client) Called by the Service when a new client connects to obtain an ordered list of Members to which the new client should be redirected.voidCalled by the Service exactly once on this object as part of its initialization.voidUpdate the load balancing strategy in response to a change in a Service utilization.Methods inherited from interface java.util.Comparatorequals, reversed, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
- 
Method Details- 
initCalled by the Service exactly once on this object as part of its initialization.- Parameters:
- service- the containing Service
 
- 
updateUpdate the load balancing strategy in response to a change in a Service utilization.- Parameters:
- member- the Member for which the utilization changed
- load- the updated ServiceLoad; if null, the utilization for the specified Member is unknown (e.g. when the Service on the specified Member leaves the cluster)
 
- 
getMemberListCalled by the Service when a new client connects to obtain an ordered list of Members to which the new client should be redirected. If the returned list is null, empty, or contains a single Member that is the "local" Member, the client will remain connected to the calling Service.- Parameters:
- client- the Member object that represents the remote client
- Returns:
- the ordered list of Member objects to which the client should be redirected
 
- 
compareCompare to ServerLoad objects.- Specified by:
- comparein interface- Comparator<S extends Service>
- Parameters:
- load1- the first ServiceLoad
- load2- the second ServiceLoad
- Returns:
- a negative integer, zero, or a positive integer indicating if load1 is less then, equal, or greater then load2
 
 
-