|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--groupmgmt.GroupDisseminator | +--groupmgmt.impl.SinglePhaseDisseminator
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?
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 |
public SinglePhaseDisseminator(int portOffset)
portOffset
- The offset (relative to the groupmgmt port) to use
when communicating with another member's
disseminator.Method Detail |
public void setDebug(boolean debugging)
debugging
- Outputs messages if true.protected void start()
start
in class GroupDisseminator
protected void stop()
stop
in class GroupDisseminator
public void changeGroup(Member[] arriving, Member[] departing)
changeGroup
in class GroupDisseminator
arriving
- The new Member(s).departing
- The leaving Member(s).protected void fireGroupChangedEvent(java.util.Vector members)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |