|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectgroupmgmt.MemberDetector
The MemberDetector abstract class; Detects members based on anything (most likely with a GroupBeaconListener) and some sort of filter (ie safe-distance calculations).
If the constructor is overridden it must call super(groupmgmtPort).
start() and stop() should be implemented.
When a change is detected, reportChange() should be called.
In the default implementation:
It multicasts periodic beacons to our neighbors for discovery.
It listens for the beacons and keeps a list of neighbors it has
discovered.
It calls reportChange when new members are discovered and when a
known member's beacon has 'stopping' set.
And in the safe-distance based module we also
check the location info in the beacons for safe distance.
Field Summary | |
private boolean |
active
Is this MemberDetector active (detecting members and notifying the GroupDisseminator)? |
protected GroupDisseminator |
disseminator
The GroupDisseminator to use to effect changes in the group. |
Constructor Summary | |
MemberDetector()
Constructor. |
Method Summary | |
(package private) void |
activate()
The GroupManager calls this when we should activate the detector. |
(package private) void |
deactivate()
The GroupManager calls this when we should deactivate the detector. |
boolean |
isActive()
Check if this MemberDetector is active. |
protected boolean |
reportChange(Member[] arriving,
Member[] departing)
Called by the implementing class to process a change in this Member's connections. |
(package private) boolean |
setDisseminator(GroupDisseminator disseminator)
Change the GroupDisseminator. |
protected abstract void |
start()
Begin looking for changes in the group (hosts to engage/disengage with). |
protected abstract void |
stop()
Stop reporting changes in the group (and presumably stop looking). |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected GroupDisseminator disseminator
private boolean active
Constructor Detail |
public MemberDetector()
Method Detail |
void activate()
void deactivate()
protected abstract void start()
protected abstract void stop()
public boolean isActive()
boolean setDisseminator(GroupDisseminator disseminator)
protected boolean reportChange(Member[] arriving, Member[] departing)
arriving
- The arriving Member(s).departing
- The departing Member(s).
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |