Package org.apache.http.impl.conn.tsccm
Class ConnPoolByRoute
java.lang.Object
org.apache.http.impl.conn.tsccm.AbstractConnPool
org.apache.http.impl.conn.tsccm.ConnPoolByRoute
Deprecated.
A connection pool that maintains connections by route.
This class is derived from
MultiThreadedHttpConnectionManager
in HttpClient 3.x, see there for original authors. It implements the same
algorithm for connection re-use and connection-per-host enforcement:
- connections are re-used only for the exact same route
- connection limits are enforced per route rather than per host
poolLock in the base class,
not via synchronized methods.- Since:
- 4.0
-
Constructor Summary
ConstructorsConstructorDescriptionConnPoolByRoute(ClientConnectionOperator operator, ConnPerRoute connPerRoute, int maxTotalConnections) Deprecated.Creates a new connection pool, managed by route.ConnPoolByRoute(ClientConnectionOperator operator, ConnPerRoute connPerRoute, int maxTotalConnections, long connTTL, TimeUnit connTTLTimeUnit) Deprecated.ConnPoolByRoute(ClientConnectionOperator operator, HttpParams params) Deprecated. -
Method Summary
Modifier and TypeMethodDescriptionvoidDeprecated.voidcloseIdleConnections(long idletime, TimeUnit timeUnit) Deprecated.Closes idle connections.voidDeprecated.Deletes all entries for closed connections.voidfreeEntry(BasicPoolEntry entry, boolean reusable, long validDuration, TimeUnit timeUnit) Deprecated.Returns an entry into the pool.intDeprecated.intgetConnectionsInPool(HttpRoute route) Deprecated.intDeprecated.since 4.1requestPoolEntry(HttpRoute route, Object state) Deprecated.Returns a newPoolEntryRequest, from which aBasicPoolEntrycan be obtained, or the request can be aborted.voidsetMaxTotalConnections(int max) Deprecated.since 4.1voidshutdown()Deprecated.Shuts down this pool and all associated resources.Methods inherited from class org.apache.http.impl.conn.tsccm.AbstractConnPool
enableConnectionGC, getEntry, handleReference
-
Constructor Details
-
ConnPoolByRoute
public ConnPoolByRoute(ClientConnectionOperator operator, ConnPerRoute connPerRoute, int maxTotalConnections) Deprecated.Creates a new connection pool, managed by route.- Since:
- 4.1
-
ConnPoolByRoute
public ConnPoolByRoute(ClientConnectionOperator operator, ConnPerRoute connPerRoute, int maxTotalConnections, long connTTL, TimeUnit connTTLTimeUnit) Deprecated.- Since:
- 4.1
-
ConnPoolByRoute
Deprecated.Creates a new connection pool, managed by route.
-
-
Method Details
-
getConnectionsInPool
Deprecated. -
getConnectionsInPool
public int getConnectionsInPool()Deprecated. -
requestPoolEntry
Deprecated.Description copied from class:AbstractConnPoolReturns a newPoolEntryRequest, from which aBasicPoolEntrycan be obtained, or the request can be aborted.- Specified by:
requestPoolEntryin classAbstractConnPool- Parameters:
route- the routestate- the state- Returns:
- the entry request
-
freeEntry
public void freeEntry(BasicPoolEntry entry, boolean reusable, long validDuration, TimeUnit timeUnit) Deprecated.Description copied from class:AbstractConnPoolReturns an entry into the pool. The connection of the entry is expected to be in a suitable state, either open and re-usable, or closed. The pool will not make any attempt to determine whether it can be re-used or not.- Specified by:
freeEntryin classAbstractConnPool- Parameters:
entry- the entry for the connection to releasereusable-trueif the entry is deemed reusable,falseotherwise.validDuration- The duration that the entry should remain free and reusable.timeUnit- The unit of time the duration is measured in.
-
deleteClosedConnections
public void deleteClosedConnections()Deprecated.Description copied from class:AbstractConnPoolDeletes all entries for closed connections.- Specified by:
deleteClosedConnectionsin classAbstractConnPool
-
closeIdleConnections
Deprecated.Closes idle connections.- Overrides:
closeIdleConnectionsin classAbstractConnPool- Parameters:
idletime- the time the connections should have been idle in order to be closed nowtimeUnit- the unit for theidletime
-
closeExpiredConnections
public void closeExpiredConnections()Deprecated.- Overrides:
closeExpiredConnectionsin classAbstractConnPool
-
shutdown
public void shutdown()Deprecated.Description copied from class:AbstractConnPoolShuts down this pool and all associated resources. Overriding methods MUST call the implementation here!- Overrides:
shutdownin classAbstractConnPool
-
setMaxTotalConnections
public void setMaxTotalConnections(int max) Deprecated.since 4.1 -
getMaxTotalConnections
public int getMaxTotalConnections()Deprecated.since 4.1
-
AbstractConnPool