Deprecated
(4.2) use org.
MultiThreadedHttpConnectionManager
in HttpClient 3.x, see there for original authors. It implements the same
algorithm for connection re-use and connection-per-host enforcement:
poolLock in the base class,
not via synchronized methods.
| Modifier and Type | Field and Description |
|---|---|
| protected final ConnPerRoute | connPerRoute
Connections per route lookup |
| private final long | |
| private final TimeUnit | |
| protected final Queue | freeConnections
The list of free connections |
| protected final Set | leasedConnections
Hides org. |
| private final Log | |
| protected volatile int | |
| protected volatile int | |
| protected final ClientConnectionOperator | operator
Connection operator for this pool |
| private final Lock | |
| protected final Map | routeToPool
Map of route-specific pools |
| protected volatile boolean | |
| protected final Queue | waitingThreads
The list of WaitingThreads waiting for a connection |
| Access | Constructor and Description |
|---|---|
| public | ConnPoolByRoute(final ClientConnectionOperator operator, final ConnPerRoute connPerRoute, final int maxTotalConnections)
Deprecated
as a consequence of
Creates a new connection pool, managed by route.
ClientConnectionOperator and ConnPerRoute being deprecated.
|
| public | ConnPoolByRoute(final ClientConnectionOperator operator, final ConnPerRoute connPerRoute, final int maxTotalConnections, final long connTTL, final TimeUnit connTTLTimeUnit)
Deprecated
as a consequence of
ClientConnectionOperator and ConnPerRoute being deprecated.
|
| public | ConnPoolByRoute(final ClientConnectionOperator operator, final HttpParams params)
Deprecated
(4.1) use
Creates a new connection pool, managed by route.
ConnPoolByRoute#ConnPoolByRoute(ClientConnectionOperator, ConnPerRoute, int)
|
| Modifier and Type | Method and Description |
|---|---|
| private void | closeConnection(final BasicPoolEntry entry)
Deprecated
as a consequence of
BasicPoolEntry being deprecated.
|
| public void | |
| public void | closeIdleConnections(final long
the time the connections should have been idle
in order to be closed now idletime, final TimeUnit the unit for the timeUnit)idletimeOverrides org. |
| protected BasicPoolEntry | Returns: the new pool entry for a new connectionthe route-specific pool for which to create the entry rospl, final ClientConnectionOperator the operator for creating a connection op)
Deprecated
as a consequence of
Creates a new pool entry.
RouteSpecificPool, ClientConnectionOperator and BasicPoolEntry being deprecated.
|
| protected Queue | |
| protected Map | |
| protected Queue | |
| public void | deleteClosedConnections()
Implements abstract org. |
| protected void | deleteEntry(final BasicPoolEntry
the pool entry for the connection to delete entry)
Deprecated
as a consequence of
Deletes a given pool entry.
BasicPoolEntry being deprecated.
|
| protected void | |
| public void | freeEntry(final BasicPoolEntry
the entry for the connection to release entry, final boolean true if the entry is deemed
reusable, false otherwise.The duration that the entry should remain free and reusable. validDuration, final TimeUnit The unit of time the duration is measured in. timeUnit)Implements abstract org.
Deprecated
as a consequence of
Returns an entry into the pool.
BasicPoolEntry being deprecated.
|
| public int | |
| public int | |
| protected BasicPoolEntry | Returns: pool entry holding a connection for the routethe route for which to get the connection route, final Object state, final long the timeout, 0 or negative for no timeout timeout, final TimeUnit the unit for the timeUnit, final WaitingThreadAborter timeout,
may be null only if there is no timeoutan object which can abort a aborter)WaitingThread.
Deprecated
as a consequence of
Obtains a pool entry with a connection within the given timeout.
WaitingThreadAborter and BasicPoolEntry being deprecated.
|
| protected BasicPoolEntry | Returns: an available pool entry for the given route, ornull if none is availablethe route-specific pool from which to get an entry rospl, final Object state)
Deprecated
as a consequence of
If available, get a free pool entry for a route.
RouteSpecificPool and BasicPoolEntry being deprecated.
|
| protected Lock | |
| public int | |
| protected RouteSpecificPool | Returns: the pool for the argument route, nevernull if create is truethe route route, final boolean whether to create the pool if it doesn't exist create)
Deprecated
as a consequence of
Get a route-specific pool of available connections.
RouteSpecificPool being deprecated.
|
| protected void | handleLostEntry(final HttpRoute route)
Implements abstract org. |
| protected RouteSpecificPool | Returns: the new poolthe route route)
Deprecated
as a consequence of
Creates a new route-specific pool.
RouteSpecificPool being deprecated.
|
| protected WaitingThread | Returns: a waiting thread representationthe condition to wait for cond, final RouteSpecificPool the route specific pool, or rospl)null
Deprecated
as a consequence of
Creates a new waiting thread.
RouteSpecificPool and WaitingThread being deprecated.
|
| protected void | notifyWaitingThread(final RouteSpecificPool
the pool in which to notify, or rospl)null
Deprecated
as a consequence of
Notifies a waiting thread that a connection is available.
RouteSpecificPool being deprecated.
|
| public PoolEntryRequest | requestPoolEntry(final HttpRoute
the route route, final Object the state state)Implements abstract org.
Deprecated
as a consequence of
Returns a new PoolEntryRequest being deprecated.
PoolEntryRequest, from which a BasicPoolEntry
can be obtained, or the request can be aborted.
|
| public void | |
| public void | shutdown()
Overrides org. |
| connPerRoute | back to summary |
|---|---|
| protected final ConnPerRoute connPerRoute
Deprecated as a consequence of Connections per route lookup | |
| connTTL | back to summary |
|---|---|
| private final long connTTL | |
| connTTLTimeUnit | back to summary |
|---|---|
| private final TimeUnit connTTLTimeUnit | |
| freeConnections | back to summary |
|---|---|
| protected final Queue<BasicPoolEntry> freeConnections The list of free connections | |
| leasedConnections | back to summary |
|---|---|
| protected final Set<BasicPoolEntry> leasedConnections Hides org. References to issued connections | |
| log | back to summary |
|---|---|
| private final Log log | |
| maxTotalConnections | back to summary |
|---|---|
| protected volatile int maxTotalConnections | |
| numConnections | back to summary |
|---|---|
| protected volatile int numConnections Hides org. | |
| operator | back to summary |
|---|---|
| protected final ClientConnectionOperator operator
Deprecated as a consequence of Connection operator for this pool | |
| poolLock | back to summary |
|---|---|
| private final Lock poolLock Hides org. | |
| routeToPool | back to summary |
|---|---|
| protected final Map<HttpRoute, RouteSpecificPool> routeToPool Map of route-specific pools | |
| shutdown | back to summary |
|---|---|
| protected volatile boolean shutdown | |
| waitingThreads | back to summary |
|---|---|
| protected final Queue<WaitingThread> waitingThreads The list of WaitingThreads waiting for a connection | |
| ConnPoolByRoute | back to summary |
|---|---|
| public ConnPoolByRoute(final ClientConnectionOperator operator, final ConnPerRoute connPerRoute, final int maxTotalConnections)
Deprecated as a consequence of Creates a new connection pool, managed by route.
| |
| ConnPoolByRoute | back to summary |
|---|---|
| public ConnPoolByRoute(final ClientConnectionOperator operator, final ConnPerRoute connPerRoute, final int maxTotalConnections, final long connTTL, final TimeUnit connTTLTimeUnit)
Deprecated as a consequence of
| |
| ConnPoolByRoute | back to summary |
|---|---|
| public ConnPoolByRoute(final ClientConnectionOperator operator, final HttpParams params)
Deprecated (4.1) use Creates a new connection pool, managed by route.
| |
| closeConnection | back to summary |
|---|---|
| private void closeConnection(final BasicPoolEntry entry)
Deprecated as a consequence of | |
| closeExpiredConnections | back to summary |
|---|---|
| public void closeExpiredConnections() Overrides org.
| |
| closeIdleConnections | back to summary |
|---|---|
| public void closeIdleConnections(final long idletime, final TimeUnit timeUnit) Overrides org. Closes idle connections. | |
| createEntry | back to summary |
|---|---|
| protected BasicPoolEntry createEntry(final RouteSpecificPool rospl, final ClientConnectionOperator op)
Deprecated as a consequence of Creates a new pool entry. This method assumes that the new connection will be handed out immediately.
| |
| createFreeConnQueue | back to summary |
|---|---|
| protected Queue Creates the queue for
| |
| createRouteToPoolMap | back to summary |
|---|---|
| protected Map Creates the map for
| |
| createWaitingThreadQueue | back to summary |
|---|---|
| protected Queue Creates the queue for
| |
| deleteClosedConnections | back to summary |
|---|---|
| public void deleteClosedConnections() Implements abstract org. Doc from org. Deletes all entries for closed connections.
| |
| deleteEntry | back to summary |
|---|---|
| protected void deleteEntry(final BasicPoolEntry entry)
Deprecated as a consequence of Deletes a given pool entry. This closes the pooled connection and removes all references, so that it can be GCed. Note Does not remove the entry from the freeConnections list. It is assumed that the caller has already handled this step.
| |
| deleteLeastUsedEntry | back to summary |
|---|---|
| protected void deleteLeastUsedEntry() Delete an old, free pool entry to make room for a new one. Used to replace pool entries with ones for a different route. | |
| freeEntry | back to summary |
|---|---|
| public void freeEntry(final BasicPoolEntry entry, final boolean reusable, final long validDuration, final TimeUnit timeUnit) Implements abstract org. Doc from org. Deprecated as a consequence of 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.
| |
| getConnectionsInPool | back to summary |
|---|---|
| public int getConnectionsInPool(final HttpRoute route) | |
| getConnectionsInPool | back to summary |
|---|---|
| public int getConnectionsInPool() | |
| getEntryBlocking | back to summary |
|---|---|
| protected BasicPoolEntry getEntryBlocking(final HttpRoute route, final Object state, final long timeout, final TimeUnit timeUnit, final WaitingThreadAborter aborter) throws ConnectionPoolTimeoutException, InterruptedException
Deprecated as a consequence of Obtains a pool entry with a connection within the given timeout.
If a
| |
| getFreeEntry | back to summary |
|---|---|
| protected BasicPoolEntry getFreeEntry(final RouteSpecificPool rospl, final Object state)
Deprecated as a consequence of If available, get a free pool entry for a route.
| |
| getLock | back to summary |
|---|---|
| protected Lock getLock() | |
| getMaxTotalConnections | back to summary |
|---|---|
| public int getMaxTotalConnections() since 4.1 | |
| getRoutePool | back to summary |
|---|---|
| protected RouteSpecificPool getRoutePool(final HttpRoute route, final boolean create)
Deprecated as a consequence of Get a route-specific pool of available connections.
| |
| handleLostEntry | back to summary |
|---|---|
| protected void handleLostEntry(final HttpRoute route) Implements abstract org.
| |
| newRouteSpecificPool | back to summary |
|---|---|
| protected RouteSpecificPool newRouteSpecificPool(final HttpRoute route)
Deprecated as a consequence of Creates a new route-specific pool.
Called by
| |
| newWaitingThread | back to summary |
|---|---|
| protected WaitingThread newWaitingThread(final Condition cond, final RouteSpecificPool rospl)
Deprecated as a consequence of Creates a new waiting thread.
Called by
| |
| notifyWaitingThread | back to summary |
|---|---|
| protected void notifyWaitingThread(final RouteSpecificPool rospl)
Deprecated as a consequence of Notifies a waiting thread that a connection is available. This will wake a thread waiting in the specific route pool, if there is one. Otherwise, a thread in the connection pool will be notified.
| |
| requestPoolEntry | back to summary |
|---|---|
| public PoolEntryRequest requestPoolEntry(final HttpRoute route, final Object state) Implements abstract org. Doc from org. Deprecated as a consequence of Returns a new
| |
| setMaxTotalConnections | back to summary |
|---|---|
| public void setMaxTotalConnections(final int max) since 4.1 | |
| shutdown | back to summary |
|---|---|
| public void shutdown() Overrides org. Doc from org. Shuts down this pool and all associated resources. Overriding methods MUST call the implementation here!
| |