java.lang.Object | |
↳ | org.apache.http.impl.conn.tsccm.AbstractConnPool |
![]() |
An abstract connection pool.
It is used by the ThreadSafeClientConnManager
.
The abstract pool includes a poolLock
, which is used to
synchronize access to the internal pool datastructures.
Don't use synchronized
for that purpose!
Fields | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
idleConnHandler | |||||||||||
isShutDown | Indicates whether this pool is shut down. | ||||||||||
issuedConnections | |||||||||||
leasedConnections | References to issued connections | ||||||||||
numConnections | The current total number of connections. | ||||||||||
poolLock | The global lock for this pool. | ||||||||||
refQueue |
Protected Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Creates a new connection pool.
|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Closes idle connections.
| |||||||||||
Deletes all entries for closed connections.
| |||||||||||
Returns an entry into the pool.
| |||||||||||
Obtains a pool entry with a connection within the given timeout.
| |||||||||||
Invoked when a reference is found on the queue.
| |||||||||||
Returns a new
PoolEntryRequest , from which a BasicPoolEntry
can be obtained, or the request can be aborted. | |||||||||||
Shuts down this pool and all associated resources.
|
Protected Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Closes a connection from this pool.
| |||||||||||
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() | |||||||||||
![]() |
Closes idle connections.
idletime | the time the connections should have been idle in order to be closed now |
---|---|
tunit | the unit for the idletime
|
Deletes all entries for closed connections.
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.
entry | the entry for the connection to release |
---|---|
reusable | 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. |
Obtains a pool entry with a connection within the given timeout.
route | the route for which to get the connection |
---|---|
timeout | the timeout, 0 or negative for no timeout |
tunit | the unit for the timeout ,
may be null only if there is no timeout |
ConnectionPoolTimeoutException | if the timeout expired |
---|---|
InterruptedException | if the calling thread was interrupted |
Invoked when a reference is found on the queue.
ref | the reference to handle |
---|
Returns a new PoolEntryRequest
, from which a BasicPoolEntry
can be obtained, or the request can be aborted.
Shuts down this pool and all associated resources. Overriding methods MUST call the implementation here!
Closes a connection from this pool.
conn | the connection to close, or null
|
---|