Class BlockingConnectionPool

  • All Implemented Interfaces:
    ConnectionPool
    Direct Known Subclasses:
    PooledConnectionFactory

    public class BlockingConnectionPool
    extends AbstractConnectionPool
    Implements a pool of connections 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 connections will block. The length of time the pool will block is determined by getBlockWaitTime(). By default the pool will block for 1 minute 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 connections that can be created. See AbstractConnectionPool.
    • Field Detail

      • blockWaitTime

        private Duration blockWaitTime
        Duration to wait for an available connection.
    • Constructor Detail

      • BlockingConnectionPool

        public BlockingConnectionPool()
        Creates a new blocking pool.
      • BlockingConnectionPool

        public BlockingConnectionPool​(DefaultConnectionFactory cf)
        Creates a new blocking pool.
        Parameters:
        cf - connection factory