Package org.apache.http.impl.conn.tsccm
Class AbstractConnPool
java.lang.Object
org.apache.http.impl.conn.tsccm.AbstractConnPool
- Direct Known Subclasses:
ConnPoolByRoute
Deprecated.
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!- Since:
- 4.0
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected IdleConnectionHandlerDeprecated.protected booleanDeprecated.Indicates whether this pool is shut down.protected Set<BasicPoolEntryRef>Deprecated.protected Set<BasicPoolEntry>Deprecated.private final org.apache.commons.logging.LogDeprecated.protected intDeprecated.protected final LockDeprecated.The global lock for this pool.protected ReferenceQueue<Object>Deprecated. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedDeprecated.Creates a new connection pool. -
Method Summary
Modifier and TypeMethodDescriptionprotected voidDeprecated.Closes a connection from this pool.voidDeprecated.voidcloseIdleConnections(long idletime, TimeUnit timeUnit) Deprecated.Closes idle connections.abstract voidDeprecated.Deletes all entries for closed connections.voidDeprecated.abstract voidfreeEntry(BasicPoolEntry entry, boolean reusable, long validDuration, TimeUnit timeUnit) Deprecated.Returns an entry into the pool.final BasicPoolEntryDeprecated.Obtains a pool entry with a connection within the given timeout.protected abstract voidhandleLostEntry(HttpRoute route) Deprecated.voidhandleReference(Reference<?> ref) Deprecated.abstract PoolEntryRequestrequestPoolEntry(HttpRoute route, Object state) Deprecated.Returns a newPoolEntryRequest, from which aBasicPoolEntrycan be obtained, or the request can be aborted.voidshutdown()Deprecated.Shuts down this pool and all associated resources.
-
Field Details
-
log
private final org.apache.commons.logging.Log logDeprecated. -
poolLock
Deprecated.The global lock for this pool. -
leasedConnections
Deprecated. -
numConnections
protected int numConnectionsDeprecated. -
isShutDown
protected volatile boolean isShutDownDeprecated.Indicates whether this pool is shut down. -
issuedConnections
Deprecated. -
refQueue
Deprecated. -
idleConnHandler
Deprecated.
-
-
Constructor Details
-
AbstractConnPool
protected AbstractConnPool()Deprecated.Creates a new connection pool.
-
-
Method Details
-
enableConnectionGC
Deprecated.- Throws:
IllegalStateException
-
getEntry
public final BasicPoolEntry getEntry(HttpRoute route, Object state, long timeout, TimeUnit timeUnit) throws ConnectionPoolTimeoutException, InterruptedException Deprecated.Obtains a pool entry with a connection within the given timeout.- Parameters:
route- the route for which to get the connectionstate- the statetimeout- the timeout, 0 or negative for no timeouttimeUnit- the unit for thetimeout, may benullonly if there is no timeout- Returns:
- pool entry holding a connection for the route
- Throws:
ConnectionPoolTimeoutException- if the timeout expiredInterruptedException- if the calling thread was interrupted
-
requestPoolEntry
Deprecated.Returns a newPoolEntryRequest, from which aBasicPoolEntrycan be obtained, or the request can be aborted.- Parameters:
route- the routestate- the state- Returns:
- the entry request
-
freeEntry
public abstract void freeEntry(BasicPoolEntry entry, boolean reusable, long validDuration, TimeUnit timeUnit) Deprecated.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.- Parameters:
entry- the entry for the connection to releasereusable-trueif the entry is deemed reusable,falseotherwise.validDuration- The duration that the entry should remain free and reusable.timeUnit- The unit of time the duration is measured in.
-
handleReference
Deprecated. -
handleLostEntry
Deprecated. -
closeIdleConnections
Deprecated.Closes idle connections.- 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. -
deleteClosedConnections
public abstract void deleteClosedConnections()Deprecated.Deletes all entries for closed connections. -
shutdown
public void shutdown()Deprecated.Shuts down this pool and all associated resources. Overriding methods MUST call the implementation here! -
closeConnection
Deprecated.Closes a connection from this pool.- Parameters:
conn- the connection to close, ornull
-
AbstractConnPool