|
|||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||
java.lang.Object
|
+--java.lang.Thread
|
+--ServConnectionManager
A class to Manage ServConnection. It tries to reuse ServConnections when possible.
| Field Summary | |
protected java.lang.Thread |
cleaner
The cleaner thread. |
long |
KEEP_ALIVE_TIME
the keepalivetime time we keep ServConnections. |
| Fields inherited from class java.lang.Thread |
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
| Constructor Summary | |
ServConnectionManager()
Create a new ServConnectionManager for use. |
|
| Method Summary | |
java.util.Vector |
find(ServConnection s)
Look for a matching active ServConnection inside the pool, match is done uppon InetAddress and Port |
ServConnection |
getConnection(HTTPHeader header)
Get a ServConnection for the given header. |
void |
releaseConnection(ServConnection c)
Return a ServConnection to the pool so that it may be reused. |
void |
run()
The cleaner thread is used to drop old connections where keepalive time is over. after each clean session, cleaner sleeps for an amount of time of this.KEEP_ALIVE_TIME in order to save CPU |
| Methods inherited from class java.lang.Thread |
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getContextClassLoader, getName, getPriority, getThreadGroup, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setName, setPriority, sleep, sleep, start, stop, stop, suspend, toString, yield |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
protected java.lang.Thread cleaner
public long KEEP_ALIVE_TIME
| Constructor Detail |
public ServConnectionManager()
| Method Detail |
public java.util.Vector find(ServConnection s)
s - the connection we are looking for
public ServConnection getConnection(HTTPHeader header)
throws java.io.IOException
header - the HTTPHeader containing the URL to connect to.public void releaseConnection(ServConnection c)
c - the ServConnection to return.public void run()
run in class java.lang.Thread
|
|||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||