Class MembershipEvent

All Implemented Interfaces:

public class MembershipEvent
extends EventObject
Membership event fired when a new member is added to the cluster and/or when a member leaves the cluster and similar methods.
See Also:
MembershipListener, Serialized Form
  • Field Details

  • Constructor Details

  • Method Details

    • getMembers

      public Set<Member> getMembers()
      Returns a consistent view of the the members immediately after this MembershipEvent has been processed. If a member is removed, the returned set will not include this member. If a member is added, it will include this member.

      The problem with calling the Cluster.getMembers() method is that the content could already have changed while processing this event, so it becomes very difficult to write a deterministic algorithm since you cannot get a deterministic view of the members. This method solves that problem.

      The set is immutable and ordered. For more information see Cluster.getMembers().

      the members at the moment after this event.
    • getCluster

      public Cluster getCluster()
      Returns the cluster of the event.
      the current cluster instance
    • getEventType

      public int getEventType()
      Returns the membership event type; #MEMBER_ADDED #MEMBER_REMOVED
      the membership event type
    • getMember

      public Member getMember()
      Returns the removed or added member.
      member which is removed or added
    • toString

      public String toString()
      toString in class EventObject