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
ConstructorsConstructorDescriptionDelegatingContext(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 voidvoidvoidvoidclose()composeName(String name, String prefix) composeName(Name name, Name prefix) createSubcontext(String name) createSubcontext(Name name) voiddestroySubcontext(String name) voiddestroySubcontext(Name name) booleanHashtable<?,?> Recursivley inspect delegates until a non-delegating context is found.getNameParser(String name) getNameParser(Name name) inthashCode()listBindings(String name) listBindings(Name name) lookupLink(String name) lookupLink(Name name) voidvoidremoveFromEnvironment(String propName) voidvoidtoString()voidvoid
-
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:
addToEnvironmentin interfaceContext- Throws:
NamingException- See Also:
-
bind
- Specified by:
bindin interfaceContext- Throws:
NamingException- See Also:
-
bind
- Specified by:
bindin interfaceContext- Throws:
NamingException- See Also:
-
close
- Specified by:
closein interfaceContext- Throws:
NamingException- See Also:
-
composeName
- Specified by:
composeNamein interfaceContext- Throws:
NamingException- See Also:
-
composeName
- Specified by:
composeNamein interfaceContext- Throws:
NamingException- See Also:
-
createSubcontext
- Specified by:
createSubcontextin interfaceContext- Throws:
NamingException- See Also:
-
createSubcontext
- Specified by:
createSubcontextin interfaceContext- Throws:
NamingException- See Also:
-
destroySubcontext
- Specified by:
destroySubcontextin interfaceContext- Throws:
NamingException- See Also:
-
destroySubcontext
- Specified by:
destroySubcontextin interfaceContext- Throws:
NamingException- See Also:
-
getEnvironment
- Specified by:
getEnvironmentin interfaceContext- Throws:
NamingException- See Also:
-
getNameInNamespace
- Specified by:
getNameInNamespacein interfaceContext- Throws:
NamingException- See Also:
-
getNameParser
- Specified by:
getNameParserin interfaceContext- Throws:
NamingException- See Also:
-
getNameParser
- Specified by:
getNameParserin interfaceContext- Throws:
NamingException- See Also:
-
list
- Specified by:
listin interfaceContext- Throws:
NamingException- See Also:
-
list
- Specified by:
listin interfaceContext- Throws:
NamingException- See Also:
-
listBindings
- Specified by:
listBindingsin interfaceContext- Throws:
NamingException- See Also:
-
listBindings
- Specified by:
listBindingsin interfaceContext- Throws:
NamingException- See Also:
-
lookup
- Specified by:
lookupin interfaceContext- Throws:
NamingException- See Also:
-
lookup
- Specified by:
lookupin interfaceContext- Throws:
NamingException- See Also:
-
lookupLink
- Specified by:
lookupLinkin interfaceContext- Throws:
NamingException- See Also:
-
lookupLink
- Specified by:
lookupLinkin interfaceContext- Throws:
NamingException- See Also:
-
rebind
- Specified by:
rebindin interfaceContext- Throws:
NamingException- See Also:
-
rebind
- Specified by:
rebindin interfaceContext- Throws:
NamingException- See Also:
-
removeFromEnvironment
- Specified by:
removeFromEnvironmentin interfaceContext- Throws:
NamingException- See Also:
-
rename
- Specified by:
renamein interfaceContext- Throws:
NamingException- See Also:
-
rename
- Specified by:
renamein interfaceContext- Throws:
NamingException- See Also:
-
unbind
- Specified by:
unbindin interfaceContext- Throws:
NamingException- See Also:
-
unbind
- Specified by:
unbindin interfaceContext- Throws:
NamingException- See Also:
-