Package org.apache.xbean.naming.context
Class WritableContext
java.lang.Object
org.apache.xbean.naming.context.AbstractContext
org.apache.xbean.naming.context.AbstractFederatedContext
org.apache.xbean.naming.context.WritableContext
- All Implemented Interfaces:
Serializable
,Context
,NestedContextFactory
- Version:
- $Rev$ $Date$
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionclass
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
ConstructorsConstructorDescriptionWritableContext
(String nameInNamespace) WritableContext
(String nameInNamespace, Map<String, Object> bindings) WritableContext
(String nameInNamespace, Map<String, Object> bindings, boolean cacheReferences) WritableContext
(String nameInNamespace, Map<String, Object> bindings, ContextAccess contextAccess) WritableContext
(String nameInNamespace, Map<String, Object> bindings, ContextAccess contextAccess, boolean cacheReferences) WritableContext
(String nameInNamespace, Map<String, Object> bindings, ContextAccess contextAccess, boolean cacheReferences, boolean supportReferenceable, boolean checkDereferenceDifferent, boolean assumeDereferenceBound) -
Method Summary
Modifier and TypeMethodDescriptionprotected boolean
addBinding
(String name, Object value, boolean rebind) protected void
addBinding
(AtomicReference<Map<String, Object>> bindingsRef, String name, String nameInNamespace, Object value, boolean rebind) createNestedSubcontext
(String path, Map<String, Object> bindings) Creates a nested subcontext instance.protected Object
getDeepBinding
(String name) Gets the object bound to the name.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, getBindings, getMasterContext, isNestedSubcontext, removeFederatedContext
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
-
Constructor Details
-
WritableContext
- Throws:
NamingException
-
WritableContext
- Throws:
NamingException
-
WritableContext
- Throws:
NamingException
-
WritableContext
public WritableContext(String nameInNamespace, Map<String, Object> bindings, boolean cacheReferences) throws NamingException- Throws:
NamingException
-
WritableContext
public WritableContext(String nameInNamespace, Map<String, Object> bindings, ContextAccess contextAccess) throws NamingException- Throws:
NamingException
-
WritableContext
public WritableContext(String nameInNamespace, Map<String, Object> bindings, ContextAccess contextAccess, boolean cacheReferences) throws NamingException- Throws:
NamingException
-
WritableContext
public WritableContext(String nameInNamespace, Map<String, Object> bindings, ContextAccess contextAccess, boolean cacheReferences, boolean supportReferenceable, boolean checkDereferenceDifferent, boolean assumeDereferenceBound) throws NamingException- Throws:
NamingException
-
-
Method Details
-
addBinding
- Overrides:
addBinding
in classAbstractFederatedContext
- Throws:
NamingException
-
addBinding
protected void addBinding(AtomicReference<Map<String, Object>> bindingsRef, String name, String nameInNamespace, Object value, boolean rebind) throws NamingException- Throws:
NamingException
-
removeBinding
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 classAbstractFederatedContext
- 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
-
createNestedSubcontext
public Context createNestedSubcontext(String path, Map<String, Object> bindings) throws NamingExceptionDescription 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
- Throws:
NamingException
- on error
-
getDeepBinding
Description copied from class:AbstractContext
Gets the object bound to the name. The name may contain slashes.- Overrides:
getDeepBinding
in classAbstractFederatedContext
- Parameters:
name
- the name- Returns:
- the object bound to the name, or null if not found
-
getWrapperBindings
- Specified by:
getWrapperBindings
in classAbstractFederatedContext
- Throws:
NamingException
-