|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectrabbit.io.ConnectionHandler
public class 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. |
| Constructor Summary | |
|---|---|
ConnectionHandler(Logger logger,
Counter counter,
Resolver resolver,
NLSOHandler nlsoHandler)
Create a new ConnectionHandler for use. |
|
| Method Summary | |
|---|---|
java.util.Iterator<ConnectionHandler.Address> |
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<ConnectionHandler.Address> |
getPipelineAddresses()
Get the pipeline address we have. |
java.util.List<WebConnection> |
getPipelinePool(ConnectionHandler.Address a)
Get the pool for an Address. |
java.util.List<WebConnection> |
getPool(ConnectionHandler.Address a)
Get the pool for an Address. |
boolean |
isCleanerRunning()
Check if the cleaner of this ConnectionHandler is running. |
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(SProperties config)
Configure the connection handler system from the given config. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ConnectionHandler(Logger logger,
Counter counter,
Resolver resolver,
NLSOHandler nlsoHandler)
throws java.io.IOException
java.io.IOException| Method Detail |
|---|
public boolean isCleanerRunning()
public java.util.Iterator<ConnectionHandler.Address> getAddresses()
public java.util.Iterator<ConnectionHandler.Address> getPipelineAddresses()
public java.util.List<WebConnection> getPool(ConnectionHandler.Address a)
public java.util.List<WebConnection> 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()
run in interface java.lang.Runnable
public void setup(SProperties config)
throws IllegalConfigurationException
config - the properties 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 | ||||||||