|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jgroups.ExtendedReceiverAdapter
edu.vub.at.actors.net.MembershipNotifier
An instance of the class MembershipNotifier is registered with an instance of the JGroups MessageDispatcher class as its MembershipListener. Whenever virtual machines connect or disconnect from the multicast group, this object is notified. Its role is to propagate these notifications to: A) The AT/2 DiscoveryManager which is interested in contacting newly joined virtual machines to see whether they provide some services that this VM requires. B) All connected ConnectionListeners, which will usually be remote references pointing to objects hosted by the connecting/disconnecting VM. TODO: change Address keys of ConnectionListeners to GUIDs to support changing addresses.
Field Summary | |
private MultiMap |
connectionListeners_
A collection of ConnectionListeners which are interested in the (dis)appearance of a single node in the JGroups overlay network. |
private DiscoveryListener |
discoveryManager_
The general manager for service discovery for the entire virtual machine. |
private java.util.Vector |
knownMembers_
Members of the previously accepted view are stored to evaluate the difference with any new view that may be signalled to this class. |
Constructor Summary | |
MembershipNotifier(DiscoveryListener discoveryManager)
Creates a new MembershipNotifier on which ConnectionListeners monitoring the (dis)appearance of a single address can register to. |
Method Summary | |
void |
addConnectionListener(GUID virtualMachine,
ConnectionListener listener)
Registers listener to be notified whenever a virtual machine becomes (un)reachable. |
void |
channelDisconnected()
|
void |
notifyConnected(GUID vmId)
|
void |
notifyDisconnected(GUID vmId)
|
void |
removeConnectionListener(GUID virtualMachine,
ConnectionListener listener)
Unregisters listener such that it will no longer be notified whenever a
particular virtual machine becomes (un)reachable. |
void |
viewAccepted(org.jgroups.View newView)
This method is a callback from the JGroups framework that is invoked whenever the set of connected group members has changed. |
Methods inherited from class org.jgroups.ExtendedReceiverAdapter |
block, getState, getState, getState, getState, receive, setState, setState, setState, setState, suspect, unblock |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.jgroups.MembershipListener |
block, suspect |
Field Detail |
private final java.util.Vector knownMembers_
private final MultiMap connectionListeners_
private final DiscoveryListener discoveryManager_
Constructor Detail |
public MembershipNotifier(DiscoveryListener discoveryManager)
discoveryManager
- - the service discovery manager for the current address.Method Detail |
public void addConnectionListener(GUID virtualMachine, ConnectionListener listener)
listener
to be notified whenever a virtual machine becomes (un)reachable.
virtualMachine
- - an address of the virtual machine hosting the object the listener is interested inlistener
- - a listener which will be notified whenever the said address connects or disconnectspublic void removeConnectionListener(GUID virtualMachine, ConnectionListener listener)
listener
such that it will no longer be notified whenever a
particular virtual machine becomes (un)reachable.
public void viewAccepted(org.jgroups.View newView)
viewAccepted
in interface org.jgroups.MembershipListener
public void notifyConnected(GUID vmId)
public void notifyDisconnected(GUID vmId)
public void channelDisconnected()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |