com.hazelcast.client.util
Class AbstractLoadBalancer

java.lang.Object
  extended by com.hazelcast.client.util.AbstractLoadBalancer
All Implemented Interfaces:
LoadBalancer, MembershipListener, EventListener
Direct Known Subclasses:
RandomLB, RoundRobinLB

public abstract class AbstractLoadBalancer
extends Object
implements LoadBalancer, MembershipListener

An abstract LoadBalancer implementation.


Constructor Summary
AbstractLoadBalancer()
           
 
Method Summary
protected  Member[] getMembers()
           
 void init(Cluster cluster, ClientConfig config)
          Initializes the LoadBalancer.
 void memberAdded(MembershipEvent membershipEvent)
          Invoked when a new member is added to the cluster.
 void memberAttributeChanged(MemberAttributeEvent memberAttributeEvent)
          Invoked when an attribute of a member was changed.
 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
next
 

Constructor Detail

AbstractLoadBalancer

public AbstractLoadBalancer()
Method Detail

init

public final void init(Cluster cluster,
                       ClientConfig config)
Description copied from interface: LoadBalancer
Initializes the LoadBalancer.

Specified by:
init in interface LoadBalancer
Parameters:
cluster - the Cluster this LoadBalancer uses to select members from.
config - the ClientConfig.

getMembers

protected Member[] getMembers()

memberAdded

public final void memberAdded(MembershipEvent membershipEvent)
Description copied from interface: MembershipListener
Invoked when a new member is added to the cluster.

Specified by:
memberAdded in interface MembershipListener
Parameters:
membershipEvent - membership event

memberRemoved

public final void memberRemoved(MembershipEvent membershipEvent)
Description copied from interface: MembershipListener
Invoked when an existing member leaves the cluster.

Specified by:
memberRemoved in interface MembershipListener
Parameters:
membershipEvent - membership event when an existing member leaves the cluster

memberAttributeChanged

public void memberAttributeChanged(MemberAttributeEvent memberAttributeEvent)
Description copied from interface: MembershipListener
Invoked when an attribute of a member was changed.

Specified by:
memberAttributeChanged in interface MembershipListener
Parameters:
memberAttributeEvent - member attribute event when an attribute of a member was changed


Copyright © 2015 Hazelcast, Inc.. All Rights Reserved.