Class MultiplexConnectionPool

    • Constructor Detail

      • MultiplexConnectionPool

        public MultiplexConnectionPool​(HttpDestination destination,
                                       int maxConnections,
                                       Callback requester,
                                       int maxMultiplex)
    • Method Detail

      • setMaxMultiplex

        public void setMaxMultiplex​(int maxMultiplex)
        Specified by:
        setMaxMultiplex in interface ConnectionPool.Multiplexable
        Parameters:
        maxMultiplex - the max number of requests multiplexable on a single connection
      • isActive

        public boolean isActive​(Connection connection)
        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)
        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)
        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
      • dump

        public void dump​(java.lang.Appendable out,
                         java.lang.String indent)
                  throws java.io.IOException
        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
        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()
        Specified by:
        sweep in interface Sweeper.Sweepable
        Returns:
        whether this resource should be swept
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object