Options
All
  • Public
  • Public/Protected
  • All
Menu

Hazelcast cluster interface. It provides access to the members in the cluster and one can register for changes in the cluster members.

Hierarchy

  • Cluster

Index

Methods

addMembershipListener

  • addMembershipListener(listener: MembershipListener): string
  • Adds MembershipListener to listen for membership updates.

    The addMembershipListener method returns a register ID. This ID is needed to remove the MembershipListener using the removeMembershipListener method.

    If the MembershipListener implements the InitialMembershipListener interface, it will also receive the InitialMembershipEvent.

    There is no check for duplicate registrations, so if you register the listener twice, it will get events twice.

    throws

    AssertionError if listener is null

    see

    removeMembershipListener

    Parameters

    • listener: MembershipListener

      membership listener

    Returns string

    the registration ID

getMembers

  • getMembers(memberSelector?: MemberSelector): Member[]
  • List of the current members in the cluster.

    Every member in the cluster returns the 'members' in the same order. To obtain the oldest member (the master) in the cluster, you can retrieve the first item in the list.

    Parameters

    • Optional memberSelector: MemberSelector

      optional MemberSelector instance to filter members to return. If not provided, the returned list will contain all the available cluster members.

    Returns Member[]

    current members in the cluster

removeMembershipListener

  • removeMembershipListener(listenerId: string): boolean
  • Removes the specified MembershipListener.

    If the same MembershipListener is registered multiple times, it needs to be removed multiple times.

    This method can safely be called multiple times for the same registration ID; subsequent calls are ignored.

    throws

    AssertionError if the registration ID is null

    see

    addMembershipListener

    Parameters

    • listenerId: string

      the registration ID of MembershipListener to remove

    Returns boolean

    true if the registration is removed, false otherwise

Generated using TypeDoc