|
ANTS v2.0 API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--ants.core.NeighborTable
The neighbor table maintains a mapping of logical active network addresses to physical Addresses. The table also supports "listeners". Each listener is notifed whenever the table changes.
This class uses a somewhat crufty access control mechanism to prevent access by untrusted code. Read access is mediated by performing a single reference monitor check in Node.getNeighborTable. Write access is mediated by performing a reference monitor check for each write access. This optimizes for the common case (reads) without explicitly separting the read and write interfaces. Also, we assume that read access to the table implies the right to add and remove NeighborListeners.
XXX the current implementation suffers from race conditions related to multiple updates occurring frequently. There is a basically a single update buffer between the table and each listener. If a listener is not "quick enough" updates may get lost. Additionally (though less likely) updates can get partially overwritten.
NeighborListener
,
Node.getNeighborTable()
Method Summary | |
void |
addNeighbor(int address,
edu.utah.janos.nodeos.Address link)
add a new neighbor, and notify any listeners. |
void |
addNeighborListener(NeighborListener nl)
|
edu.utah.janos.nodeos.Address |
getNeighbor(int address)
Return a physical address given a (virtual) active network address. |
edu.utah.janos.nodeos.Address |
getNeighbor(java.lang.Integer address)
Return a physical address given a (virtual) active network address. |
java.util.Enumeration |
getNeighbors()
Return an enumeration of all the neighbor virtual addresses. |
void |
removeNeighbor(int address)
remove an immediate neighbor, and notify and listeners. |
void |
removeNeighborListener(NeighborListener nl)
|
Methods inherited from class java.lang.Object |
equals,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Method Detail |
public edu.utah.janos.nodeos.Address getNeighbor(int address)
public edu.utah.janos.nodeos.Address getNeighbor(java.lang.Integer address)
public java.util.Enumeration getNeighbors()
public void addNeighborListener(NeighborListener nl)
public void removeNeighborListener(NeighborListener nl)
public void addNeighbor(int address, edu.utah.janos.nodeos.Address link)
public void removeNeighbor(int address)
|
ANTS v2.0 API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |