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 Details

    • AbstractLoadBalancer

      public AbstractLoadBalancer()
  • Method Details

    • 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()
    • getDataMembers

      protected Member[] getDataMembers()
    • init

      public final void init(InitialMembershipEvent event)
      Description copied from interface: InitialMembershipListener
      Called when this listener is registered.
      Specified by:
      init in interface InitialMembershipListener
      Parameters:
      event - the MembershipInitializeEvent received when the listener is registered
    • 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