groupmgmt.impl
Class SinglePhaseDisseminator

java.lang.Object
  |
  +--groupmgmt.GroupDisseminator
        |
        +--groupmgmt.impl.SinglePhaseDisseminator

public class SinglePhaseDisseminator
extends GroupDisseminator

The SinglePhaseDisseminator class. Responsible for coordinating group changes with members of the group.

This implementation does that via a "Single-phase transaction", ie it sends a message to everyone in the group and assumes that they got it. One member of the group is designated Leader, and it keeps a graph of the connections within its group (implemented as a Hashtable). The followers notify the leader of changes in their connections, and the leader updates its graph and changes the group when needed.

Multiple removes can be done simultaneously by the leader.
Adds must be serialized (to keep leader-leader communication simple), this is done by the ConnectionChangeQueue.

Messages used:

## FUTURE WORK:
##
## anticipate potential problems with refusedchanges.
## (theoretically ConnectionChangeMessages could get out of order).
## handle unexpected loss of connection to leader/robustness in general
## test with large groups. algorithms fast/scalable enough?

Version:
July 2003
Author:
Christine Julien, Tom Elgin

Constructor Summary
SinglePhaseDisseminator(int portOffset)
          Constructor.
 
Method Summary
 void changeGroup(Member[] arriving, Member[] departing)
          Process a change in connectivity detected by MemberDetector Send it to the connectionChangeQueue to process.
protected  void fireGroupChangedEvent(java.util.Vector members)
          Helper method to automatically construct the event before firing.
 void setDebug(boolean debugging)
          Determine whether to output logging messages.
protected  void start()
          Start responding to changeGroup messages.
protected  void stop()
          Suspend all activity - stop responding to changeGroup events.
 
Methods inherited from class groupmgmt.GroupDisseminator
addGroupChangedListener, fireGroupChangedEvent, isActive, removeGroupChangedListener
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SinglePhaseDisseminator

public SinglePhaseDisseminator(int portOffset)
Constructor. Sets port offset and calls super().
Parameters:
portOffset - The offset (relative to the groupmgmt port) to use when communicating with another member's disseminator.
Method Detail

setDebug

public void setDebug(boolean debugging)
Determine whether to output logging messages.
Parameters:
debugging - Outputs messages if true.

start

protected void start()
Start responding to changeGroup messages. (May also start listening for network messages from members)
Overrides:
start in class GroupDisseminator

stop

protected void stop()
Suspend all activity - stop responding to changeGroup events.
Overrides:
stop in class GroupDisseminator

changeGroup

public void changeGroup(Member[] arriving,
                        Member[] departing)
Process a change in connectivity detected by MemberDetector Send it to the connectionChangeQueue to process.
Overrides:
changeGroup in class GroupDisseminator
Parameters:
arriving - The new Member(s).
departing - The leaving Member(s).

fireGroupChangedEvent

protected void fireGroupChangedEvent(java.util.Vector members)
Helper method to automatically construct the event before firing.