public abstract class HttpDestination extends Object implements Destination, Closeable, Dumpable
Constructor and Description |
---|
HttpDestination(HttpClient client,
Origin origin) |
protected static final Logger LOG
public HttpDestination(HttpClient client, Origin origin)
protected ClientConnectionFactory newSslClientConnectionFactory(ClientConnectionFactory connectionFactory)
public HttpClient getHttpClient()
public Origin getOrigin()
public Queue<HttpExchange> getHttpExchanges()
public RequestNotifier getRequestNotifier()
public ResponseNotifier getResponseNotifier()
public ProxyConfiguration.Proxy getProxy()
public ClientConnectionFactory getClientConnectionFactory()
public String getScheme()
getScheme
in interface Destination
public String getHost()
getHost
in interface Destination
public int getPort()
getPort
in interface Destination
public Origin.Address getConnectAddress()
public HttpField getHostField()
protected void send(HttpRequest request, List<Response.ResponseListener> listeners)
protected abstract void send()
public void newConnection(Promise<Connection> promise)
Destination
Connection
that will be returned
at a later time through the given Promise
.
Use FuturePromise
to wait for the connection:
Destination destination = ...; FuturePromise<Connection> futureConnection = new FuturePromise<>(); destination.newConnection(futureConnection); Connection connection = futureConnection.get(5, TimeUnit.SECONDS);
newConnection
in interface Destination
promise
- the promise of a new, unpooled, Connection
protected void createConnection(Promise<Connection> promise)
public boolean remove(HttpExchange exchange)
public void close()
close
in interface Closeable
close
in interface AutoCloseable
public void release(Connection connection)
public void close(Connection connection)
public void abort(Throwable cause)
HttpExchange
s queued in this destination.cause
- the abort causepublic void dump(Appendable out, String indent) throws IOException
dump
in interface Dumpable
IOException
public String asString()
Copyright © 1995-2015 Webtide. All Rights Reserved.