public class HttpDestination extends Object implements Destination, AutoCloseable, Dumpable
| Constructor and Description |
|---|
HttpDestination(HttpClient client,
String scheme,
String host,
int port) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
abort(Request request,
String reason) |
protected Connection |
acquire() |
void |
close() |
String |
dump() |
void |
dump(Appendable out,
String indent) |
protected BlockingQueue<Connection> |
getActiveConnections() |
String |
getHost() |
protected BlockingQueue<Connection> |
getIdleConnections() |
int |
getPort() |
String |
getScheme() |
Future<Connection> |
newConnection() |
protected void |
newConnection(Callback<Connection> callback) |
protected void |
process(Connection connection,
boolean dispatch)
Processes a new connection making it idle or active depending on whether requests are waiting to be sent.
|
void |
release(Connection connection) |
void |
remove(Connection connection) |
void |
send(Request request,
List<Response.ResponseListener> listeners) |
String |
toString() |
public HttpDestination(HttpClient client, String scheme, String host, int port)
protected BlockingQueue<Connection> getIdleConnections()
protected BlockingQueue<Connection> getActiveConnections()
public String getScheme()
getScheme in interface Destinationpublic String getHost()
getHost in interface Destinationpublic int getPort()
getPort in interface Destinationpublic void send(Request request, List<Response.ResponseListener> listeners)
public Future<Connection> newConnection()
newConnection in interface DestinationConnectionprotected void newConnection(Callback<Connection> callback)
protected Connection acquire()
protected void process(Connection connection, boolean dispatch)
Processes a new connection making it idle or active depending on whether requests are waiting to be sent.
A new connection is created when a request needs to be executed; it is possible that the request that triggered the request creation is executed by another connection that was just released, so the new connection may become idle.
If a request is waiting to be executed, it will be dequeued and executed by the new connection.
connection - the new connectionpublic void release(Connection connection)
public void remove(Connection connection)
public void close()
close in interface AutoCloseablepublic void dump(Appendable out, String indent) throws IOException
dump in interface DumpableIOExceptionCopyright © 1995-2012 Mort Bay Consulting. All Rights Reserved.