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.
the registration ID
AssertionError if listener is null
membership listener
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.
TypeError if memberSelector is not a function.
current members in the cluster
Optional memberSelector: MemberSelectoroptional MemberSelector instance to filter members to return. If not provided, the returned list will contain all the available cluster members.
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.
true if the registration is removed, false otherwise
AssertionError if the registration ID is null
the registration ID of MembershipListener to remove
Generated using TypeDoc
Hazelcast cluster interface. It provides access to the members in the cluster and one can register for changes in the cluster members.