|
Spring LDAP | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.springframework.ldap.core.support.DelegatingBaseLdapPathContextSourceSupport
org.springframework.ldap.pool.factory.PoolingContextSource
public class PoolingContextSource
A ContextSource
implementation that wraps an object pool and another
ContextSource
. DirContext
s are retrieved from the pool which
maintains them.
Configuration:
Property | Description | Required | Default |
---|---|---|---|
contextSource |
The ContextSource to get DirContext s from for adding to the
pool. |
Yes | null |
dirContextValidator |
The DirContextValidator to use for validating DirContext s.
Required if any of the test/validate options are enabled. |
No | null |
minIdle | GenericKeyedObjectPool.setMinIdle(int) |
No | 0 |
maxIdle | GenericKeyedObjectPool.setMaxIdle(int) |
No | 8 |
maxActive | GenericKeyedObjectPool.setMaxActive(int) |
No | 8 |
maxTotal | GenericKeyedObjectPool.setMaxTotal(int) |
No | -1 |
maxWait | GenericKeyedObjectPool.setMaxWait(long) |
No | -1L |
whenExhaustedAction | GenericKeyedObjectPool.setWhenExhaustedAction(byte) |
No | GenericKeyedObjectPool.WHEN_EXHAUSTED_BLOCK |
testOnBorrow | GenericKeyedObjectPool.setTestOnBorrow(boolean) |
No | false |
testOnReturn | GenericKeyedObjectPool.setTestOnReturn(boolean) |
No | false |
testWhileIdle | GenericKeyedObjectPool.setTestWhileIdle(boolean) |
No | false |
timeBetweenEvictionRunsMillis |
GenericKeyedObjectPool.setTimeBetweenEvictionRunsMillis(long) |
No | -1L |
minEvictableIdleTimeMillis |
GenericKeyedObjectPool.setMinEvictableIdleTimeMillis(long) |
No | 1000L * 60L * 30L |
numTestsPerEvictionRun |
GenericKeyedObjectPool.setNumTestsPerEvictionRun(int) |
No | 3 |
Field Summary | |
---|---|
protected org.apache.commons.pool.impl.GenericKeyedObjectPool |
keyedObjectPool
|
protected org.slf4j.Logger |
logger
The logger for this class and sub-classes |
Constructor Summary | |
---|---|
PoolingContextSource()
Creates a new pooling context source, setting up the DirContext object factory and generic keyed object pool. |
Method Summary | |
---|---|
void |
destroy()
|
protected DirContext |
getContext(DirContextType dirContextType)
Gets a DirContext of the specified type from the keyed object pool. |
DirContext |
getContext(String principal,
String credentials)
Gets a DirContext instance authenticated using the supplied
principal and credentials. |
ContextSource |
getContextSource()
|
DirContextValidator |
getDirContextValidator()
|
int |
getMaxActive()
|
int |
getMaxIdle()
|
int |
getMaxTotal()
|
long |
getMaxWait()
|
long |
getMinEvictableIdleTimeMillis()
|
int |
getMinIdle()
|
int |
getNumActive()
|
int |
getNumIdle()
|
int |
getNumTestsPerEvictionRun()
|
DirContext |
getReadOnlyContext()
Gets a read-only DirContext . |
DirContext |
getReadWriteContext()
Gets a read-write DirContext instance. |
protected ContextSource |
getTarget()
Get the target ContextSource. |
boolean |
getTestOnBorrow()
|
boolean |
getTestOnReturn()
|
boolean |
getTestWhileIdle()
|
long |
getTimeBetweenEvictionRunsMillis()
|
byte |
getWhenExhaustedAction()
|
void |
setContextSource(ContextSource contextSource)
|
void |
setDirContextValidator(DirContextValidator dirContextValidator)
|
void |
setMaxActive(int maxActive)
|
void |
setMaxIdle(int maxIdle)
|
void |
setMaxTotal(int maxTotal)
|
void |
setMaxWait(long maxWait)
|
void |
setMinEvictableIdleTimeMillis(long minEvictableIdleTimeMillis)
|
void |
setMinIdle(int poolSize)
|
void |
setNonTransientExceptions(Collection<Class<? extends Throwable>> nonTransientExceptions)
Configure the exception classes that are to be interpreted as no-transient with regards to eager context invalidation. |
void |
setNumTestsPerEvictionRun(int numTestsPerEvictionRun)
|
void |
setTestOnBorrow(boolean testOnBorrow)
|
void |
setTestOnReturn(boolean testOnReturn)
|
void |
setTestWhileIdle(boolean testWhileIdle)
|
void |
setTimeBetweenEvictionRunsMillis(long timeBetweenEvictionRunsMillis)
|
void |
setWhenExhaustedAction(byte whenExhaustedAction)
|
Methods inherited from class org.springframework.ldap.core.support.DelegatingBaseLdapPathContextSourceSupport |
---|
getBaseLdapName, getBaseLdapPath, getBaseLdapPathAsString |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected final org.slf4j.Logger logger
protected final org.apache.commons.pool.impl.GenericKeyedObjectPool keyedObjectPool
Constructor Detail |
---|
public PoolingContextSource()
Method Detail |
---|
public int getMaxActive()
GenericKeyedObjectPool.getMaxActive()
public int getMaxIdle()
GenericKeyedObjectPool.getMaxIdle()
public int getMaxTotal()
GenericKeyedObjectPool.getMaxTotal()
public long getMaxWait()
GenericKeyedObjectPool.getMaxWait()
public long getMinEvictableIdleTimeMillis()
GenericKeyedObjectPool.getMinEvictableIdleTimeMillis()
public int getMinIdle()
GenericKeyedObjectPool.getMinIdle()
public int getNumActive()
GenericKeyedObjectPool.getNumActive()
public int getNumIdle()
GenericKeyedObjectPool.getNumIdle()
public int getNumTestsPerEvictionRun()
GenericKeyedObjectPool.getNumTestsPerEvictionRun()
public boolean getTestOnBorrow()
GenericKeyedObjectPool.getTestOnBorrow()
public boolean getTestOnReturn()
GenericKeyedObjectPool.getTestOnReturn()
public boolean getTestWhileIdle()
GenericKeyedObjectPool.getTestWhileIdle()
public long getTimeBetweenEvictionRunsMillis()
GenericKeyedObjectPool.getTimeBetweenEvictionRunsMillis()
public byte getWhenExhaustedAction()
GenericKeyedObjectPool.getWhenExhaustedAction()
public void setMaxActive(int maxActive)
GenericKeyedObjectPool.setMaxActive(int)
public void setMaxIdle(int maxIdle)
GenericKeyedObjectPool.setMaxIdle(int)
public void setMaxTotal(int maxTotal)
GenericKeyedObjectPool.setMaxTotal(int)
public void setMaxWait(long maxWait)
GenericKeyedObjectPool.setMaxWait(long)
public void setMinEvictableIdleTimeMillis(long minEvictableIdleTimeMillis)
GenericKeyedObjectPool.setMinEvictableIdleTimeMillis(long)
public void setMinIdle(int poolSize)
GenericKeyedObjectPool.setMinIdle(int)
public void setNumTestsPerEvictionRun(int numTestsPerEvictionRun)
GenericKeyedObjectPool.setNumTestsPerEvictionRun(int)
public void setTestOnBorrow(boolean testOnBorrow)
GenericKeyedObjectPool.setTestOnBorrow(boolean)
public void setTestOnReturn(boolean testOnReturn)
GenericKeyedObjectPool.setTestOnReturn(boolean)
public void setTestWhileIdle(boolean testWhileIdle)
GenericKeyedObjectPool.setTestWhileIdle(boolean)
public void setTimeBetweenEvictionRunsMillis(long timeBetweenEvictionRunsMillis)
GenericKeyedObjectPool.setTimeBetweenEvictionRunsMillis(long)
public void setWhenExhaustedAction(byte whenExhaustedAction)
GenericKeyedObjectPool.setWhenExhaustedAction(byte)
public ContextSource getContextSource()
public DirContextValidator getDirContextValidator()
public void setContextSource(ContextSource contextSource)
contextSource
- the contextSource to set
Requiredpublic void setDirContextValidator(DirContextValidator dirContextValidator)
dirContextValidator
- the dirContextValidator to set
Requiredpublic void setNonTransientExceptions(Collection<Class<? extends Throwable>> nonTransientExceptions)
CommunicationException
.
nonTransientExceptions
- the exception classes that should be interpreted as non-transient
with regards to eager invalidation.public void destroy() throws Exception
destroy
in interface DisposableBean
Exception
protected ContextSource getTarget()
DelegatingBaseLdapPathContextSourceSupport
getTarget
in class DelegatingBaseLdapPathContextSourceSupport
public DirContext getReadOnlyContext()
ContextSource
DirContext
. The returned
DirContext
must be possible to perform read-only operations
on.
getReadOnlyContext
in interface ContextSource
public DirContext getReadWriteContext()
ContextSource
DirContext
instance.
getReadWriteContext
in interface ContextSource
DirContext
instance, never null
.protected DirContext getContext(DirContextType dirContextType)
dirContextType
- The type of context to return.
DataAccessResourceFailureException
- If retrieving the object from
the pool throws an exceptionpublic DirContext getContext(String principal, String credentials)
ContextSource
DirContext
instance authenticated using the supplied
principal and credentials. Typically to be used for plain authentication
purposes. Note that this method will never make use
of native Java LDAP pooling, even though this instance is configured to do so.
This is to force password changes in the target directory to take effect
as soon as possible.
getContext
in interface ContextSource
principal
- The principal (typically a distinguished name of a user
in the LDAP tree) to use for authentication.credentials
- The credentials to use for authentication.
DirContext
instance, never
null
.
|
Spring LDAP | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |