Class UnboundLdapConnectionPool

  • All Implemented Interfaces:
    Closeable, 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

        abandonedConfig, 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, borrowObject, clear, close, evict, getFactory, getFactoryType, getMaxIdle, getMinIdle, getNumActive, getNumIdle, getNumWaiters, invalidateObject, invalidateObject, listAllObjects, preparePool, returnObject, setConfig, setMaxIdle, setMinIdle, toStringAppendFields, use
      • Methods inherited from class org.apache.commons.pool2.impl.BaseGenericObjectPool

        getBlockWhenExhausted, getBorrowedCount, getCreatedCount, getCreationStackTrace, getDestroyedByBorrowValidationCount, getDestroyedByEvictorCount, getDestroyedCount, getDurationBetweenEvictionRuns, getEvictionPolicy, getEvictionPolicyClassName, getEvictorShutdownTimeout, getEvictorShutdownTimeoutDuration, getEvictorShutdownTimeoutMillis, getFairness, getJmxName, getLifo, getLogAbandoned, getMaxBorrowWaitDuration, getMaxBorrowWaitTimeMillis, getMaxTotal, getMaxWaitDuration, getMaxWaitMillis, getMeanActiveDuration, getMeanActiveTimeMillis, getMeanBorrowWaitDuration, getMeanBorrowWaitTimeMillis, getMeanIdleDuration, getMeanIdleTimeMillis, getMessageStatistics, getMinEvictableIdleDuration, getMinEvictableIdleTime, getMinEvictableIdleTimeMillis, getNumTestsPerEvictionRun, getRemoveAbandonedOnBorrow, getRemoveAbandonedOnMaintenance, getRemoveAbandonedTimeout, getRemoveAbandonedTimeoutDuration, getReturnedCount, getSoftMinEvictableIdleDuration, getSoftMinEvictableIdleTime, getSoftMinEvictableIdleTimeMillis, getSwallowedExceptionListener, getTestOnBorrow, getTestOnCreate, getTestOnReturn, getTestWhileIdle, getTimeBetweenEvictionRuns, getTimeBetweenEvictionRunsMillis, isAbandonedConfig, isClosed, markReturningState, setAbandonedConfig, setBlockWhenExhausted, setConfig, setDurationBetweenEvictionRuns, setEvictionPolicy, setEvictionPolicyClassName, setEvictionPolicyClassName, setEvictorShutdownTimeout, setEvictorShutdownTimeoutMillis, setLifo, setMaxTotal, setMaxWait, setMaxWaitMillis, setMessagesStatistics, setMinEvictableIdle, setMinEvictableIdleDuration, setMinEvictableIdleTime, setMinEvictableIdleTimeMillis, setNumTestsPerEvictionRun, setSoftMinEvictableIdle, setSoftMinEvictableIdleDuration, setSoftMinEvictableIdleTime, setSoftMinEvictableIdleTimeMillis, setSwallowedExceptionListener, setTestOnBorrow, setTestOnCreate, setTestOnReturn, setTestWhileIdle, setTimeBetweenEvictionRuns, setTimeBetweenEvictionRunsMillis
      • Methods inherited from class org.apache.commons.pool2.BaseObject

        toString
      • Methods inherited from interface org.apache.commons.pool2.impl.GenericObjectPoolMXBean

        getBlockWhenExhausted, getBorrowedCount, getCreatedCount, getCreationStackTrace, getDestroyedByBorrowValidationCount, getDestroyedByEvictorCount, getDestroyedCount, getFairness, getLifo, getLogAbandoned, getMaxBorrowWaitTimeMillis, getMaxTotal, getMaxWaitMillis, getMeanActiveTimeMillis, getMeanBorrowWaitTimeMillis, getMeanIdleTimeMillis, getMinEvictableIdleTimeMillis, getNumTestsPerEvictionRun, getRemoveAbandonedOnBorrow, getRemoveAbandonedOnMaintenance, getRemoveAbandonedTimeout, getReturnedCount, getTestOnBorrow, getTestOnCreate, getTestOnReturn, getTestWhileIdle, getTimeBetweenEvictionRunsMillis, isAbandonedConfig, 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 Exception
        Gives a Unbound LdapConnection fetched from the pool.
        Returns:
        an LdapConnection object from pool
        Throws:
        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 Exception
        Places the given LdapConnection back in the pool.
        Parameters:
        connection - the LdapConnection to be released
        Throws:
        Exception - if an error occurs while releasing the connection