edu.vub.at.actors.net
Class VMAddressBook

java.lang.Object
  extended byedu.vub.at.actors.net.VMAddressBook

public class VMAddressBook
extends java.lang.Object

The VMAddressBook encapsulates the bi-directional mapping: AmbientTalk VM GUID --> JGroups Address JGroups Address --> AmbientTalk VM GUID It is necessary to maintain such a mapping to correctly identify and restore the connection between AmbientTalk VMs. A JGroups address cannot be used as a good identification key because an AmbientTalk VM may be known under different addresses as it goes offline and online. When a new VM joins, after handshaking, an entry is added to the address book. When a VM disjoins, the entry corresponding to the address that went offline is removed.

Author:
elgonzal, tvcutsem

Field Summary
private  java.util.Hashtable addressToGuid_
           
private  java.util.Hashtable guidToAddress_
           
 
Constructor Summary
VMAddressBook()
           
 
Method Summary
 void addEntry(GUID vmId, org.jgroups.Address vmAddress)
           
 org.jgroups.Address getAddressOf(GUID vmId)
          Resolve a remote VM's unique identifier to a concrete network address.
 GUID getGUIDOf(org.jgroups.Address vmAddress)
          Resolve a concrete network address to a remote VM's unique identifier.
 void removeEntry(org.jgroups.Address vmAddress)
          Remove all entries that map to this VM address from the VM Address book.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

guidToAddress_

private final java.util.Hashtable guidToAddress_

addressToGuid_

private final java.util.Hashtable addressToGuid_
Constructor Detail

VMAddressBook

public VMAddressBook()
Method Detail

addEntry

public void addEntry(GUID vmId,
                     org.jgroups.Address vmAddress)

removeEntry

public void removeEntry(org.jgroups.Address vmAddress)
Remove all entries that map to this VM address from the VM Address book.


getAddressOf

public org.jgroups.Address getAddressOf(GUID vmId)
Resolve a remote VM's unique identifier to a concrete network address.


getGUIDOf

public GUID getGUIDOf(org.jgroups.Address vmAddress)
Resolve a concrete network address to a remote VM's unique identifier.