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 Context
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 voidAssert that the delegate context is still open.voidvoidvoidclose()composeName(String name, String prefix) composeName(Name name, Name prefix) createSubcontext(String name) createSubcontext(Name name) voiddestroySubcontext(String name) voiddestroySubcontext(Name name) boolean@Nullable ContextGet the direct delegate for this context proxy.Hashtable<?, ?> @Nullable ContextRecursivley 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
Get the direct delegate for this context proxy.- 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
Assert that the delegate context is still open.- Throws:
NamingException- If the delegate is null,close()has been called.
-
equals
-
hashCode
-
toString
-
addToEnvironment
- Specified by:
addToEnvironmentin interfaceContext- Throws:
NamingException
-
bind
- Specified by:
bindin interfaceContext- Throws:
NamingException
-
bind
- Specified by:
bindin interfaceContext- Throws:
NamingException
-
close
- Specified by:
closein interfaceContext- Throws:
NamingException
-
composeName
- Specified by:
composeNamein interfaceContext- Throws:
NamingException
-
composeName
- Specified by:
composeNamein interfaceContext- Throws:
NamingException
-
createSubcontext
- Specified by:
createSubcontextin interfaceContext- Throws:
NamingException
-
createSubcontext
- Specified by:
createSubcontextin interfaceContext- Throws:
NamingException
-
destroySubcontext
- Specified by:
destroySubcontextin interfaceContext- Throws:
NamingException
-
destroySubcontext
- Specified by:
destroySubcontextin interfaceContext- Throws:
NamingException
-
getEnvironment
- Specified by:
getEnvironmentin interfaceContext- Throws:
NamingException
-
getNameInNamespace
- Specified by:
getNameInNamespacein interfaceContext- Throws:
NamingException
-
getNameParser
- Specified by:
getNameParserin interfaceContext- Throws:
NamingException
-
getNameParser
- Specified by:
getNameParserin interfaceContext- Throws:
NamingException
-
list
- Specified by:
listin interfaceContext- Throws:
NamingException
-
list
- Specified by:
listin interfaceContext- Throws:
NamingException
-
listBindings
- Specified by:
listBindingsin interfaceContext- Throws:
NamingException
-
listBindings
- Specified by:
listBindingsin interfaceContext- Throws:
NamingException
-
lookup
- Specified by:
lookupin interfaceContext- Throws:
NamingException
-
lookup
- Specified by:
lookupin interfaceContext- Throws:
NamingException
-
lookupLink
- Specified by:
lookupLinkin interfaceContext- Throws:
NamingException
-
lookupLink
- Specified by:
lookupLinkin interfaceContext- Throws:
NamingException
-
rebind
- Specified by:
rebindin interfaceContext- Throws:
NamingException
-
rebind
- Specified by:
rebindin interfaceContext- Throws:
NamingException
-
removeFromEnvironment
- Specified by:
removeFromEnvironmentin interfaceContext- Throws:
NamingException
-
rename
- Specified by:
renamein interfaceContext- Throws:
NamingException
-
rename
- Specified by:
renamein interfaceContext- Throws:
NamingException
-
unbind
- Specified by:
unbindin interfaceContext- Throws:
NamingException
-
unbind
- Specified by:
unbindin interfaceContext- Throws:
NamingException
-