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:
Serializable,Context,NestedContextFactory
- Version:
- $Rev: 417891 $ $Date: 2006-06-28 15:45:07 -0700 (Wed, 28 Jun 2006) $
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionfinal classNested 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
ConstructorsConstructorDescriptionImmutableContext(String nameInNamespace, Map<String, Object> bindings, boolean cacheReferences) ImmutableContext(Map<String, Object> bindings) ImmutableContext(Map<String, Object> bindings, boolean cacheReferences) -
Method Summary
Modifier and TypeMethodDescriptionprotected final booleanaddBinding(String name, Object value, boolean rebind) protected final voidaddDeepBinding(String name, Object value, boolean createIntermediateContexts) createNestedSubcontext(String path, Map bindings) Creates a nested subcontext instance.Gets a map of the bindings for the current node (i.e., no names with slashes).protected ObjectgetDeepBinding(String name) Gets the object bound to the name.booleanisNestedSubcontext(Object value) Is the specified value an instance of a nested contextprotected final booleanremoveBinding(String name, boolean removeNotEmptyContext) Removes the binding from the context.protected final voidremoveDeepBinding(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 Details
-
ImmutableContext
- Throws:
NamingException
-
ImmutableContext
public ImmutableContext(Map<String, Object> bindings, boolean cacheReferences) throws NamingException- Throws:
NamingException
-
ImmutableContext
public ImmutableContext(String nameInNamespace, Map<String, Object> bindings, boolean cacheReferences) throws NamingException- Throws:
NamingException
-
-
Method Details
-
getDeepBinding
Description copied from class:AbstractContextGets the object bound to the name. The name may contain slashes.- Overrides:
getDeepBindingin classAbstractContext- Parameters:
name- the name- Returns:
- the object bound to the name, or null if not found
-
getBindings
Description copied from class:AbstractContextGets a map of the bindings for the current node (i.e., no names with slashes). This method must not return null.- Specified by:
getBindingsin classAbstractContext- Returns:
- a Map from binding name to binding value
-
addDeepBinding
protected final void addDeepBinding(String name, Object value, boolean createIntermediateContexts) throws NamingException - Throws:
NamingException
-
addBinding
protected final boolean addBinding(String name, Object value, boolean rebind) throws NamingException - Specified by:
addBindingin classAbstractContext- Throws:
NamingException
-
removeDeepBinding
protected final void removeDeepBinding(Name name, boolean pruneEmptyContexts) throws NamingException - Overrides:
removeDeepBindingin classAbstractContext- Throws:
NamingException
-
removeBinding
protected final boolean removeBinding(String name, boolean removeNotEmptyContext) throws NamingException Description copied from class:AbstractContextRemoves 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:
removeBindingin classAbstractContext- Parameters:
name- name under which the value should be boundremoveNotEmptyContext- ??? TODO figure this out- Returns:
- whether removal was successful
- Throws:
NamingException- if a problem occurs during the bind such as a value already being bound
-
isNestedSubcontext
Description copied from interface:NestedContextFactoryIs 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
Description copied from interface:NestedContextFactoryCreates 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
-