public class MultiplexConnectionPool extends AbstractConnectionPool implements ConnectionPool.Multiplexable, Sweeper.Sweepable
ConnectionPool.Factory, ConnectionPool.Multiplexable| Constructor and Description |
|---|
MultiplexConnectionPool(HttpDestination destination,
int maxConnections,
Callback requester,
int maxMultiplex) |
| Modifier and Type | Method and Description |
|---|---|
Connection |
acquire()
Returns an idle connection, if available, or schedules the opening
of a new connection and returns
null. |
void |
close()
Closes this ConnectionPool.
|
void |
dump(Appendable out,
String indent)
Dump this object (and children) into an Appendable using the provided indent after any new lines.
|
int |
getMaxMultiplex() |
boolean |
isActive(Connection connection) |
boolean |
release(Connection connection)
Returns the given connection, previously obtained via
ConnectionPool.acquire(),
back to this ConnectionPool. |
boolean |
remove(Connection connection)
Removes the given connection from this ConnectionPool.
|
void |
setMaxMultiplex(int maxMultiplex) |
boolean |
sweep() |
String |
toString() |
dump, getConnectionCount, getMaxConnectionCount, getPendingConnectionCount, getPendingCount, isClosed, isEmptyequals, getClass, hashCode, notify, notifyAll, wait, wait, waitdump, dumpContainer, dumpIterable, dumpMapEntries, dumpObject, dumpObjects, dumpSelf, namedpublic MultiplexConnectionPool(HttpDestination destination, int maxConnections, Callback requester, int maxMultiplex)
public Connection acquire()
ConnectionPoolReturns an idle connection, if available, or schedules the opening
of a new connection and returns null.
acquire in interface ConnectionPoolacquire in class AbstractConnectionPoolpublic int getMaxMultiplex()
getMaxMultiplex in interface ConnectionPool.Multiplexablepublic void setMaxMultiplex(int maxMultiplex)
setMaxMultiplex in interface ConnectionPool.MultiplexablemaxMultiplex - the max number of requests multiplexable on a single connectionpublic boolean isActive(Connection connection)
isActive in interface ConnectionPoolconnection - the connection to testpublic boolean release(Connection connection)
ConnectionPoolReturns the given connection, previously obtained via ConnectionPool.acquire(),
back to this ConnectionPool.
release in interface ConnectionPoolconnection - the connection to releasepublic boolean remove(Connection connection)
ConnectionPoolRemoves the given connection from this ConnectionPool.
remove in interface ConnectionPoolconnection - the connection to removepublic void close()
ConnectionPoolclose in interface Closeableclose in interface AutoCloseableclose in interface ConnectionPoolclose in class AbstractConnectionPoolConnectionPool.isClosed()public void dump(Appendable out, String indent) throws IOException
Dumpabledump in interface Dumpableout - The appendable to dump toindent - The indent to apply after any new lines.IOException - if unable to write to Appendablepublic boolean sweep()
sweep in interface Sweeper.SweepableCopyright © 2010 - 2020 Adobe. All Rights Reserved