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,
Throwable cause) |
protected Connection |
acquire() |
void |
close() |
String |
dump() |
void |
dump(Appendable out,
String indent) |
protected BlockingQueue<Connection> |
getActiveConnections() |
InetSocketAddress |
getConnectAddress() |
String |
getHost() |
protected BlockingQueue<Connection> |
getIdleConnections() |
int |
getPort() |
String |
getScheme() |
boolean |
isProxied() |
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 Destination
public String getHost()
getHost
in interface Destination
public int getPort()
getPort
in interface Destination
public InetSocketAddress getConnectAddress()
public boolean isProxied()
public void send(Request request, List<Response.ResponseListener> listeners)
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.