Class SharedConnectionPool

  • All Implemented Interfaces:
    Closeable, AutoCloseable, ConnectionPool, LdapClient

    public final class SharedConnectionPool
    extends Object
    implements ConnectionPool
    A connection pool implementation for shared connections. A shared connection may run multiple requests concurrently at any time. For that reason a shared connection cannot be used to process a BIND request because a BIND request requires exclusive access to the connection. To process the BIND operations use the CachedConnectionPool class instead.
    This connection pool can sustain high throughput because multiple requests may run concurrently on the same connection allowing multiple requests to be packed in the same TCP PDU.
    • Constructor Detail

      • SharedConnectionPool

        public SharedConnectionPool​(LdapClient client,
                                    int poolSize)
        Creates a shared connection pool.
        Parameters:
        client - the LDAP client connection factory
        poolSize - the pool size
    • Method Detail

      • close

        public void close()
        Description copied from interface: ConnectionPool
        Releases any resources associated with this connection pool. Pooled connections will be permanently closed and this connection pool will no longer be available for use.

        Attempts to use this connection pool after it has been closed will result in an IllegalStateException.

        Calling close on a connection pool which is already closed has no effect.

        Specified by:
        close in interface AutoCloseable
        Specified by:
        close in interface Closeable
        Specified by:
        close in interface ConnectionPool
        Specified by:
        close in interface LdapClient