- java.lang.Object
-
- org.eclipse.jetty.client.AbstractConnectionPool
-
- org.eclipse.jetty.client.MultiplexConnectionPool
-
- All Implemented Interfaces:
java.io.Closeable,java.lang.AutoCloseable,ConnectionPool,ConnectionPool.Multiplexable,org.eclipse.jetty.util.component.Dumpable,org.eclipse.jetty.util.thread.Sweeper.Sweepable
public class MultiplexConnectionPool extends AbstractConnectionPool implements ConnectionPool.Multiplexable, org.eclipse.jetty.util.thread.Sweeper.Sweepable
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.eclipse.jetty.client.ConnectionPool
ConnectionPool.Factory, ConnectionPool.Multiplexable
-
-
Constructor Summary
Constructors Constructor Description MultiplexConnectionPool(HttpDestination destination, int maxConnections, org.eclipse.jetty.util.Callback requester, int maxMultiplex)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanaccept(Connection connection)Accepts the given connection to be managed by this ConnectionPool.Connectionacquire()Returns an idle connection, if available, or schedules the opening of a new connection and returnsnull.protected Connectionactivate()voidclose()voiddump(java.lang.Appendable out, java.lang.String indent)intgetMaxMultiplex()booleanisActive(Connection connection)protected voidonCreated(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.protected booleanremove(Connection connection, boolean force)voidsetMaxMultiplex(int maxMultiplex)booleansweep()java.lang.StringtoString()-
Methods inherited from class org.eclipse.jetty.client.AbstractConnectionPool
acquired, active, close, dump, getConnectionCount, getMaxConnectionCount, getPendingConnectionCount, idle, isClosed, isEmpty, proceed, released, removed, tryCreate
-
-
-
-
Constructor Detail
-
MultiplexConnectionPool
public MultiplexConnectionPool(HttpDestination destination, int maxConnections, org.eclipse.jetty.util.Callback requester, int maxMultiplex)
-
-
Method Detail
-
acquire
public Connection acquire()
Description copied from interface:ConnectionPoolReturns an idle connection, if available, or schedules the opening of a new connection and returns
null.- Specified by:
acquirein interfaceConnectionPool- Overrides:
acquirein classAbstractConnectionPool- Returns:
- an available connection, or null
-
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
-
accept
public boolean accept(Connection connection)
Description copied from interface:ConnectionPoolAccepts the given connection to be managed by this ConnectionPool.
- Specified by:
acceptin interfaceConnectionPool- Overrides:
acceptin classAbstractConnectionPool- Parameters:
connection- the connection to accept- Returns:
- whether the connection has been accepted
-
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
-
onCreated
protected void onCreated(Connection connection)
- Specified by:
onCreatedin classAbstractConnectionPool
-
activate
protected Connection activate()
- Specified by:
activatein classAbstractConnectionPool
-
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
-
remove
protected boolean remove(Connection connection, boolean force)
-
close
public void close()
- Specified by:
closein interfacejava.lang.AutoCloseable- Specified by:
closein interfacejava.io.Closeable- Specified by:
closein interfaceConnectionPool- Overrides:
closein classAbstractConnectionPool
-
dump
public void dump(java.lang.Appendable out, java.lang.String indent) throws java.io.IOException- Specified by:
dumpin interfaceorg.eclipse.jetty.util.component.Dumpable- Throws:
java.io.IOException
-
sweep
public boolean sweep()
- Specified by:
sweepin interfaceorg.eclipse.jetty.util.thread.Sweeper.Sweepable
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-