|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.planx.xmlstore.nameserver.GlobalNameServer
public class GlobalNameServer
A distributed NameServer that relies on a DistributedMap.
A typical DistributedMap implementation such as Kademlia
will not use any global consensus algorithms or locks to ensure that all peers
agree on the contents of the global name server at any given time. In a stabile
network with reliable communication that uses Kademlia, updates will be globally
available with a delay of the time it takes to send an UDP packet. With unreliable
communication, no guarantees are given other than that the peers will eventually agree
on the newest version of a name server entry.
All-in-all, the semantics of the operations are somewhat more loose than required, so this implementation should be regarded as experimental.
| Constructor Summary | |
|---|---|
GlobalNameServer(DistributedMap map)
|
|
| Method Summary | |
|---|---|
void |
bind(String name,
Reference vref)
Bind the name to the value reference in the name server. |
Reference |
lookup(String name)
Lookup the name in the name server. |
void |
rebind(String name,
Reference oldr,
Reference newr)
Rebind the name to the value reference in the name server if the name is currently bound to the specified value reference. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public GlobalNameServer(DistributedMap map)
| Method Detail |
|---|
public Reference lookup(String name)
throws IOException
NameServer
lookup in interface NameServername - the name to be looked up
IOException
public void bind(String name,
Reference vref)
throws IOException,
NameAlreadyBoundException
NameServer
bind in interface NameServername - the name to be boundvref - the reference to bind it to
IOException
NameAlreadyBoundException - if the name is
already bound (to a different value reference).
public void rebind(String name,
Reference oldr,
Reference newr)
throws IOException,
StaleReferenceException
NameServer
rebind in interface NameServername - the name to be boundoldr - the reference to which name is currently boundnewr - the reference to bind it to
IOException
StaleReferenceException - if the name is
bound to something different from oldRef.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||