java.io.Closeable, java.lang.AutoCloseable, Destination, Container, Destroyable, Dumpable, LifeCycleMultiplexHttpDestination, PoolingHttpDestination@ManagedObject public abstract class HttpDestination extends ContainerLifeCycle implements Destination, java.io.Closeable, Dumpable
AbstractLifeCycle.AbstractLifeCycleListenerContainer.InheritedListener, Container.ListenerLifeCycle.Listener| Modifier and Type | Field | Description |
|---|---|---|
protected static Logger |
LOG |
FAILED, RUNNING, STARTED, STARTING, STOP_ON_FAILURE, STOPPED, STOPPING| Constructor | Description |
|---|---|
HttpDestination(HttpClient client,
Origin origin) |
| Modifier and Type | Method | Description |
|---|---|---|
void |
abort(java.lang.Throwable cause) |
Aborts all the
HttpExchanges queued in this destination. |
java.lang.String |
asString() |
|
void |
close() |
|
void |
close(Connection connection) |
|
protected void |
createConnection(Promise<Connection> promise) |
|
void |
dump(java.lang.Appendable out,
java.lang.String indent) |
|
protected boolean |
enqueue(java.util.Queue<HttpExchange> queue,
HttpExchange exchange) |
|
ClientConnectionFactory |
getClientConnectionFactory() |
|
Origin.Address |
getConnectAddress() |
|
java.lang.String |
getHost() |
|
HttpField |
getHostField() |
|
HttpClient |
getHttpClient() |
|
java.util.Queue<HttpExchange> |
getHttpExchanges() |
|
Origin |
getOrigin() |
|
int |
getPort() |
|
ProxyConfiguration.Proxy |
getProxy() |
|
int |
getQueuedRequestCount() |
|
RequestNotifier |
getRequestNotifier() |
|
ResponseNotifier |
getResponseNotifier() |
|
java.lang.String |
getScheme() |
|
void |
newConnection(Promise<Connection> promise) |
Creates asynchronously a new, unpooled,
Connection that will be returned
at a later time through the given Promise. |
protected java.util.Queue<HttpExchange> |
newExchangeQueue(HttpClient client) |
|
protected ClientConnectionFactory |
newSslClientConnectionFactory(ClientConnectionFactory connectionFactory) |
|
void |
release(Connection connection) |
|
boolean |
remove(HttpExchange exchange) |
|
abstract void |
send() |
|
protected void |
send(HttpRequest request,
java.util.List<Response.ResponseListener> listeners) |
|
java.lang.String |
toString() |
addLifeCycleListener, getState, getState, getStopTimeout, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, removeLifeCycleListener, start, stopaddBean, addBean, addBean, addEventListener, addManaged, contains, destroy, doStart, doStop, dump, dump, dump, dump, dumpBeans, dumpObject, dumpStdErr, dumpThis, getBean, getBeans, getBeans, isManaged, manage, removeBean, removeBeans, removeEventListener, setBeans, setStopTimeout, start, stop, unmanage, updateBean, updateBean, updateBeansprotected static final Logger LOG
public HttpDestination(HttpClient client, Origin origin)
protected java.util.Queue<HttpExchange> newExchangeQueue(HttpClient client)
protected ClientConnectionFactory newSslClientConnectionFactory(ClientConnectionFactory connectionFactory)
public HttpClient getHttpClient()
public Origin getOrigin()
public java.util.Queue<HttpExchange> getHttpExchanges()
public RequestNotifier getRequestNotifier()
public ResponseNotifier getResponseNotifier()
public ProxyConfiguration.Proxy getProxy()
public ClientConnectionFactory getClientConnectionFactory()
@ManagedAttribute(value="The destination scheme", readonly=true) public java.lang.String getScheme()
getScheme in interface Destination@ManagedAttribute(value="The destination host", readonly=true) public java.lang.String getHost()
getHost in interface Destination@ManagedAttribute(value="The destination port", readonly=true) public int getPort()
getPort in interface Destination@ManagedAttribute(value="The number of queued requests", readonly=true) public int getQueuedRequestCount()
public Origin.Address getConnectAddress()
public HttpField getHostField()
protected void send(HttpRequest request, java.util.List<Response.ResponseListener> listeners)
protected boolean enqueue(java.util.Queue<HttpExchange> queue, HttpExchange exchange)
public abstract void send()
public void newConnection(Promise<Connection> promise)
DestinationConnection 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 Destinationpromise - the promise of a new, unpooled, Connectionprotected void createConnection(Promise<Connection> promise)
public boolean remove(HttpExchange exchange)
public void close()
close in interface java.lang.AutoCloseableclose in interface java.io.Closeablepublic void release(Connection connection)
public void close(Connection connection)
public void abort(java.lang.Throwable cause)
HttpExchanges queued in this destination.cause - the abort causepublic void dump(java.lang.Appendable out,
java.lang.String indent)
throws java.io.IOException
dump in interface Dumpabledump in class ContainerLifeCyclejava.io.IOExceptionpublic java.lang.String asString()
public java.lang.String toString()
toString in class java.lang.ObjectCopyright © 1995–2017 Webtide. All rights reserved.