com.netflix.http4
Class NamedConnectionPool
java.lang.Object
org.apache.http.impl.conn.tsccm.AbstractConnPool
org.apache.http.impl.conn.tsccm.ConnPoolByRoute
com.netflix.http4.NamedConnectionPool
public class NamedConnectionPool
- extends org.apache.http.impl.conn.tsccm.ConnPoolByRoute
A connection pool that provides Servo counters to monitor the efficiency.
Three counters are provided: counter for getting free entries (or reusing entries),
counter for creating new entries, and counter for every connection request.
| Fields inherited from class org.apache.http.impl.conn.tsccm.ConnPoolByRoute |
connPerRoute, freeConnections, leasedConnections, maxTotalConnections, numConnections, operator, routeToPool, shutdown, waitingThreads |
| Fields inherited from class org.apache.http.impl.conn.tsccm.AbstractConnPool |
idleConnHandler, isShutDown, issuedConnections, refQueue |
|
Constructor Summary |
NamedConnectionPool(java.lang.String name,
org.apache.http.conn.ClientConnectionOperator operator,
org.apache.http.conn.params.ConnPerRoute connPerRoute,
int maxTotalConnections)
|
NamedConnectionPool(java.lang.String name,
org.apache.http.conn.ClientConnectionOperator operator,
org.apache.http.conn.params.ConnPerRoute connPerRoute,
int maxTotalConnections,
long connTTL,
java.util.concurrent.TimeUnit connTTLTimeUnit)
|
NamedConnectionPool(java.lang.String name,
org.apache.http.conn.ClientConnectionOperator operator,
org.apache.http.params.HttpParams params)
|
|
Method Summary |
protected org.apache.http.impl.conn.tsccm.BasicPoolEntry |
createEntry(org.apache.http.impl.conn.tsccm.RouteSpecificPool rospl,
org.apache.http.conn.ClientConnectionOperator op)
|
protected void |
deleteEntry(org.apache.http.impl.conn.tsccm.BasicPoolEntry entry)
|
void |
freeEntry(org.apache.http.impl.conn.tsccm.BasicPoolEntry entry,
boolean reusable,
long validDuration,
java.util.concurrent.TimeUnit timeUnit)
|
int |
getConnectionCount()
|
long |
getCreatedEntryCount()
|
long |
getDeleteCount()
|
protected org.apache.http.impl.conn.tsccm.BasicPoolEntry |
getEntryBlocking(org.apache.http.conn.routing.HttpRoute route,
java.lang.Object state,
long timeout,
java.util.concurrent.TimeUnit tunit,
org.apache.http.impl.conn.tsccm.WaitingThreadAborter aborter)
|
protected org.apache.http.impl.conn.tsccm.BasicPoolEntry |
getFreeEntry(org.apache.http.impl.conn.tsccm.RouteSpecificPool rospl,
java.lang.Object state)
|
long |
getFreeEntryCount()
|
long |
getReleaseCount()
|
long |
getRequestsCount()
|
org.apache.http.impl.conn.tsccm.PoolEntryRequest |
requestPoolEntry(org.apache.http.conn.routing.HttpRoute route,
java.lang.Object state)
|
| Methods inherited from class org.apache.http.impl.conn.tsccm.ConnPoolByRoute |
closeExpiredConnections, closeIdleConnections, createFreeConnQueue, createRouteToPoolMap, createWaitingThreadQueue, deleteClosedConnections, deleteLeastUsedEntry, getConnectionsInPool, getConnectionsInPool, getLock, getMaxTotalConnections, getRoutePool, handleLostEntry, newRouteSpecificPool, newWaitingThread, notifyWaitingThread, setMaxTotalConnections, shutdown |
| Methods inherited from class org.apache.http.impl.conn.tsccm.AbstractConnPool |
closeConnection, enableConnectionGC, getEntry, handleReference |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
NamedConnectionPool
public NamedConnectionPool(java.lang.String name,
org.apache.http.conn.ClientConnectionOperator operator,
org.apache.http.conn.params.ConnPerRoute connPerRoute,
int maxTotalConnections,
long connTTL,
java.util.concurrent.TimeUnit connTTLTimeUnit)
NamedConnectionPool
public NamedConnectionPool(java.lang.String name,
org.apache.http.conn.ClientConnectionOperator operator,
org.apache.http.conn.params.ConnPerRoute connPerRoute,
int maxTotalConnections)
NamedConnectionPool
public NamedConnectionPool(java.lang.String name,
org.apache.http.conn.ClientConnectionOperator operator,
org.apache.http.params.HttpParams params)
requestPoolEntry
public org.apache.http.impl.conn.tsccm.PoolEntryRequest requestPoolEntry(org.apache.http.conn.routing.HttpRoute route,
java.lang.Object state)
- Overrides:
requestPoolEntry in class org.apache.http.impl.conn.tsccm.ConnPoolByRoute
getFreeEntry
protected org.apache.http.impl.conn.tsccm.BasicPoolEntry getFreeEntry(org.apache.http.impl.conn.tsccm.RouteSpecificPool rospl,
java.lang.Object state)
- Overrides:
getFreeEntry in class org.apache.http.impl.conn.tsccm.ConnPoolByRoute
createEntry
protected org.apache.http.impl.conn.tsccm.BasicPoolEntry createEntry(org.apache.http.impl.conn.tsccm.RouteSpecificPool rospl,
org.apache.http.conn.ClientConnectionOperator op)
- Overrides:
createEntry in class org.apache.http.impl.conn.tsccm.ConnPoolByRoute
getEntryBlocking
protected org.apache.http.impl.conn.tsccm.BasicPoolEntry getEntryBlocking(org.apache.http.conn.routing.HttpRoute route,
java.lang.Object state,
long timeout,
java.util.concurrent.TimeUnit tunit,
org.apache.http.impl.conn.tsccm.WaitingThreadAborter aborter)
throws org.apache.http.conn.ConnectionPoolTimeoutException,
java.lang.InterruptedException
- Overrides:
getEntryBlocking in class org.apache.http.impl.conn.tsccm.ConnPoolByRoute
- Throws:
org.apache.http.conn.ConnectionPoolTimeoutException
java.lang.InterruptedException
freeEntry
public void freeEntry(org.apache.http.impl.conn.tsccm.BasicPoolEntry entry,
boolean reusable,
long validDuration,
java.util.concurrent.TimeUnit timeUnit)
- Overrides:
freeEntry in class org.apache.http.impl.conn.tsccm.ConnPoolByRoute
deleteEntry
protected void deleteEntry(org.apache.http.impl.conn.tsccm.BasicPoolEntry entry)
- Overrides:
deleteEntry in class org.apache.http.impl.conn.tsccm.ConnPoolByRoute
getFreeEntryCount
public final long getFreeEntryCount()
getCreatedEntryCount
public final long getCreatedEntryCount()
getRequestsCount
public final long getRequestsCount()
getReleaseCount
public final long getReleaseCount()
getDeleteCount
public final long getDeleteCount()
getConnectionCount
@Monitor(name="connectionCount",
type=GAUGE)
public int getConnectionCount()