com.xavax.xstore.util
Class InitialContext

Object
  extended byInitialContext
      extended byInitialContext
All Implemented Interfaces:
Context

public class InitialContext
extends InitialContext

InitialContext can be used when running outside of an application server environment without a name server. A hash table is used to implement the binding of objects to names and lookup of objects by name.


Field Summary
 
Fields inherited from interface Context
APPLET, AUTHORITATIVE, BATCHSIZE, DNS_URL, INITIAL_CONTEXT_FACTORY, LANGUAGE, OBJECT_FACTORIES, PROVIDER_URL, REFERRAL, SECURITY_AUTHENTICATION, SECURITY_CREDENTIALS, SECURITY_PRINCIPAL, SECURITY_PROTOCOL, STATE_FACTORIES, URL_PKG_PREFIXES
 
Constructor Summary
InitialContext(Hashtable env)
          Construct an InitialContext.
 
Method Summary
 void bind(String name, Object value)
          Bind an object to the specified name.
 Object lookup(String name)
          Returns the object which is bound to the specified name.
 String toString()
          Returns a string representation of this initial context.
 
Methods inherited from class InitialContext
addToEnvironment, bind, close, composeName, composeName, createSubcontext, createSubcontext, destroySubcontext, destroySubcontext, getEnvironment, getNameInNamespace, getNameParser, getNameParser, list, list, listBindings, listBindings, lookup, lookupLink, lookupLink, rebind, rebind, removeFromEnvironment, rename, rename, unbind, unbind
 
Methods inherited from class Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

InitialContext

public InitialContext(Hashtable env)
               throws NamingException
Construct an InitialContext.

Parameters:
env - the environment for creating the context.
Method Detail

bind

public void bind(String name,
                 Object value)
Bind an object to the specified name.

Parameters:
name - the name to which the object is bound.
value - the object to be bound.

lookup

public Object lookup(String name)
Returns the object which is bound to the specified name.

Parameters:
name - the name of the object to be returned.
Returns:
the object which is bound to the specified name.

toString

public String toString()
Returns a string representation of this initial context.

Returns:
a string representation of this initial context.