|
||||||||||
| 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 | |
static 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.Iterator |
getAddresses()
Get the addresses we have connections to. |
WebConnection |
getConnection(HTTPHeader header)
Get a WebConnection for the given header. |
long |
getKeepaliveTime()
Get the current keep alive time. |
java.util.Iterator |
getPipelineAddresses()
Get the pipeline address we have. |
java.util.List |
getPipelinePool(ConnectionHandler.Address a)
Get the pool for an Address. |
java.util.List |
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 |
markForPipelining(WebConnection wc)
Mark a WebConnection ready for pipelining. |
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 |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
public ConnectionHandler()
| Method Detail |
public boolean isCleanerRunning()
public java.util.Iterator getAddresses()
public java.util.Iterator getPipelineAddresses()
public java.util.List getPool(ConnectionHandler.Address a)
public java.util.List getPipelinePool(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 markForPipelining(WebConnection wc)
wc - the WebConnection to mark ready for pipelining.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 | |||||||||