|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectedu.vt.middleware.ldap.pool.AbstractLdapPool<Ldap>
edu.vt.middleware.ldap.pool.BlockingLdapPool
public class BlockingLdapPool
BlockingLdapPool implements a pool of ldap objects that has a
set minimum and maximum size. The pool will not grow beyond the maximum size
and when the pool is exhausted, requests for new objects will block. The
length of time the pool will block is determined by getBlockWaitTime(). By default the pool will block indefinitely and there
is no guarantee that waiting threads will be serviced in the order in which
they made their request. This implementation should be used when you need to
control the exact number of ldap connections that can be created.
See AbstractLdapPool.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class edu.vt.middleware.ldap.pool.AbstractLdapPool |
|---|
AbstractLdapPool.PooledLdap<T extends BaseLdap> |
| Field Summary |
|---|
| Fields inherited from class edu.vt.middleware.ldap.pool.AbstractLdapPool |
|---|
active, available, checkInLock, checkOutLock, ldapFactory, logger, poolConfig, poolLock, poolNotEmpty |
| Constructor Summary | |
|---|---|
BlockingLdapPool()
Creates a new ldap pool using DefaultLdapFactory. |
|
BlockingLdapPool(LdapFactory<Ldap> lf)
Creates a new ldap pool with the supplied ldap factory. |
|
BlockingLdapPool(LdapPoolConfig lpc,
LdapFactory<Ldap> lf)
Creates a new ldap pool with the supplied ldap config and factory. |
|
| Method Summary | |
|---|---|
protected Ldap |
blockAvailable()
This blocks until an ldap object can be aquired. |
void |
checkIn(Ldap l)
Returns an ldap object to the pool. |
Ldap |
checkOut()
Returns an ldap object from the pool. |
long |
getBlockWaitTime()
Returns the block wait time. |
protected Ldap |
retrieveAvailable()
This attempts to retrieve an ldap object from the available queue. |
void |
setBlockWaitTime(long time)
Sets the block wait time. |
| Methods inherited from class edu.vt.middleware.ldap.pool.AbstractLdapPool |
|---|
activateAndValidate, activeCount, availableCount, close, createActive, createAvailable, createAvailableAndActive, finalize, getLdapPoolConfig, initialize, prune, removeActive, removeAvailable, removeAvailableAndActive, setPoolTimer, validate, validateAndPassivate |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public BlockingLdapPool()
DefaultLdapFactory.
public BlockingLdapPool(LdapFactory<Ldap> lf)
lf - ldap factory
public BlockingLdapPool(LdapPoolConfig lpc,
LdapFactory<Ldap> lf)
lpc - ldap pool configurationlf - ldap factory| Method Detail |
|---|
public long getBlockWaitTime()
public void setBlockWaitTime(long time)
time - in milliseconds to wait for available ldap objects
public Ldap checkOut()
throws LdapPoolException
LdapPoolException - if this operation fails
BlockingTimeoutException - if this pool is configured with a block
time and it occurs
PoolInterruptedException - if this pool is configured with a block
time and the current thread is interruptedprotected Ldap retrieveAvailable()
NoSuchElementException - if the available queue is empty
protected Ldap blockAvailable()
throws LdapPoolException
LdapPoolException - if this method fails
BlockingTimeoutException - if this pool is configured with a block
time and it occurs
PoolInterruptedException - if the current thread is interruptedpublic void checkIn(Ldap l)
l - ldap object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||