Class AbstractConnectionPool

    • Method Detail

      • preCreateConnections

        public java.util.concurrent.CompletableFuture<java.lang.Void> preCreateConnections​(int connectionCount)
        Deprecated.
        Description copied from interface: ConnectionPool
        Optionally pre-create up to connectionCount connections so they are immediately ready for use.
        Specified by:
        preCreateConnections in interface ConnectionPool
        Parameters:
        connectionCount - the number of connections to pre-start.
      • getMaxDuration

        @ManagedAttribute("The maximum duration in milliseconds a connection can be used for before it gets closed")
        public long getMaxDuration()
        Deprecated.

        Get the max usage duration in milliseconds of the pool's connections. Values 0 and negative mean that there is no limit.

        This only guarantees that a connection cannot be acquired after the configured duration elapses, so that is only enforced when acquire() is called. If a pool stays completely idle for a duration longer than the value returned by this method, the max duration will not be enforced. It's up to the idle timeout mechanism (see HttpClient.getIdleTimeout()) to handle closing idle connections.

      • setMaxDuration

        public void setMaxDuration​(long maxDurationInMs)
        Deprecated.
      • getActiveConnectionCount

        @ManagedAttribute(value="The number of active connections",
                          readonly=true)
        public int getActiveConnectionCount()
        Deprecated.
      • getPendingConnectionCount

        @ManagedAttribute(value="The number of pending connections",
                          readonly=true)
        public int getPendingConnectionCount()
        Deprecated.
      • isEmpty

        public boolean isEmpty()
        Deprecated.
        Specified by:
        isEmpty in interface ConnectionPool
        Returns:
        whether this ConnectionPool has no open connections
      • isMaximizeConnections

        @ManagedAttribute("Whether the pool tries to maximize the number of connections used")
        public boolean isMaximizeConnections()
        Deprecated.
      • setMaximizeConnections

        public void setMaximizeConnections​(boolean maximizeConnections)
        Deprecated.

        Sets whether the number of connections should be maximized.

        Parameters:
        maximizeConnections - whether the number of connections should be maximized
      • acquire

        public Connection acquire()
        Deprecated.
        Description copied from interface: ConnectionPool

        Returns an idle connection, if available, or schedules the opening of a new connection and returns null.

        Specified by:
        acquire in interface ConnectionPool
        Returns:
        an available connection, or null
      • isActive

        public boolean isActive​(Connection connection)
        Deprecated.
        Specified by:
        isActive in interface ConnectionPool
        Parameters:
        connection - the connection to test
        Returns:
        whether the given connection is currently in use
      • release

        public boolean release​(Connection connection)
        Deprecated.
        Description copied from interface: ConnectionPool

        Returns the given connection, previously obtained via ConnectionPool.acquire(), back to this ConnectionPool.

        Specified by:
        release in interface ConnectionPool
        Parameters:
        connection - the connection to release
        Returns:
        true if the connection has been released, false if the connection should be closed
      • remove

        public boolean remove​(Connection connection)
        Deprecated.
        Description copied from interface: ConnectionPool

        Removes the given connection from this ConnectionPool.

        Specified by:
        remove in interface ConnectionPool
        Parameters:
        connection - the connection to remove
        Returns:
        true if the connection was removed from this ConnectionPool
      • getIdleConnections

        @Deprecated
        public java.util.Queue<Connection> getIdleConnections()
        Deprecated.
        Relying on this method indicates a reliance on the implementation details.
        Returns:
        an unmodifiable queue working as a view of the idle connections.
      • getActiveConnections

        @Deprecated
        public java.util.Collection<Connection> getActiveConnections()
        Deprecated.
        Relying on this method indicates a reliance on the implementation details.
        Returns:
        an unmodifiable collection working as a view of the active connections.
      • close

        public void close()
        Deprecated.
        Description copied from interface: ConnectionPool
        Closes this ConnectionPool.
        Specified by:
        close in interface java.lang.AutoCloseable
        Specified by:
        close in interface java.io.Closeable
        Specified by:
        close in interface ConnectionPool
        See Also:
        ConnectionPool.isClosed()
      • dump

        public void dump​(java.lang.Appendable out,
                         java.lang.String indent)
                  throws java.io.IOException
        Deprecated.
        Description copied from interface: Dumpable
        Dump this object (and children) into an Appendable using the provided indent after any new lines. The indent should not be applied to the first object dumped.
        Specified by:
        dump in interface Dumpable
        Overrides:
        dump in class ContainerLifeCycle
        Parameters:
        out - The appendable to dump to
        indent - The indent to apply after any new lines.
        Throws:
        java.io.IOException - if unable to write to Appendable
      • sweep

        public boolean sweep()
        Deprecated.
        Specified by:
        sweep in interface Sweeper.Sweepable
        Returns:
        whether this resource should be swept