|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--groupmgmt.GroupManager
The Group Manager;
Built for use in LIME 1.1;
Maintains local information about the group that the current host
is a part of (list of members).
Can be switched on and off by the controlling class.
Controls the MemberDetector -
Detects new/stopping members & dropped connections.
and the GroupDisseminator -
Effects changes in the group based on data from the Detector.
Constructor Summary | |
GroupManager(int groupmgmtPort,
MemberDetector detector,
GroupDisseminator disseminator,
boolean sendSelfEngagement)
Constructor, initializes the GroupManager with the provided MemberDetector and GroupDisseminator. |
Method Summary | |
void |
addGroupChangedListener(GroupChangedListener listener)
Registers a GroupChangedListener to receive all GroupChangedEvents generated by this GroupDisseminator. |
void |
connect()
Turn the GroupManager on. |
void |
disconnect()
Turn the GroupManager off. |
MemberDetector |
getDetector()
Accessor to get the MemberDetector. |
GroupDisseminator |
getDisseminator()
Accessor to get the GroupDisseminator. |
static Member |
getMember()
Static accessor for Detectors/Disseminators to get a Member object representing this group member. |
void |
groupChanged(GroupChangedEvent event)
Method required by the GroupChangedListener interface. |
static void |
main(java.lang.String[] args)
## Main method just for testing on the command-line. |
static void |
print(java.lang.String msg)
Static utility method to log output from any groupmgmt class. |
void |
removeGroupChangedListener(GroupChangedListener listener)
Unregisters a GroupChangedListener, stops sending GroupChangedEvents to the listener. |
void |
resumeUpdates()
Resume sending GroupChangedEvents to the listeners. |
void |
setDebug(boolean debugging)
Determine whether to output logging messages. |
boolean |
setDetector(MemberDetector newDetector)
Change the MemberDetector. |
boolean |
setDisseminator(GroupDisseminator newDisseminator)
Change the GroupDisseminator and tell the MemberDetector. |
void |
suppressUpdates()
Allows the calling class to tell us to temporarily stop sending GroupChangedEvents. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public GroupManager(int groupmgmtPort, MemberDetector detector, GroupDisseminator disseminator, boolean sendSelfEngagement)
groupmgmtPort
- The port to use to identify this group member.detector
- The MemberDetector to use.disseminator
- The GroupDisseminator to use.sendSelfEngagement
- Whether to fire a GroupChangedEvent
when the Member engages with itself.Method Detail |
public void setDebug(boolean debugging)
debugging
- Outputs messages if true.public void connect()
public void disconnect()
public void suppressUpdates()
public void resumeUpdates()
public static Member getMember()
public MemberDetector getDetector()
public boolean setDetector(MemberDetector newDetector)
The
- new MemberDetector to use.public GroupDisseminator getDisseminator()
public boolean setDisseminator(GroupDisseminator newDisseminator)
The
- new GroupDisseminator to use.public void groupChanged(GroupChangedEvent event)
groupChanged
in interface GroupChangedListener
public void addGroupChangedListener(GroupChangedListener listener)
listener
- The GroupChangedListener to receive events.public void removeGroupChangedListener(GroupChangedListener listener)
listener
- The GroupChangedListener to stop receiving events.public static void print(java.lang.String msg)
msg
- The message to display.public static void main(java.lang.String[] args)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |