|
|||||||||
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:
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.logging.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 javax.naming.directory.DirContext |
getContext(DirContextType dirContextType)
Gets a DirContext of the specified type from the keyed object pool. |
ContextSource |
getContextSource()
|
DirContextValidator |
getDirContextValidator()
|
int |
getMaxActive()
|
int |
getMaxIdle()
|
int |
getMaxTotal()
|
long |
getMaxWait()
|
long |
getMinEvictableIdleTimeMillis()
|
int |
getMinIdle()
|
int |
getNumActive()
|
int |
getNumIdle()
|
int |
getNumTestsPerEvictionRun()
|
javax.naming.directory.DirContext |
getReadOnlyContext()
Gets a read-only DirContext. |
javax.naming.directory.DirContext |
getReadWriteContext()
Gets a read-write DirContext. |
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 org.apache.commons.logging.Log logger
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 setpublic void setDirContextValidator(DirContextValidator dirContextValidator)
dirContextValidator
- the dirContextValidator to setpublic void destroy() throws java.lang.Exception
destroy
in interface org.springframework.beans.factory.DisposableBean
java.lang.Exception
public javax.naming.directory.DirContext getReadOnlyContext() throws NamingException
ContextSource
getReadOnlyContext
in interface ContextSource
NamingException
- if some error occurs creating an DirContext.public javax.naming.directory.DirContext getReadWriteContext() throws NamingException
ContextSource
getReadWriteContext
in interface ContextSource
NamingException
- if some error occurs creating an DirContext.protected javax.naming.directory.DirContext getContext(DirContextType dirContextType)
dirContextType
- The type of context to return.
org.springframework.dao.DataAccessResourceFailureException
- If retreiving the object from the pool throws an exception
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |