|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectjava.lang.Thread
rabbit.io.ConnectionHandler
A class to handle the connections to the net. Should reuse connections if possible.
| Nested Class Summary | |
class |
ConnectionHandler.Address
A class to handle the addresses of the connections. |
| Field Summary |
| Fields inherited from class java.lang.Thread |
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
| Constructor Summary | |
ConnectionHandler()
Create a new ConnectionHandler for use. |
|
| Method Summary | |
java.util.Enumeration |
getAddresses()
Get the addresses we have connections to. |
WebConnection |
getConnection(HTTPHeader header)
Get a WebConnection for the given header. |
java.util.Enumeration |
getConnections()
Get the connections keept. |
long |
getKeepaliveTime()
Get the current keep alive time. |
java.util.Vector |
getPool(ConnectionHandler.Address a)
Get the pool for an Address. |
boolean |
isCleanerRunning()
Check if the cleaner of this ConnectionHandler is running. |
static void |
main(java.lang.String[] args)
Simple self test. |
void |
releaseConnection(WebConnection wc)
Return a WebConnection to the pool so that it may be reused. |
void |
run()
The cleaner thread. |
void |
setKeepaliveTime(long milis)
Set the keep alive time for this handler. |
void |
setup(java.util.Properties config)
Configure the connection handler system from the given config. |
| 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 |
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
public ConnectionHandler()
| Method Detail |
public boolean isCleanerRunning()
public java.util.Enumeration getConnections()
public java.util.Enumeration getAddresses()
public java.util.Vector getPool(ConnectionHandler.Address a)
public WebConnection getConnection(HTTPHeader header)
throws java.io.IOException
header - the HTTPHeader containing the URL to connect to.
java.io.IOExceptionpublic void releaseConnection(WebConnection wc)
wc - the WebConnection to return.public void setKeepaliveTime(long milis)
milis - the keep alive time in miliseconds.public long getKeepaliveTime()
public void run()
public static void main(java.lang.String[] args)
public void setup(java.util.Properties config)
throws IllegalConfigurationException
config - the Property describing the cache settings.
IllegalConfigurationException - if some setting is strange.
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||