Class UnboundLdapConnectionPool

  • All Implemented Interfaces:
    java.io.Closeable, java.lang.AutoCloseable, org.apache.commons.pool2.impl.GenericObjectPoolMXBean, org.apache.commons.pool2.ObjectPool<org.apache.directory.ldap.client.api.LdapConnection>, org.apache.commons.pool2.UsageTracking<org.apache.directory.ldap.client.api.LdapConnection>

    public class UnboundLdapConnectionPool
    extends org.apache.commons.pool2.impl.GenericObjectPool<org.apache.directory.ldap.client.api.LdapConnection>
    A pool implementation for LdapConnection objects.

    This class is just a wrapper around the commons GenericObjectPool, and has a more meaningful name to represent the pool type.

    • Field Summary

      • Fields inherited from class org.apache.commons.pool2.impl.BaseGenericObjectPool

        MEAN_TIMING_STATS_CACHE_SIZE
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      org.apache.directory.ldap.client.api.LdapConnection getConnection()
      Gives a Unbound LdapConnection fetched from the pool.
      void releaseConnection​(org.apache.directory.ldap.client.api.LdapConnection connection)
      Places the given LdapConnection back in the pool.
      • Methods inherited from class org.apache.commons.pool2.impl.GenericObjectPool

        addObject, borrowObject, borrowObject, clear, close, evict, getFactory, getFactoryType, getLogAbandoned, getMaxIdle, getMinIdle, getNumActive, getNumIdle, getNumWaiters, getRemoveAbandonedOnBorrow, getRemoveAbandonedOnMaintenance, getRemoveAbandonedTimeout, invalidateObject, isAbandonedConfig, listAllObjects, preparePool, returnObject, setAbandonedConfig, setConfig, setMaxIdle, setMinIdle, toStringAppendFields, use
      • Methods inherited from class org.apache.commons.pool2.impl.BaseGenericObjectPool

        getBlockWhenExhausted, getBorrowedCount, getCreatedCount, getCreationStackTrace, getDestroyedByBorrowValidationCount, getDestroyedByEvictorCount, getDestroyedCount, getEvictionPolicy, getEvictionPolicyClassName, getEvictorShutdownTimeoutMillis, getFairness, getJmxName, getLifo, getMaxBorrowWaitTimeMillis, getMaxTotal, getMaxWaitMillis, getMeanActiveTimeMillis, getMeanBorrowWaitTimeMillis, getMeanIdleTimeMillis, getMinEvictableIdleTimeMillis, getNumTestsPerEvictionRun, getReturnedCount, getSoftMinEvictableIdleTimeMillis, getSwallowedExceptionListener, getTestOnBorrow, getTestOnCreate, getTestOnReturn, getTestWhileIdle, getTimeBetweenEvictionRunsMillis, isClosed, markReturningState, setBlockWhenExhausted, setConfig, setEvictionPolicy, setEvictionPolicyClassName, setEvictionPolicyClassName, setEvictorShutdownTimeoutMillis, setLifo, setMaxTotal, setMaxWaitMillis, setMinEvictableIdleTimeMillis, setNumTestsPerEvictionRun, setSoftMinEvictableIdleTimeMillis, setSwallowedExceptionListener, setTestOnBorrow, setTestOnCreate, setTestOnReturn, setTestWhileIdle, setTimeBetweenEvictionRunsMillis
      • Methods inherited from class org.apache.commons.pool2.BaseObject

        toString
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
      • Methods inherited from interface org.apache.commons.pool2.impl.GenericObjectPoolMXBean

        getBlockWhenExhausted, getBorrowedCount, getCreatedCount, getCreationStackTrace, getDestroyedByBorrowValidationCount, getDestroyedByEvictorCount, getDestroyedCount, getFairness, getLifo, getMaxBorrowWaitTimeMillis, getMaxTotal, getMaxWaitMillis, getMeanActiveTimeMillis, getMeanBorrowWaitTimeMillis, getMeanIdleTimeMillis, getMinEvictableIdleTimeMillis, getNumTestsPerEvictionRun, getReturnedCount, getTestOnBorrow, getTestOnCreate, getTestOnReturn, getTestWhileIdle, getTimeBetweenEvictionRunsMillis, isClosed
      • Methods inherited from interface org.apache.commons.pool2.ObjectPool

        addObjects
    • Constructor Detail

      • UnboundLdapConnectionPool

        public UnboundLdapConnectionPool​(PoolableUnboundConnectionFactory factory)
        Instantiates a new LDAP connection pool.
        Parameters:
        factory - the LDAP connection factory
    • Method Detail

      • getConnection

        public org.apache.directory.ldap.client.api.LdapConnection getConnection()
                                                                          throws java.lang.Exception
        Gives a Unbound LdapConnection fetched from the pool.
        Returns:
        an LdapConnection object from pool
        Throws:
        java.lang.Exception - if an error occurs while obtaining a connection from the factory
      • releaseConnection

        public void releaseConnection​(org.apache.directory.ldap.client.api.LdapConnection connection)
                               throws java.lang.Exception
        Places the given LdapConnection back in the pool.
        Parameters:
        connection - the LdapConnection to be released
        Throws:
        java.lang.Exception - if an error occurs while releasing the connection