Package com.hazelcast.client.util
Class AbstractLoadBalancer
java.lang.Object
com.hazelcast.client.util.AbstractLoadBalancer
- All Implemented Interfaces:
LoadBalancer
,InitialMembershipListener
,MembershipListener
,EventListener
- Direct Known Subclasses:
RandomLB
,RoundRobinLB
public abstract class AbstractLoadBalancer
extends Object
implements LoadBalancer, InitialMembershipListener
An abstract
LoadBalancer
implementation.-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected Member[]
protected Member[]
final void
init
(Cluster cluster, ClientConfig config) Initializes the LoadBalancer.final void
init
(InitialMembershipEvent event) Called when this listener is registered.final void
memberAdded
(MembershipEvent membershipEvent) Invoked when a new member is added to the cluster.final void
memberRemoved
(MembershipEvent membershipEvent) Invoked when an existing member leaves the cluster.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.hazelcast.client.LoadBalancer
canGetNextDataMember, next, nextDataMember
-
Constructor Details
-
AbstractLoadBalancer
public AbstractLoadBalancer()
-
-
Method Details
-
init
Description copied from interface:LoadBalancer
Initializes the LoadBalancer.- Specified by:
init
in interfaceLoadBalancer
- Parameters:
cluster
- the Cluster this LoadBalancer uses to select members from.config
- the ClientConfig.
-
getMembers
-
getDataMembers
-
init
Description copied from interface:InitialMembershipListener
Called when this listener is registered.- Specified by:
init
in interfaceInitialMembershipListener
- Parameters:
event
- the MembershipInitializeEvent received when the listener is registered
-
memberAdded
Description copied from interface:MembershipListener
Invoked when a new member is added to the cluster.- Specified by:
memberAdded
in interfaceMembershipListener
- Parameters:
membershipEvent
- membership event
-
memberRemoved
Description copied from interface:MembershipListener
Invoked when an existing member leaves the cluster.- Specified by:
memberRemoved
in interfaceMembershipListener
- Parameters:
membershipEvent
- membership event when an existing member leaves the cluster
-