Class AbstractConnPool

java.lang.Object
org.apache.http.impl.conn.tsccm.AbstractConnPool
Direct Known Subclasses:
ConnPoolByRoute

@Deprecated public abstract class AbstractConnPool extends Object
Deprecated.
(4.2) use 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!
Since:
4.0
  • Field Details

    • poolLock

      protected final Lock poolLock
      Deprecated.
      The global lock for this pool.
    • leasedConnections

      protected Set<BasicPoolEntry> leasedConnections
      Deprecated.
    • numConnections

      protected int numConnections
      Deprecated.
    • isShutDown

      protected volatile boolean isShutDown
      Deprecated.
      Indicates whether this pool is shut down.
    • issuedConnections

      protected Set<BasicPoolEntryRef> issuedConnections
      Deprecated.
    • refQueue

      protected ReferenceQueue<Object> refQueue
      Deprecated.
    • idleConnHandler

      protected IdleConnectionHandler idleConnHandler
      Deprecated.
  • Constructor Details

    • AbstractConnPool

      protected AbstractConnPool()
      Deprecated.
      Creates a new connection pool.
  • Method Details

    • enableConnectionGC

      public void enableConnectionGC() throws IllegalStateException
      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 connection
      state - the state
      timeout - the timeout, 0 or negative for no timeout
      timeUnit - the unit for the timeout, may be null only if there is no timeout
      Returns:
      pool entry holding a connection for the route
      Throws:
      ConnectionPoolTimeoutException - if the timeout expired
      InterruptedException - if the calling thread was interrupted
    • requestPoolEntry

      public abstract PoolEntryRequest requestPoolEntry(HttpRoute route, Object state)
      Deprecated.
      Returns a new PoolEntryRequest, from which a BasicPoolEntry can be obtained, or the request can be aborted.
      Parameters:
      route - the route
      state - 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 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.
    • handleReference

      public void handleReference(Reference<?> ref)
      Deprecated.
    • handleLostEntry

      protected abstract void handleLostEntry(HttpRoute route)
      Deprecated.
    • closeIdleConnections

      public void closeIdleConnections(long idletime, TimeUnit timeUnit)
      Deprecated.
      Closes idle connections.
      Parameters:
      idletime - the time the connections should have been idle in order to be closed now
      timeUnit - the unit for the idletime
    • 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, or null