org.planx.xmlstore.nameserver
Class LocalNameServer

java.lang.Object
  extended by org.planx.xmlstore.nameserver.LocalNameServer
All Implemented Interfaces:
NameServer

public class LocalNameServer
extends Object
implements NameServer

A NameServer for local use only. A LocalNameServer is associated with a specific XMLStore and will ensure that the XMLStore retains References bound and releases old rebound References.

Author:
Henning Niss, Thomas Ambus

Constructor Summary
LocalNameServer(LocalXMLStore xmlstore)
           
 
Method Summary
 void bind(String name, Reference ref)
          Bind the name to the value reference in the name server.
 Reference lookup(String docName)
          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

LocalNameServer

public LocalNameServer(LocalXMLStore xmlstore)
                throws IOException
Throws:
IOException
Method Detail

lookup

public Reference lookup(String docName)
Description copied from interface: NameServer
Lookup the name in the name server. The method will return null if the name is not currently bound.

Specified by:
lookup in interface NameServer
Parameters:
docName - the name to be looked up
Returns:
the reference bound to the name, or null if the name is not currently bound

bind

public void bind(String name,
                 Reference ref)
          throws IOException,
                 NameAlreadyBoundException
Description copied from interface: NameServer
Bind the name to the value reference in the name server.

Specified by:
bind in interface NameServer
Parameters:
name - the name to be bound
ref - the reference to bind it to
Throws:
IOException
NameAlreadyBoundException - if the name is already bound (to a different value reference).

rebind

public void rebind(String name,
                   Reference oldr,
                   Reference newr)
            throws IOException,
                   StaleReferenceException
Description copied from interface: NameServer
Rebind the name to the value reference in the name server if the name is currently bound to the specified value reference.

Specified by:
rebind in interface NameServer
Parameters:
name - the name to be bound
oldr - the reference to which name is currently bound
newr - the reference to bind it to
Throws:
IOException
StaleReferenceException - if the name is bound to something different from oldRef.


Copyright © 2010. All Rights Reserved.