Interface ConnectionPoolEventListener

  • All Superinterfaces:
    EventListener

    public interface ConnectionPoolEventListener
    extends EventListener
    An object that registers to be notified when a connection pool grows or shrinks.

    NOTE 1: Since listeners are prone to race conditions they should only be used for monitoring and alerts. Specifically, an application should not use this mechanism to deduce whether a request can be sent or not. It should send the request and hope for the best.

    NOTE 2: connection pool implementations must ensure that only one event is sent at a time. Event listener implementations should not need to be thread safe unless there are (re-)used by multiple connection pools.

    See Also:
    LdapClients.CONNECTION_POOL_EVENT_LISTENER
    • Method Detail

      • handlePoolGrowing

        void handlePoolGrowing​(ConnectionPool connectionPool)
        Invoked when the connection pool is growing, i.e. the number of connections in the pool is about to be increased by one.
        Parameters:
        connectionPool - The connection pool which is growing.
      • handlePoolShrinking

        void handlePoolShrinking​(ConnectionPool connectionPool)
        Invoked when the connection pool is shrinking, i.e. the number of connections in the pool is about to be decreased by one.
        Parameters:
        connectionPool - The connection pool which is shrinking.