org.jgroups
Interface MembershipListener

All Known Subinterfaces:
Receiver
All Known Implementing Classes:
Chat, DistributedHashtable, DistributedQueue, DistributedTree, MembershipListenerAdapter, NotificationBus, QuoteClient, QuoteServer, ReceiverAdapter, ReplicatedHashtable, ReplicatedTree, Topology, ViewDemo, VotingAdapter, Whiteboard

public interface MembershipListener

Allows a listener to be notified when group membership changes. These callbacks are used in PullPushAdapter.

The MembershipListener interface is similar to the MessageListener interface: every time a new view, a suspicion message, or a block event is received, the corresponding method of the class implementing MembershipListener will be called. Oftentimes the only method containing any functionality will be viewAccepted() which notifies the receiver that a new member has joined the group or that an existing member has left or crashed.


Method Summary
 void block()
          Called whenever the member needs to stop sending messages.
 void suspect(Address suspected_mbr)
          Called whenever a member is suspected of having crashed, but has not yet been excluded.
 void viewAccepted(View new_view)
          Called when a change in membership has occurred.
 

Method Detail

viewAccepted

public void viewAccepted(View new_view)
Called when a change in membership has occurred. No long running actions should be done in this callback. If some long running action needs to be performed, it should be done in a separate thread.


suspect

public void suspect(Address suspected_mbr)
Called whenever a member is suspected of having crashed, but has not yet been excluded.


block

public void block()
Called whenever the member needs to stop sending messages. When the next view is received (viewAccepted()), the member can resume sending messages. If a member does not comply, the message(s) sent between a block() and a matching viewAccepted() callback will probably be delivered in the next view. The block() callback is only needed by the Virtual Synchrony suite of protocols (FLUSH protocol)3.2, otherwise it will never be invoked.



Copyright ? 1998-2005 Bela Ban. All Rights Reserved.