org.apache.http.impl.conn.tsccm
Class RouteSpecificPool

java.lang.Object
  extended by org.apache.http.impl.conn.tsccm.RouteSpecificPool

Deprecated. (4.2) use AbstractConnPool

@Deprecated
public class RouteSpecificPool
extends Object

A connection sub-pool for a specific route, used by ConnPoolByRoute. The methods in this class are unsynchronized. It is expected that the containing pool takes care of synchronization.

Since:
4.0

Field Summary
protected  ConnPerRoute connPerRoute
          Deprecated. Connections per route
protected  LinkedList<BasicPoolEntry> freeEntries
          Deprecated. The list of free entries.
protected  int maxEntries
          Deprecated.  
protected  int numEntries
          Deprecated. The number of created entries.
protected  HttpRoute route
          Deprecated. The route this pool is for.
protected  Queue<WaitingThread> waitingThreads
          Deprecated. The list of threads waiting for this pool.
 
Constructor Summary
RouteSpecificPool(HttpRoute route, ConnPerRoute connPerRoute)
          Deprecated. Creates a new route-specific pool.
RouteSpecificPool(HttpRoute route, int maxEntries)
          Deprecated. (4.1) use RouteSpecificPool(HttpRoute, ConnPerRoute)
 
Method Summary
 BasicPoolEntry allocEntry(Object state)
          Deprecated. Obtains a free entry from this pool, if one is available.
 void createdEntry(BasicPoolEntry entry)
          Deprecated. Indicates creation of an entry for this pool.
 boolean deleteEntry(BasicPoolEntry entry)
          Deprecated. Deletes an entry from this pool.
 void dropEntry()
          Deprecated. Forgets about an entry from this pool.
 void freeEntry(BasicPoolEntry entry)
          Deprecated. Returns an allocated entry to this pool.
 int getCapacity()
          Deprecated. Return remaining capacity of this pool
 int getEntryCount()
          Deprecated. Obtains the number of entries.
 int getMaxEntries()
          Deprecated. Obtains the maximum number of entries allowed for this pool.
 HttpRoute getRoute()
          Deprecated. Obtains the route for which this pool is specific.
 boolean hasThread()
          Deprecated. Checks whether there is a waiting thread in this pool.
 boolean isUnused()
          Deprecated. Indicates whether this pool is unused.
 WaitingThread nextThread()
          Deprecated. Returns the next thread in the queue.
 void queueThread(WaitingThread wt)
          Deprecated. Adds a waiting thread.
 void removeThread(WaitingThread wt)
          Deprecated. Removes a waiting thread, if it is queued.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

route

protected final HttpRoute route
Deprecated. 
The route this pool is for.


maxEntries

protected final int maxEntries
Deprecated. 

connPerRoute

protected final ConnPerRoute connPerRoute
Deprecated. 
Connections per route


freeEntries

protected final LinkedList<BasicPoolEntry> freeEntries
Deprecated. 
The list of free entries. This list is managed LIFO, to increase idle times and allow for closing connections that are not really needed.


waitingThreads

protected final Queue<WaitingThread> waitingThreads
Deprecated. 
The list of threads waiting for this pool.


numEntries

protected int numEntries
Deprecated. 
The number of created entries.

Constructor Detail

RouteSpecificPool

@Deprecated
public RouteSpecificPool(HttpRoute route,
                                    int maxEntries)
Deprecated. (4.1) use RouteSpecificPool(HttpRoute, ConnPerRoute)


RouteSpecificPool

public RouteSpecificPool(HttpRoute route,
                         ConnPerRoute connPerRoute)
Deprecated. 
Creates a new route-specific pool.

Parameters:
route - the route for which to pool
connPerRoute - the connections per route configuration
Method Detail

getRoute

public final HttpRoute getRoute()
Deprecated. 
Obtains the route for which this pool is specific.

Returns:
the route

getMaxEntries

public final int getMaxEntries()
Deprecated. 
Obtains the maximum number of entries allowed for this pool.

Returns:
the max entry number

isUnused

public boolean isUnused()
Deprecated. 
Indicates whether this pool is unused. A pool is unused if there is neither an entry nor a waiting thread. All entries count, not only the free but also the allocated ones.

Returns:
true if this pool is unused, false otherwise

getCapacity

public int getCapacity()
Deprecated. 
Return remaining capacity of this pool

Returns:
capacity

getEntryCount

public final int getEntryCount()
Deprecated. 
Obtains the number of entries. This includes not only the free entries, but also those that have been created and are currently issued to an application.

Returns:
the number of entries for the route of this pool

allocEntry

public BasicPoolEntry allocEntry(Object state)
Deprecated. 
Obtains a free entry from this pool, if one is available.

Returns:
an available pool entry, or null if there is none

freeEntry

public void freeEntry(BasicPoolEntry entry)
Deprecated. 
Returns an allocated entry to this pool.

Parameters:
entry - the entry obtained from allocEntry or presented to createdEntry

createdEntry

public void createdEntry(BasicPoolEntry entry)
Deprecated. 
Indicates creation of an entry for this pool. The entry will not be added to the list of free entries, it is only recognized as belonging to this pool now. It can then be passed to freeEntry.

Parameters:
entry - the entry that was created for this pool

deleteEntry

public boolean deleteEntry(BasicPoolEntry entry)
Deprecated. 
Deletes an entry from this pool. Only entries that are currently free in this pool can be deleted. Allocated entries can not be deleted.

Parameters:
entry - the entry to delete from this pool
Returns:
true if the entry was found and deleted, or false if the entry was not found

dropEntry

public void dropEntry()
Deprecated. 
Forgets about an entry from this pool. This method is used to indicate that an entry allocated from this pool has been lost and will not be returned.


queueThread

public void queueThread(WaitingThread wt)
Deprecated. 
Adds a waiting thread. This pool makes no attempt to match waiting threads with pool entries. It is the caller's responsibility to check that there is no entry before adding a waiting thread.

Parameters:
wt - the waiting thread

hasThread

public boolean hasThread()
Deprecated. 
Checks whether there is a waiting thread in this pool.

Returns:
true if there is a waiting thread, false otherwise

nextThread

public WaitingThread nextThread()
Deprecated. 
Returns the next thread in the queue.

Returns:
a waiting thread, or null if there is none

removeThread

public void removeThread(WaitingThread wt)
Deprecated. 
Removes a waiting thread, if it is queued.

Parameters:
wt - the waiting thread


Copyright © 1999–2019 The Apache Software Foundation. All rights reserved.