|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.http.impl.conn.tsccm.RouteSpecificPool
@NotThreadSafe public class RouteSpecificPool
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.
| Field Summary | |
|---|---|
protected LinkedList<BasicPoolEntry> |
freeEntries
The list of free entries. |
protected int |
maxEntries
the maximum number of entries allowed for this pool |
protected int |
numEntries
The number of created entries. |
protected HttpRoute |
route
The route this pool is for. |
protected Queue<WaitingThread> |
waitingThreads
The list of threads waiting for this pool. |
| Constructor Summary | |
|---|---|
RouteSpecificPool(HttpRoute route,
int maxEntries)
Creates a new route-specific pool. |
|
| Method Summary | |
|---|---|
BasicPoolEntry |
allocEntry(Object state)
Obtains a free entry from this pool, if one is available. |
void |
createdEntry(BasicPoolEntry entry)
Indicates creation of an entry for this pool. |
boolean |
deleteEntry(BasicPoolEntry entry)
Deletes an entry from this pool. |
void |
dropEntry()
Forgets about an entry from this pool. |
void |
freeEntry(BasicPoolEntry entry)
Returns an allocated entry to this pool. |
int |
getCapacity()
Return remaining capacity of this pool |
int |
getEntryCount()
Obtains the number of entries. |
int |
getMaxEntries()
Obtains the maximum number of entries allowed for this pool. |
HttpRoute |
getRoute()
Obtains the route for which this pool is specific. |
boolean |
hasThread()
Checks whether there is a waiting thread in this pool. |
boolean |
isUnused()
Indicates whether this pool is unused. |
WaitingThread |
nextThread()
Returns the next thread in the queue. |
void |
queueThread(WaitingThread wt)
Adds a waiting thread. |
void |
removeThread(WaitingThread wt)
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 |
|---|
protected final HttpRoute route
protected final int maxEntries
protected final LinkedList<BasicPoolEntry> freeEntries
protected final Queue<WaitingThread> waitingThreads
protected int numEntries
| Constructor Detail |
|---|
public RouteSpecificPool(HttpRoute route,
int maxEntries)
route - the route for which to poolmaxEntries - the maximum number of entries allowed for this pool| Method Detail |
|---|
public final HttpRoute getRoute()
public final int getMaxEntries()
public boolean isUnused()
true if this pool is unused,
false otherwisepublic int getCapacity()
public final int getEntryCount()
public BasicPoolEntry allocEntry(Object state)
null if there is nonepublic void freeEntry(BasicPoolEntry entry)
entry - the entry obtained from allocEntry
or presented to createdEntrypublic void createdEntry(BasicPoolEntry entry)
freeEntry.
entry - the entry that was created for this poolpublic boolean deleteEntry(BasicPoolEntry entry)
entry - the entry to delete from this pool
true if the entry was found and deleted, or
false if the entry was not foundpublic void dropEntry()
allocated
from this pool has been lost and will not be returned.
public void queueThread(WaitingThread wt)
wt - the waiting threadpublic boolean hasThread()
true if there is a waiting thread,
false otherwisepublic WaitingThread nextThread()
null if there is nonepublic void removeThread(WaitingThread wt)
wt - the waiting thread
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||