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 |
---|---|
protected Connection |
acquire() |
void |
close() |
String |
dump() |
void |
dump(Appendable out,
String indent) |
protected BlockingQueue<Connection> |
getActiveConnections() |
protected BlockingQueue<Connection> |
getIdleConnections() |
String |
host() |
Future<Connection> |
newConnection() |
protected void |
newConnection(Callback<Connection> callback) |
int |
port() |
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) |
String |
scheme() |
void |
send(Request request,
Response.Listener listener) |
String |
toString() |
public HttpDestination(HttpClient client, String scheme, String host, int port)
protected BlockingQueue<Connection> getIdleConnections()
protected BlockingQueue<Connection> getActiveConnections()
public String scheme()
scheme
in interface Destination
public String host()
host
in interface Destination
public int port()
port
in interface Destination
public void send(Request request, Response.Listener listener)
public Future<Connection> newConnection()
newConnection
in interface Destination
Connection
protected 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 AutoCloseable
public void dump(Appendable out, String indent) throws IOException
dump
in interface Dumpable
IOException
Copyright © 1995-2012 Mort Bay Consulting. All Rights Reserved.