Package org.apache.http.impl.conn
Class CPool
- java.lang.Object
-
- org.apache.http.pool.AbstractConnPool<HttpRoute,ManagedHttpClientConnection,CPoolEntry>
-
- org.apache.http.impl.conn.CPool
-
- All Implemented Interfaces:
org.apache.http.pool.ConnPool<HttpRoute,CPoolEntry>
,org.apache.http.pool.ConnPoolControl<HttpRoute>
@Contract(threading=SAFE) class CPool extends org.apache.http.pool.AbstractConnPool<HttpRoute,ManagedHttpClientConnection,CPoolEntry>
- Since:
- 4.3
-
-
Field Summary
Fields Modifier and Type Field Description private static java.util.concurrent.atomic.AtomicLong
COUNTER
private org.apache.commons.logging.Log
log
private long
timeToLive
private java.util.concurrent.TimeUnit
timeUnit
-
Constructor Summary
Constructors Constructor Description CPool(org.apache.http.pool.ConnFactory<HttpRoute,ManagedHttpClientConnection> connFactory, int defaultMaxPerRoute, int maxTotal, long timeToLive, java.util.concurrent.TimeUnit timeUnit)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected CPoolEntry
createEntry(HttpRoute route, ManagedHttpClientConnection conn)
protected void
enumAvailable(org.apache.http.pool.PoolEntryCallback<HttpRoute,ManagedHttpClientConnection> callback)
protected void
enumLeased(org.apache.http.pool.PoolEntryCallback<HttpRoute,ManagedHttpClientConnection> callback)
protected boolean
validate(CPoolEntry entry)
-
Methods inherited from class org.apache.http.pool.AbstractConnPool
closeExpired, closeIdle, getDefaultMaxPerRoute, getMaxPerRoute, getMaxTotal, getRoutes, getStats, getTotalStats, getValidateAfterInactivity, isShutdown, lease, lease, onLease, onRelease, onReuse, release, setDefaultMaxPerRoute, setMaxPerRoute, setMaxTotal, setValidateAfterInactivity, shutdown, toString
-
-
-
-
Constructor Detail
-
CPool
public CPool(org.apache.http.pool.ConnFactory<HttpRoute,ManagedHttpClientConnection> connFactory, int defaultMaxPerRoute, int maxTotal, long timeToLive, java.util.concurrent.TimeUnit timeUnit)
-
-
Method Detail
-
createEntry
protected CPoolEntry createEntry(HttpRoute route, ManagedHttpClientConnection conn)
- Specified by:
createEntry
in classorg.apache.http.pool.AbstractConnPool<HttpRoute,ManagedHttpClientConnection,CPoolEntry>
-
validate
protected boolean validate(CPoolEntry entry)
- Overrides:
validate
in classorg.apache.http.pool.AbstractConnPool<HttpRoute,ManagedHttpClientConnection,CPoolEntry>
-
enumAvailable
protected void enumAvailable(org.apache.http.pool.PoolEntryCallback<HttpRoute,ManagedHttpClientConnection> callback)
- Overrides:
enumAvailable
in classorg.apache.http.pool.AbstractConnPool<HttpRoute,ManagedHttpClientConnection,CPoolEntry>
-
enumLeased
protected void enumLeased(org.apache.http.pool.PoolEntryCallback<HttpRoute,ManagedHttpClientConnection> callback)
- Overrides:
enumLeased
in classorg.apache.http.pool.AbstractConnPool<HttpRoute,ManagedHttpClientConnection,CPoolEntry>
-
-