org.planx.xmlstore
Interface NameServer<R extends Reference>

All Known Implementing Classes:
GlobalNameServer, LocalNameServer

public interface NameServer<R extends Reference>

Author:
Henning Niss, Thomas Ambus

Method Summary
 void bind(String name, R ref)
          Bind the name to the value reference in the name server.
 void close()
          Closes the NameServer releasing all resources.
 R lookup(String name)
          Lookup the name in the name server.
 void rebind(String name, R oldRef, R newRef)
          Rebind the name to the value reference in the name server if the name is currently bound to the specified value reference.
 

Method Detail

lookup

R lookup(String name)
                           throws IOException,
                                  NameServerException
Lookup the name in the name server. The method will return null if the name is not currently bound.

Parameters:
name - the name to be looked up
Returns:
the reference bound to the name, or null if the name is not currently bound
Throws:
IOException
NameServerException

bind

void bind(String name,
          R ref)
          throws IOException,
                 NameServerException
Bind the name to the value reference in the name server.

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

rebind

void rebind(String name,
            R oldRef,
            R newRef)
            throws IOException,
                   NameServerException
Rebind the name to the value reference in the name server if the name is currently bound to the specified value reference.

Parameters:
name - the name to be bound
oldRef - the reference to which name is currently bound
newRef - the reference to bind it to
Throws:
StaleReferenceException - if the name is bound to something different from oldRef.
IOException
NameServerException

close

void close()
           throws IOException
Closes the NameServer releasing all resources. Further method invocation on the NameServer are illegal.

Throws:
IOException


Copyright © 2004-2005 Plan-X. All Rights Reserved.