org.apache.xbean.naming.context
Class WritableContext

java.lang.Object
  extended by org.apache.xbean.naming.context.AbstractContext
      extended by org.apache.xbean.naming.context.AbstractFederatedContext
          extended by org.apache.xbean.naming.context.WritableContext
All Implemented Interfaces:
Serializable, Context, NestedContextFactory

public class WritableContext
extends AbstractFederatedContext

Version:
$Rev$ $Date$
See Also:
Serialized Form

Nested Class Summary
 class WritableContext.NestedWritableContext
          Nested context which shares the absolute index map in MapContext.
 
Field Summary
 
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
WritableContext()
           
WritableContext(String nameInNamespace)
           
WritableContext(String nameInNamespace, Map bindings)
           
WritableContext(String nameInNamespace, Map bindings, boolean cacheReferences)
           
WritableContext(String nameInNamespace, Map bindings, ContextAccess contextAccess)
           
WritableContext(String nameInNamespace, Map bindings, ContextAccess contextAccess, boolean cacheReferences)
           
 
Method Summary
protected  void addBinding(AtomicReference bindingsRef, String name, String nameInNamespace, Object value, boolean rebind)
           
protected  boolean addBinding(String name, Object value, boolean rebind)
           
 Context createNestedSubcontext(String path, Map bindings)
          Creates a nested subcontext instance.
protected  Object getDeepBinding(String name)
          Gets the object bound to the name.
protected  Map getWrapperBindings()
           
protected  boolean removeBinding(String name, boolean removeNotEmptyContext)
          Removes the binding from the context.
 
Methods inherited from class org.apache.xbean.naming.context.AbstractFederatedContext
addFederatedContext, faultLookup, getBinding, getBindings, getMasterContext, isNestedSubcontext
 
Methods inherited from class org.apache.xbean.naming.context.AbstractContext
addBinding, addDeepBinding, addToEnvironment, bind, bind, close, composeName, composeName, createSubcontext, createSubcontext, createSubcontextTree, destroySubcontext, destroySubcontext, getContextAccess, getEnvironment, getNameInNamespace, getNameInNamespace, getNameInNamespace, getNameParser, getNameParser, getNameParser, getParsedNameInNamespace, getSize, isEmpty, list, list, list, listBindings, listBindings, listBindings, lookup, lookup, lookup, lookupFinalContext, lookupLink, lookupLink, rebind, rebind, removeDeepBinding, removeDeepBinding, removeFromEnvironment, rename, rename, unbind, unbind
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WritableContext

public WritableContext()
                throws NamingException
Throws:
NamingException

WritableContext

public WritableContext(String nameInNamespace)
                throws NamingException
Throws:
NamingException

WritableContext

public WritableContext(String nameInNamespace,
                       Map bindings)
                throws NamingException
Throws:
NamingException

WritableContext

public WritableContext(String nameInNamespace,
                       Map bindings,
                       boolean cacheReferences)
                throws NamingException
Throws:
NamingException

WritableContext

public WritableContext(String nameInNamespace,
                       Map bindings,
                       ContextAccess contextAccess)
                throws NamingException
Throws:
NamingException

WritableContext

public WritableContext(String nameInNamespace,
                       Map bindings,
                       ContextAccess contextAccess,
                       boolean cacheReferences)
                throws NamingException
Throws:
NamingException
Method Detail

addBinding

protected boolean addBinding(String name,
                             Object value,
                             boolean rebind)
                      throws NamingException
Overrides:
addBinding in class AbstractFederatedContext
Throws:
NamingException

addBinding

protected void addBinding(AtomicReference bindingsRef,
                          String name,
                          String nameInNamespace,
                          Object value,
                          boolean rebind)
                   throws NamingException
Throws:
NamingException

removeBinding

protected boolean removeBinding(String name,
                                boolean removeNotEmptyContext)
                         throws NamingException
Description copied from class: AbstractContext
Removes the binding from the context. The name will not contain a path and the value will not be a nested context although it may be a foreign context.

Overrides:
removeBinding in class AbstractFederatedContext
Parameters:
name - name under which the value should be bound
Throws:
NamingException - if a problem occurs during the bind such as a value already being bound

createNestedSubcontext

public Context createNestedSubcontext(String path,
                                      Map bindings)
                               throws NamingException
Description copied from interface: NestedContextFactory
Creates a nested subcontext instance. This does not cause the nested context to be bound.

Parameters:
path - the path to the new nested context
bindings - the initial bindings for the context
Returns:
the new nested context
Throws:
NamingException

getDeepBinding

protected Object getDeepBinding(String name)
Description copied from class: AbstractContext
Gets the object bound to the name. The name may contain slashes.

Overrides:
getDeepBinding in class AbstractContext
Parameters:
name - the name
Returns:
the object bound to the name, or null if not found

getWrapperBindings

protected Map getWrapperBindings()
                          throws NamingException
Specified by:
getWrapperBindings in class AbstractFederatedContext
Throws:
NamingException


Copyright © 2005-2011 Apache Software Foundation. All Rights Reserved.