Package org.apache.http.impl.conn.tsccm
Class AbstractConnPool
- java.lang.Object
-
- org.apache.http.impl.conn.tsccm.AbstractConnPool
-
- Direct Known Subclasses:
ConnPoolByRoute
@Deprecated public abstract class AbstractConnPool extends java.lang.ObjectDeprecated.(4.2) useAbstractConnPoolAn abstract connection pool. It is used by theThreadSafeClientConnManager. The abstract pool includes apoolLock, which is used to synchronize access to the internal pool datastructures. Don't usesynchronizedfor that purpose!- Since:
- 4.0
-
-
Field Summary
Fields Modifier and Type Field Description protected IdleConnectionHandleridleConnHandlerDeprecated.protected booleanisShutDownDeprecated.Indicates whether this pool is shut down.protected java.util.Set<BasicPoolEntryRef>issuedConnectionsDeprecated.protected java.util.Set<BasicPoolEntry>leasedConnectionsDeprecated.private org.apache.commons.logging.LoglogDeprecated.protected intnumConnectionsDeprecated.protected java.util.concurrent.locks.LockpoolLockDeprecated.The global lock for this pool.protected java.lang.ref.ReferenceQueue<java.lang.Object>refQueueDeprecated.
-
Constructor Summary
Constructors Modifier Constructor Description protectedAbstractConnPool()Deprecated.Creates a new connection pool.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Deprecated Methods Modifier and Type Method Description protected voidcloseConnection(OperatedClientConnection conn)Deprecated.Closes a connection from this pool.voidcloseExpiredConnections()Deprecated.voidcloseIdleConnections(long idletime, java.util.concurrent.TimeUnit timeUnit)Deprecated.Closes idle connections.abstract voiddeleteClosedConnections()Deprecated.Deletes all entries for closed connections.voidenableConnectionGC()Deprecated.abstract voidfreeEntry(BasicPoolEntry entry, boolean reusable, long validDuration, java.util.concurrent.TimeUnit timeUnit)Deprecated.Returns an entry into the pool.BasicPoolEntrygetEntry(HttpRoute route, java.lang.Object state, long timeout, java.util.concurrent.TimeUnit timeUnit)Deprecated.Obtains a pool entry with a connection within the given timeout.protected abstract voidhandleLostEntry(HttpRoute route)Deprecated.voidhandleReference(java.lang.ref.Reference<?> ref)Deprecated.abstract PoolEntryRequestrequestPoolEntry(HttpRoute route, java.lang.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 Detail
-
log
private final org.apache.commons.logging.Log log
Deprecated.
-
poolLock
protected final java.util.concurrent.locks.Lock poolLock
Deprecated.The global lock for this pool.
-
leasedConnections
protected java.util.Set<BasicPoolEntry> leasedConnections
Deprecated.
-
numConnections
protected int numConnections
Deprecated.
-
isShutDown
protected volatile boolean isShutDown
Deprecated.Indicates whether this pool is shut down.
-
issuedConnections
protected java.util.Set<BasicPoolEntryRef> issuedConnections
Deprecated.
-
refQueue
protected java.lang.ref.ReferenceQueue<java.lang.Object> refQueue
Deprecated.
-
idleConnHandler
protected IdleConnectionHandler idleConnHandler
Deprecated.
-
-
Method Detail
-
enableConnectionGC
public void enableConnectionGC() throws java.lang.IllegalStateExceptionDeprecated.- Throws:
java.lang.IllegalStateException
-
getEntry
public final BasicPoolEntry getEntry(HttpRoute route, java.lang.Object state, long timeout, java.util.concurrent.TimeUnit timeUnit) throws ConnectionPoolTimeoutException, java.lang.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 expiredjava.lang.InterruptedException- if the calling thread was interrupted
-
requestPoolEntry
public abstract PoolEntryRequest requestPoolEntry(HttpRoute route, java.lang.Object state)
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, java.util.concurrent.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
public void handleReference(java.lang.ref.Reference<?> ref)
Deprecated.
-
handleLostEntry
protected abstract void handleLostEntry(HttpRoute route)
Deprecated.
-
closeIdleConnections
public void closeIdleConnections(long idletime, java.util.concurrent.TimeUnit timeUnit)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
protected void closeConnection(OperatedClientConnection conn)
Deprecated.Closes a connection from this pool.- Parameters:
conn- the connection to close, ornull
-
-