next up previous contents
Next: ChannelListener Up: Interfaces Previous: MessageListener   Contents


MembershipListener

The MembershipListener interface is similar to the MessageListener interface above: 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.

    public interface MembershipListener {    
        public void viewAccepted(View new_view);
        public void suspect(Object suspected_mbr);
        public void block();
    }

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. The suspect() callback is invoked by JavaGroups whenever a member if suspected of having crashed, but not yet excluded3.1. The block method is 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.



Bela Ban 2002-11-16