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 public class ConnPoolByRoute extends AbstractConnPool
Deprecated.(4.2) useAbstractConnPool
A connection pool that maintains connections by route. This class is derived fromMultiThreadedHttpConnectionManager
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 viasynchronized
methods.- Since:
- 4.0
-
-
Constructor Summary
Constructors Constructor Description ConnPoolByRoute(ClientConnectionOperator operator, ConnPerRoute connPerRoute, int maxTotalConnections)
Deprecated.Creates a new connection pool, managed by route.ConnPoolByRoute(ClientConnectionOperator operator, ConnPerRoute connPerRoute, int maxTotalConnections, long connTTL, java.util.concurrent.TimeUnit connTTLTimeUnit)
Deprecated.ConnPoolByRoute(ClientConnectionOperator operator, HttpParams params)
Deprecated.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description void
closeExpiredConnections()
Deprecated.void
closeIdleConnections(long idletime, java.util.concurrent.TimeUnit timeUnit)
Deprecated.Closes idle connections.void
deleteClosedConnections()
Deprecated.Deletes all entries for closed connections.void
freeEntry(BasicPoolEntry entry, boolean reusable, long validDuration, java.util.concurrent.TimeUnit timeUnit)
Deprecated.Returns an entry into the pool.int
getConnectionsInPool()
Deprecated.int
getConnectionsInPool(HttpRoute route)
Deprecated.int
getMaxTotalConnections()
Deprecated.since 4.1PoolEntryRequest
requestPoolEntry(HttpRoute route, java.lang.Object state)
Deprecated.Returns a newPoolEntryRequest
, from which aBasicPoolEntry
can be obtained, or the request can be aborted.void
setMaxTotalConnections(int max)
Deprecated.since 4.1void
shutdown()
Deprecated.Shuts down this pool and all associated resources.-
Methods inherited from class org.apache.http.impl.conn.tsccm.AbstractConnPool
enableConnectionGC, getEntry, handleReference
-
-
-
-
Constructor Detail
-
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, java.util.concurrent.TimeUnit connTTLTimeUnit)
Deprecated.- Since:
- 4.1
-
ConnPoolByRoute
@Deprecated public ConnPoolByRoute(ClientConnectionOperator operator, HttpParams params)
Deprecated.Creates a new connection pool, managed by route.
-
-
Method Detail
-
getConnectionsInPool
public int getConnectionsInPool(HttpRoute route)
Deprecated.
-
getConnectionsInPool
public int getConnectionsInPool()
Deprecated.
-
requestPoolEntry
public PoolEntryRequest requestPoolEntry(HttpRoute route, java.lang.Object state)
Deprecated.Description copied from class:AbstractConnPool
Returns a newPoolEntryRequest
, from which aBasicPoolEntry
can be obtained, or the request can be aborted.- Specified by:
requestPoolEntry
in classAbstractConnPool
- Parameters:
route
- the routestate
- the state- Returns:
- the entry request
-
freeEntry
public void freeEntry(BasicPoolEntry entry, boolean reusable, long validDuration, java.util.concurrent.TimeUnit timeUnit)
Deprecated.Description copied from class:AbstractConnPool
Returns 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:
freeEntry
in classAbstractConnPool
- Parameters:
entry
- the entry for the connection to releasereusable
-true
if the entry is deemed reusable,false
otherwise.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:AbstractConnPool
Deletes all entries for closed connections.- Specified by:
deleteClosedConnections
in classAbstractConnPool
-
closeIdleConnections
public void closeIdleConnections(long idletime, java.util.concurrent.TimeUnit timeUnit)
Deprecated.Closes idle connections.- Overrides:
closeIdleConnections
in 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:
closeExpiredConnections
in classAbstractConnPool
-
shutdown
public void shutdown()
Deprecated.Description copied from class:AbstractConnPool
Shuts down this pool and all associated resources. Overriding methods MUST call the implementation here!- Overrides:
shutdown
in classAbstractConnPool
-
setMaxTotalConnections
public void setMaxTotalConnections(int max)
Deprecated.since 4.1
-
getMaxTotalConnections
public int getMaxTotalConnections()
Deprecated.since 4.1
-
-