Package org.apache.xbean.naming.context
Class AbstractFederatedContext
- java.lang.Object
-
- org.apache.xbean.naming.context.AbstractContext
-
- org.apache.xbean.naming.context.AbstractFederatedContext
-
- All Implemented Interfaces:
java.io.Serializable
,javax.naming.Context
,NestedContextFactory
- Direct Known Subclasses:
ImmutableFederatedContext
,ImmutableFederatedContext.NestedImmutableFederatedContext
,WritableContext
,WritableContext.NestedWritableContext
public abstract class AbstractFederatedContext extends AbstractContext
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description AbstractFederatedContext()
AbstractFederatedContext(java.lang.String nameInNamespace)
AbstractFederatedContext(java.lang.String nameInNamespace, ContextAccess contextAccess)
AbstractFederatedContext(java.lang.String nameInNamespace, ContextAccess contextAccess, java.util.Set<javax.naming.Context> federatedContexts)
AbstractFederatedContext(AbstractFederatedContext masterContext, java.lang.String nameInNamespace)
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected boolean
addBinding(java.lang.String name, java.lang.Object value, boolean rebind)
protected static void
addFederatedContext(AbstractFederatedContext wrappingContext, javax.naming.Context innerContext)
protected java.lang.Object
faultLookup(java.lang.String stringName, javax.naming.Name parsedName)
When a value can not be found within this context, this method is called as a last ditch effort befrore thowing a null pointer exception.protected java.lang.Object
getBinding(java.lang.String name)
Gets the object bound to the name.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.util.Map<java.lang.String,java.lang.Object>
getBindings(java.lang.String name)
protected java.lang.Object
getDeepBinding(java.lang.String name)
Gets the object bound to the name.protected AbstractFederatedContext
getMasterContext()
protected abstract java.util.Map<java.lang.String,java.lang.Object>
getWrapperBindings()
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 static void
removeFederatedContext(AbstractFederatedContext wrappingContext, javax.naming.Context innerContext)
-
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
-
Methods inherited from interface org.apache.xbean.naming.context.NestedContextFactory
createNestedSubcontext
-
-
-
-
Constructor Detail
-
AbstractFederatedContext
public AbstractFederatedContext()
-
AbstractFederatedContext
public AbstractFederatedContext(java.lang.String nameInNamespace)
-
AbstractFederatedContext
public AbstractFederatedContext(java.lang.String nameInNamespace, ContextAccess contextAccess)
-
AbstractFederatedContext
public AbstractFederatedContext(java.lang.String nameInNamespace, ContextAccess contextAccess, java.util.Set<javax.naming.Context> federatedContexts)
-
AbstractFederatedContext
public AbstractFederatedContext(AbstractFederatedContext masterContext, java.lang.String nameInNamespace) throws javax.naming.NamingException
- Throws:
javax.naming.NamingException
-
-
Method Detail
-
faultLookup
protected java.lang.Object faultLookup(java.lang.String stringName, javax.naming.Name parsedName)
Description copied from class:AbstractContext
When a value can not be found within this context, this method is called as a last ditch effort befrore thowing a null pointer exception.- Overrides:
faultLookup
in classAbstractContext
- Parameters:
stringName
- the string version of the name; will not be nullparsedName
- the parsed name; will not be null- Returns:
- the value or null if no fault value could be found
-
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
-
getBinding
protected java.lang.Object getBinding(java.lang.String name) throws javax.naming.NamingException
Description copied from class:AbstractContext
Gets the object bound to the name. The name will not contain slashes.- Overrides:
getBinding
in classAbstractContext
- Parameters:
name
- the name- Returns:
- the object bound to the name, or null if not found
- Throws:
javax.naming.NamingException
- on error
-
getBindings
protected final java.util.Map<java.lang.String,java.lang.Object> getBindings() throws javax.naming.NamingException
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
- Throws:
javax.naming.NamingException
- if a problem occurs while getting the bindigns
-
getBindings
protected final java.util.Map<java.lang.String,java.lang.Object> getBindings(java.lang.String name) throws javax.naming.NamingException
- Throws:
javax.naming.NamingException
-
getWrapperBindings
protected abstract java.util.Map<java.lang.String,java.lang.Object> getWrapperBindings() throws javax.naming.NamingException
- Throws:
javax.naming.NamingException
-
addBinding
protected 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
-
removeBinding
protected 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
-
addFederatedContext
protected static void addFederatedContext(AbstractFederatedContext wrappingContext, javax.naming.Context innerContext) throws javax.naming.NamingException
- Throws:
javax.naming.NamingException
-
removeFederatedContext
protected static void removeFederatedContext(AbstractFederatedContext wrappingContext, javax.naming.Context innerContext) throws javax.naming.NamingException
- Throws:
javax.naming.NamingException
-
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
-
getMasterContext
protected AbstractFederatedContext getMasterContext()
-
-