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

    Constructors
    Constructor and Description
    `AbstractLoadBalancer()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected Member[]` | `getMembers()`
    `void` | `init(Cluster cluster, ClientConfig config)` Initializes the LoadBalancer.
    `void` | `init(InitialMembershipEvent event)` Called when this listener is registered.
    `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()

    - #### 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

    - #### memberAttributeChanged

          public final 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 © 2018. All rights reserved.