|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--groupmgmt.GroupDisseminator
The GroupDisseminator abstract class; Implementations of this class are responsible for coordinating group changes with members of the group, based on connection changes sent by the MemberDetector.
If the constructor is overridden it must call super().
changeGroup() must be implemented to respond to requests from the
MemberDetector.
start() and stop() must be implemented.
When the group is actually changed, the implementing class must call
fireGroupChangedEvent() to notify any listeners (ie the GroupManager)
of the actual change in the group.
Constructor Summary | |
GroupDisseminator()
Constructor. |
Method Summary | |
void |
addGroupChangedListener(GroupChangedListener listener)
Registers a GroupChangedListener to receive all GroupChangedEvents generated by this GroupDisseminator. |
abstract void |
changeGroup(Member[] arriving,
Member[] departing)
Change the configuration of the current group. |
protected void |
fireGroupChangedEvent(GroupChangedEvent event)
Sends a GroupChangedEvent to all registered listeners. |
boolean |
isActive()
Check if this GroupDisseminator is active. |
void |
removeGroupChangedListener(GroupChangedListener listener)
Unregisters a GroupChangedListener, stops sending GroupChangedEvents to the listener. |
protected abstract void |
start()
Start responding to changeGroup messages and fire GroupChangedEvents. |
protected abstract void |
stop()
Suspend all activity - stop firing GroupChangedEvents. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public GroupDisseminator()
Method Detail |
public boolean isActive()
protected abstract void start()
protected abstract void stop()
public abstract void changeGroup(Member[] arriving, Member[] departing)
arriving
- The Member(s) we are newly connected to.departing
- The Member(s) we are no longer connected to.public void addGroupChangedListener(GroupChangedListener listener)
listener
- The GroupChangedListener to receive events.public void removeGroupChangedListener(GroupChangedListener listener)
listener
- The GroupChangedListener to stop receiving events.protected void fireGroupChangedEvent(GroupChangedEvent event)
event
- The GroupChangedEvent to send.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |