Package org.apache.xbean.naming.context
Class ImmutableContext
- java.lang.Object
-
- org.apache.xbean.naming.context.AbstractContext
-
- org.apache.xbean.naming.context.ImmutableContext
-
- All Implemented Interfaces:
java.io.Serializable
,javax.naming.Context
,NestedContextFactory
public class ImmutableContext extends AbstractContext
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description class
ImmutableContext.NestedImmutableContext
Nested context which shares the absolute index map in MapContext.
-
Constructor Summary
Constructors Constructor Description ImmutableContext(java.lang.String nameInNamespace, java.util.Map<java.lang.String,java.lang.Object> bindings, boolean cacheReferences)
ImmutableContext(java.util.Map<java.lang.String,java.lang.Object> bindings)
ImmutableContext(java.util.Map<java.lang.String,java.lang.Object> bindings, boolean cacheReferences)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected boolean
addBinding(java.lang.String name, java.lang.Object value, boolean rebind)
protected void
addDeepBinding(java.lang.String name, java.lang.Object value, boolean createIntermediateContexts)
javax.naming.Context
createNestedSubcontext(java.lang.String path, java.util.Map bindings)
Creates a nested subcontext instance.protected java.util.Map<java.lang.String,java.lang.Object>
getBindings()
Gets a map of the bindings for the current node (i.e., no names with slashes).protected java.lang.Object
getDeepBinding(java.lang.String name)
Gets the object bound to the name.boolean
isNestedSubcontext(java.lang.Object value)
Is the specified value an instance of a nested contextprotected boolean
removeBinding(java.lang.String name, boolean removeNotEmptyContext)
Removes the binding from the context.protected void
removeDeepBinding(javax.naming.Name name, boolean pruneEmptyContexts)
-
Methods inherited from class org.apache.xbean.naming.context.AbstractContext
addBinding, addDeepBinding, addToEnvironment, bind, bind, close, composeName, composeName, createSubcontext, createSubcontext, createSubcontextTree, destroySubcontext, destroySubcontext, faultLookup, getBinding, 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, removeFromEnvironment, rename, rename, unbind, unbind
-
-
-
-
Constructor Detail
-
ImmutableContext
public ImmutableContext(java.util.Map<java.lang.String,java.lang.Object> bindings) throws javax.naming.NamingException
- Throws:
javax.naming.NamingException
-
ImmutableContext
public ImmutableContext(java.util.Map<java.lang.String,java.lang.Object> bindings, boolean cacheReferences) throws javax.naming.NamingException
- Throws:
javax.naming.NamingException
-
ImmutableContext
public ImmutableContext(java.lang.String nameInNamespace, java.util.Map<java.lang.String,java.lang.Object> bindings, boolean cacheReferences) throws javax.naming.NamingException
- Throws:
javax.naming.NamingException
-
-
Method Detail
-
getDeepBinding
protected java.lang.Object getDeepBinding(java.lang.String name)
Description copied from class:AbstractContext
Gets the object bound to the name. The name may contain slashes.- Overrides:
getDeepBinding
in classAbstractContext
- Parameters:
name
- the name- Returns:
- the object bound to the name, or null if not found
-
getBindings
protected java.util.Map<java.lang.String,java.lang.Object> getBindings()
Description copied from class:AbstractContext
Gets a map of the bindings for the current node (i.e., no names with slashes). This method must not return null.- Specified by:
getBindings
in classAbstractContext
- Returns:
- a Map from binding name to binding value
-
addDeepBinding
protected final void addDeepBinding(java.lang.String name, java.lang.Object value, boolean createIntermediateContexts) throws javax.naming.NamingException
- Throws:
javax.naming.NamingException
-
addBinding
protected final boolean addBinding(java.lang.String name, java.lang.Object value, boolean rebind) throws javax.naming.NamingException
- Specified by:
addBinding
in classAbstractContext
- Throws:
javax.naming.NamingException
-
removeDeepBinding
protected final void removeDeepBinding(javax.naming.Name name, boolean pruneEmptyContexts) throws javax.naming.NamingException
- Overrides:
removeDeepBinding
in classAbstractContext
- Throws:
javax.naming.NamingException
-
removeBinding
protected final boolean removeBinding(java.lang.String name, boolean removeNotEmptyContext) throws javax.naming.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.- Specified by:
removeBinding
in classAbstractContext
- Parameters:
name
- name under which the value should be boundremoveNotEmptyContext
- ??? TODO figure this out- Returns:
- whether removal was successful
- Throws:
javax.naming.NamingException
- if a problem occurs during the bind such as a value already being bound
-
isNestedSubcontext
public boolean isNestedSubcontext(java.lang.Object value)
Description copied from interface:NestedContextFactory
Is the specified value an instance of a nested context- Parameters:
value
- the value to inspect- Returns:
- true if the specified value an instance of a nested context; false otherwise
-
createNestedSubcontext
public javax.naming.Context createNestedSubcontext(java.lang.String path, java.util.Map bindings)
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 contextbindings
- the initial bindings for the context- Returns:
- the new nested context
-
-