org.apache.avalon.excalibur.naming.memory
Class MemoryContext

java.lang.Object
  extended byorg.apache.avalon.excalibur.naming.AbstractContext
      extended byorg.apache.avalon.excalibur.naming.AbstractLocalContext
          extended byorg.apache.avalon.excalibur.naming.memory.MemoryContext
All Implemented Interfaces:
javax.naming.Context

public class MemoryContext
extends AbstractLocalContext

An in memory context implementation.

Version:
$Revision: 1.5 $
Author:
Peter Donald

Field Summary
private  java.util.Hashtable m_bindings
           
 
Fields inherited from class org.apache.avalon.excalibur.naming.AbstractLocalContext
 
Fields inherited from class org.apache.avalon.excalibur.naming.AbstractContext
 
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
  MemoryContext(Namespace namespace, java.util.Hashtable environment, javax.naming.Context parent)
           
protected MemoryContext(Namespace namespace, java.util.Hashtable environment, javax.naming.Context parent, java.util.Hashtable bindings)
           
 
Method Summary
protected  javax.naming.Context cloneContext()
           
protected  void doLocalBind(javax.naming.Name name, java.lang.Object object)
           
protected  javax.naming.NamingEnumeration doLocalList()
           
protected  javax.naming.NamingEnumeration doLocalListBindings()
           
protected  java.lang.Object doLocalLookup(javax.naming.Name name)
          Actually lookup raw entry in local context.
protected  void doLocalUnbind(javax.naming.Name name)
          Actually unbind raw entry in local context.
protected  javax.naming.Context newContext()
           
 
Methods inherited from class org.apache.avalon.excalibur.naming.AbstractLocalContext
bind, checkUnbindContext, close, createSubcontext, destroySubcontext, getNameInNamespace, getNameParser, getNamespace, getParent, isDestroyableContext, list, listBindings, localLookup, lookup, lookupSubContext, unbind
 
Methods inherited from class org.apache.avalon.excalibur.naming.AbstractContext
addToEnvironment, bind, bind, composeName, composeName, createSubcontext, destroySubcontext, getEnvironment, getLeafName, getNameParser, getNameParser, getPathName, getRawEnvironment, isSelf, list, listBindings, lookup, lookupLink, lookupLink, rebind, rebind, removeFromEnvironment, rename, rename, unbind
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

m_bindings

private java.util.Hashtable m_bindings
Constructor Detail

MemoryContext

protected MemoryContext(Namespace namespace,
                        java.util.Hashtable environment,
                        javax.naming.Context parent,
                        java.util.Hashtable bindings)

MemoryContext

public MemoryContext(Namespace namespace,
                     java.util.Hashtable environment,
                     javax.naming.Context parent)
Method Detail

newContext

protected javax.naming.Context newContext()
                                   throws javax.naming.NamingException
Specified by:
newContext in class AbstractLocalContext
Throws:
javax.naming.NamingException

cloneContext

protected javax.naming.Context cloneContext()
                                     throws javax.naming.NamingException
Specified by:
cloneContext in class AbstractLocalContext
Throws:
javax.naming.NamingException

doLocalBind

protected void doLocalBind(javax.naming.Name name,
                           java.lang.Object object)
                    throws javax.naming.NamingException
Specified by:
doLocalBind in class AbstractLocalContext
Throws:
javax.naming.NamingException

doLocalList

protected javax.naming.NamingEnumeration doLocalList()
                                              throws javax.naming.NamingException
Specified by:
doLocalList in class AbstractLocalContext
Throws:
javax.naming.NamingException

doLocalListBindings

protected javax.naming.NamingEnumeration doLocalListBindings()
                                                      throws javax.naming.NamingException
Specified by:
doLocalListBindings in class AbstractLocalContext
Throws:
javax.naming.NamingException

doLocalLookup

protected java.lang.Object doLocalLookup(javax.naming.Name name)
                                  throws javax.naming.NamingException
Actually lookup raw entry in local context. When overidding this it is not neccesary to resolve references etc.

Specified by:
doLocalLookup in class AbstractLocalContext
Parameters:
name - the name in local context (size() == 1)
Returns:
the bound object
Throws:
javax.naming.NamingException - if an error occurs

doLocalUnbind

protected void doLocalUnbind(javax.naming.Name name)
                      throws javax.naming.NamingException
Actually unbind raw entry in local context.

Specified by:
doLocalUnbind in class AbstractLocalContext
Parameters:
name - the name in local context (size() == 1)
Throws:
javax.naming.NamingException - if an error occurs