Package org.springframework.ldap.pool2
Class DelegatingContext
java.lang.Object
org.springframework.ldap.pool2.DelegatingContext
- All Implemented Interfaces:
Context
- Direct Known Subclasses:
DelegatingDirContext
Used by
PooledContextSource
to wrap a Context
, delegating most methods
to the underlying context, retains a reference to the pool the context was checked out
from and returns itself to the pool when close()
is called.- Since:
- 2.0
-
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
ConstructorDescriptionDelegatingContext
(org.apache.commons.pool2.KeyedObjectPool<Object, Object> keyedObjectPool, Context delegateContext, DirContextType dirContextType) Create a new delegating context for the specified pool, context and context type. -
Method Summary
Modifier and TypeMethodDescriptionaddToEnvironment
(String propName, Object propVal) protected void
void
void
void
close()
composeName
(String name, String prefix) composeName
(Name name, Name prefix) createSubcontext
(String name) createSubcontext
(Name name) void
destroySubcontext
(String name) void
destroySubcontext
(Name name) boolean
Hashtable<?,
?> Recursivley inspect delegates until a non-delegating context is found.getNameParser
(String name) getNameParser
(Name name) int
hashCode()
listBindings
(String name) listBindings
(Name name) lookupLink
(String name) lookupLink
(Name name) void
void
removeFromEnvironment
(String propName) void
void
toString()
void
void
-
Constructor Details
-
DelegatingContext
public DelegatingContext(org.apache.commons.pool2.KeyedObjectPool<Object, Object> keyedObjectPool, Context delegateContext, DirContextType dirContextType) Create a new delegating context for the specified pool, context and context type.- Parameters:
keyedObjectPool
- The pool the delegate context was checked out from.delegateContext
- The context to delegate operations to.dirContextType
- The type of context, used as a key for the pool.- Throws:
IllegalArgumentException
- if any of the arguments are null
-
-
Method Details
-
getDelegateContext
- Returns:
- The direct delegate for this context proxy
-
getInnermostDelegateContext
Recursivley inspect delegates until a non-delegating context is found.- Returns:
- The innermost (real) Context that is being delegated to.
-
assertOpen
- Throws:
NamingException
- If the delegate is null,close()
has been called.
-
equals
-
hashCode
public int hashCode() -
toString
-
addToEnvironment
- Specified by:
addToEnvironment
in interfaceContext
- Throws:
NamingException
- See Also:
-
bind
- Specified by:
bind
in interfaceContext
- Throws:
NamingException
- See Also:
-
bind
- Specified by:
bind
in interfaceContext
- Throws:
NamingException
- See Also:
-
close
- Specified by:
close
in interfaceContext
- Throws:
NamingException
- See Also:
-
composeName
- Specified by:
composeName
in interfaceContext
- Throws:
NamingException
- See Also:
-
composeName
- Specified by:
composeName
in interfaceContext
- Throws:
NamingException
- See Also:
-
createSubcontext
- Specified by:
createSubcontext
in interfaceContext
- Throws:
NamingException
- See Also:
-
createSubcontext
- Specified by:
createSubcontext
in interfaceContext
- Throws:
NamingException
- See Also:
-
destroySubcontext
- Specified by:
destroySubcontext
in interfaceContext
- Throws:
NamingException
- See Also:
-
destroySubcontext
- Specified by:
destroySubcontext
in interfaceContext
- Throws:
NamingException
- See Also:
-
getEnvironment
- Specified by:
getEnvironment
in interfaceContext
- Throws:
NamingException
- See Also:
-
getNameInNamespace
- Specified by:
getNameInNamespace
in interfaceContext
- Throws:
NamingException
- See Also:
-
getNameParser
- Specified by:
getNameParser
in interfaceContext
- Throws:
NamingException
- See Also:
-
getNameParser
- Specified by:
getNameParser
in interfaceContext
- Throws:
NamingException
- See Also:
-
list
- Specified by:
list
in interfaceContext
- Throws:
NamingException
- See Also:
-
list
- Specified by:
list
in interfaceContext
- Throws:
NamingException
- See Also:
-
listBindings
- Specified by:
listBindings
in interfaceContext
- Throws:
NamingException
- See Also:
-
listBindings
- Specified by:
listBindings
in interfaceContext
- Throws:
NamingException
- See Also:
-
lookup
- Specified by:
lookup
in interfaceContext
- Throws:
NamingException
- See Also:
-
lookup
- Specified by:
lookup
in interfaceContext
- Throws:
NamingException
- See Also:
-
lookupLink
- Specified by:
lookupLink
in interfaceContext
- Throws:
NamingException
- See Also:
-
lookupLink
- Specified by:
lookupLink
in interfaceContext
- Throws:
NamingException
- See Also:
-
rebind
- Specified by:
rebind
in interfaceContext
- Throws:
NamingException
- See Also:
-
rebind
- Specified by:
rebind
in interfaceContext
- Throws:
NamingException
- See Also:
-
removeFromEnvironment
- Specified by:
removeFromEnvironment
in interfaceContext
- Throws:
NamingException
- See Also:
-
rename
- Specified by:
rename
in interfaceContext
- Throws:
NamingException
- See Also:
-
rename
- Specified by:
rename
in interfaceContext
- Throws:
NamingException
- See Also:
-
unbind
- Specified by:
unbind
in interfaceContext
- Throws:
NamingException
- See Also:
-
unbind
- Specified by:
unbind
in interfaceContext
- Throws:
NamingException
- See Also:
-