|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.lang.Thread
org.scache.ConnectionHandler
A class to handle the connections to the net. Should reuse connections if possible.
Field Summary | |
static long |
keepalivetime
|
static boolean |
trace_keepalive
|
Fields inherited from class java.lang.Thread |
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
Constructor Summary | |
ConnectionHandler()
|
Method Summary | |
static java.util.Enumeration |
getAddresses()
Get the addresses we have connections to. |
static WebConnection |
getConnection(java.net.InetAddress ia,
int port)
Get a WebConnection for the given IP:Port |
static java.util.Enumeration |
getConnections()
Get the connections keept. |
static long |
getKeepaliveTime()
Get the current keep alive time. |
static java.util.Vector |
getPool(java.lang.String a)
Get the pool for an Address. |
static void |
init()
Create a new ConnectionHandler for use. |
static boolean |
isCleanerRunning()
Check if the cleaner of this ConnectionHandler is running. |
static void |
releaseConnection(WebConnection wc)
Return a WebConnection to the pool so that it may be reused. |
void |
run()
The cleaner thread. |
static void |
setKeepaliveTime(long milis)
Set the keep alive time for this handler. |
Methods inherited from class java.lang.Thread |
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getContextClassLoader, getName, getPriority, getThreadGroup, holdsLock, 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 |
public static boolean trace_keepalive
public static long keepalivetime
Constructor Detail |
public ConnectionHandler()
Method Detail |
public static final void init()
public static final boolean isCleanerRunning()
public static final java.util.Enumeration getConnections()
public static final java.util.Enumeration getAddresses()
public static final java.util.Vector getPool(java.lang.String a)
public static final WebConnection getConnection(java.net.InetAddress ia, int port) throws java.io.IOException
java.io.IOException
public static final void releaseConnection(WebConnection wc)
wc
- the WebConnection to return.public static void setKeepaliveTime(long milis)
milis
- the keep alive time in miliseconds.public static long getKeepaliveTime()
public void run()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |