Package org.eclipse.jetty.client
Class RoundRobinConnectionPool
- java.lang.Object
-
- org.eclipse.jetty.client.AbstractConnectionPool
-
- org.eclipse.jetty.client.RoundRobinConnectionPool
-
- All Implemented Interfaces:
java.io.Closeable,java.lang.AutoCloseable,ConnectionPool,ConnectionPool.Multiplexable,Dumpable
@ManagedObject public class RoundRobinConnectionPool extends AbstractConnectionPool implements ConnectionPool.Multiplexable
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.eclipse.jetty.client.ConnectionPool
ConnectionPool.Factory, ConnectionPool.Multiplexable
-
-
Constructor Summary
Constructors Constructor Description RoundRobinConnectionPool(Destination destination, int maxConnections, Callback requester)RoundRobinConnectionPool(Destination destination, int maxConnections, Callback requester, int maxMultiplex)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddump(java.lang.Appendable out, java.lang.String indent)Dump this object (and children) into an Appendable using the provided indent after any new lines.intgetMaxMultiplex()booleanisActive(Connection connection)booleanrelease(Connection connection)Returns the given connection, previously obtained viaConnectionPool.acquire(), back to this ConnectionPool.booleanremove(Connection connection)Removes the given connection from this ConnectionPool.voidsetMaxMultiplex(int maxMultiplex)java.lang.StringtoString()-
Methods inherited from class org.eclipse.jetty.client.AbstractConnectionPool
acquire, close, dump, getConnectionCount, getMaxConnectionCount, getPendingConnectionCount, getPendingCount, isClosed, isEmpty
-
-
-
-
Constructor Detail
-
RoundRobinConnectionPool
public RoundRobinConnectionPool(Destination destination, int maxConnections, Callback requester)
-
RoundRobinConnectionPool
public RoundRobinConnectionPool(Destination destination, int maxConnections, Callback requester, int maxMultiplex)
-
-
Method Detail
-
getMaxMultiplex
public int getMaxMultiplex()
- Specified by:
getMaxMultiplexin interfaceConnectionPool.Multiplexable- Returns:
- the max number of requests multiplexable on a single connection
-
setMaxMultiplex
public void setMaxMultiplex(int maxMultiplex)
- Specified by:
setMaxMultiplexin interfaceConnectionPool.Multiplexable- Parameters:
maxMultiplex- the max number of requests multiplexable on a single connection
-
isActive
public boolean isActive(Connection connection)
- Specified by:
isActivein interfaceConnectionPool- 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:ConnectionPoolReturns the given connection, previously obtained via
ConnectionPool.acquire(), back to this ConnectionPool.- Specified by:
releasein interfaceConnectionPool- 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:ConnectionPoolRemoves the given connection from this ConnectionPool.
- Specified by:
removein interfaceConnectionPool- 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.IOExceptionDescription copied from interface:DumpableDump 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.
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-