org.openmdx.kernel.naming.spi
Class HashMapContext

java.lang.Object
  extended by org.openmdx.kernel.naming.spi.AbstractContext
      extended by org.openmdx.kernel.naming.spi.NameBasedContext
          extended by org.openmdx.kernel.naming.spi.HashMapContext
All Implemented Interfaces:
Context
Direct Known Subclasses:
LocalContext

public class HashMapContext
extends NameBasedContext

Hashtable Based Context


Field Summary
 
Fields inherited from class org.openmdx.kernel.naming.spi.AbstractContext
environment, nameParser
 
Fields inherited from interface javax.naming.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
HashMapContext(Hashtable environment, Context namePrefix, String nameSuffix)
          Constructor
HashMapContext(Hashtable environment, NameParser nameParser)
          Constructor
 
Method Summary
 void bind(Name name, Object obj)
           
 void close()
           
 Context createSubcontext(Name name)
           
 void destroySubcontext(Name name)
           
 String getNameInNamespace()
           
protected  NamingEnumeration listBindings()
          List the bindings
 void rebind(Name name, Object obj)
           
protected  Object resolveLink(String nameComponent)
          Resolve a binding
 void unbind(Name name)
           
 
Methods inherited from class org.openmdx.kernel.naming.spi.NameBasedContext
bind, composeName, composeName, createSubcontext, destroySubcontext, getNameParser, getNameParser, list, list, listBindings, listBindings, lookup, lookup, lookupLink, lookupLink, rebind, rename, rename, resolve, unbind
 
Methods inherited from class org.openmdx.kernel.naming.spi.AbstractContext
addToEnvironment, getEnvironment, removeFromEnvironment, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

HashMapContext

public HashMapContext(Hashtable environment,
                      Context namePrefix,
                      String nameSuffix)
               throws NamingException
Constructor

Parameters:
environment -
namePrefix -
nameSuffix -
Throws:
NamingException

HashMapContext

public HashMapContext(Hashtable environment,
                      NameParser nameParser)
               throws NamingException
Constructor

Throws:
NamingException
Method Detail

resolveLink

protected Object resolveLink(String nameComponent)
                      throws NamingException
Resolve a binding

Specified by:
resolveLink in class NameBasedContext
Parameters:
nameComponent -
Returns:
the object bound to the given name or null if not found
Throws:
NamingException

listBindings

protected NamingEnumeration listBindings()
                                  throws NamingException
List the bindings

Specified by:
listBindings in class NameBasedContext
Returns:
this context's bindings
Throws:
NamingException

bind

public void bind(Name name,
                 Object obj)
          throws NamingException
Specified by:
bind in interface Context
Overrides:
bind in class NameBasedContext
Throws:
NamingException

unbind

public void unbind(Name name)
            throws NamingException
Specified by:
unbind in interface Context
Overrides:
unbind in class NameBasedContext
Throws:
NamingException

createSubcontext

public Context createSubcontext(Name name)
                         throws NamingException
Specified by:
createSubcontext in interface Context
Overrides:
createSubcontext in class NameBasedContext
Throws:
NamingException

destroySubcontext

public void destroySubcontext(Name name)
                       throws NamingException
Specified by:
destroySubcontext in interface Context
Overrides:
destroySubcontext in class NameBasedContext
Throws:
NamingException

rebind

public void rebind(Name name,
                   Object obj)
            throws NamingException
Specified by:
rebind in interface Context
Overrides:
rebind in class NameBasedContext
Throws:
NamingException

getNameInNamespace

public String getNameInNamespace()
                          throws NamingException
Throws:
NamingException

close

public void close()
           throws NamingException
Specified by:
close in interface Context
Overrides:
close in class AbstractContext
Throws:
NamingException


This software is published under the BSD license. Copyright © 2003-2007, OMEX AG, Switzerland, All rights reserved. Use is subject to license terms.