org.planx.xmlstore.koala.nameserver
Class LocalNameServer

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

public class LocalNameServer
extends Object
implements NameServer<LocalLocator>

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, LocalLocator ref)
          Bind the name to the value reference in the name server.
 void close()
          Closes the NameServer releasing all resources.
 LocalLocator lookup(String docName)
          Lookup the name in the name server.
 void rebind(String name, LocalLocator oldr, LocalLocator 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
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LocalNameServer

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

close

public void close()
           throws IOException
Description copied from interface: NameServer
Closes the NameServer releasing all resources. Further method invocation on the NameServer are illegal.

Specified by:
close in interface NameServer<LocalLocator>
Throws:
IOException

lookup

public LocalLocator 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<LocalLocator>
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,
                 LocalLocator 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<LocalLocator>
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,
                   LocalLocator oldr,
                   LocalLocator 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<LocalLocator>
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 © 2004-2005 Plan-X. All Rights Reserved.