|
Spring LDAP | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object 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:
Field Summary | |
---|---|
protected GenericKeyedObjectPool |
keyedObjectPool
|
protected Log |
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. |
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 |
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 java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected final Log logger
protected final 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 destroy() throws Exception
destroy
in interface DisposableBean
Exception
public DirContext getReadOnlyContext() throws NamingException
ContextSource
DirContext
. The returned
DirContext
must be possible to perform read-only operations
on.
getReadOnlyContext
in interface ContextSource
NamingException
- if some error occurs creating an DirContext.public DirContext getReadWriteContext() throws NamingException
ContextSource
DirContext
instance.
getReadWriteContext
in interface ContextSource
DirContext
instance, never null
.
NamingException
- if some error occurs creating an
DirContext
.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) throws NamingException
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
.
NamingException
|
Spring LDAP | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |