public abstract class PoolingHttpDestination<C extends Connection> extends HttpDestination implements Promise<Connection>
Promise.Adapter<C>
LOG
Constructor and Description |
---|
PoolingHttpDestination(HttpClient client,
Origin origin) |
Modifier and Type | Method and Description |
---|---|
C |
acquire() |
void |
close() |
void |
close(Connection oldConnection) |
void |
dump(Appendable out,
String indent) |
void |
failed(Throwable x) |
ConnectionPool |
getConnectionPool() |
protected ConnectionPool |
newConnectionPool(HttpClient client) |
void |
process(C connection,
boolean dispatch)
Processes a new connection making it idle or active depending on whether requests are waiting to be sent.
|
void |
release(Connection c) |
protected void |
send() |
protected abstract void |
send(C connection,
HttpExchange exchange) |
void |
succeeded(Connection connection) |
String |
toString() |
abort, asString, createConnection, dump, enqueue, getClientConnectionFactory, getConnectAddress, getHost, getHostField, getHttpClient, getHttpExchanges, getOrigin, getPort, getProxy, getRequestNotifier, getResponseNotifier, getScheme, newConnection, newExchangeQueue, newSslClientConnectionFactory, remove, send, send
public PoolingHttpDestination(HttpClient client, Origin origin)
protected ConnectionPool newConnectionPool(HttpClient client)
public ConnectionPool getConnectionPool()
public void succeeded(Connection connection)
succeeded
in interface Promise<Connection>
public void failed(Throwable x)
failed
in interface Promise<Connection>
protected void send()
send
in class HttpDestination
public C acquire()
public void process(C 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 connectiondispatch
- whether to dispatch the processing to another threadprotected abstract void send(C connection, HttpExchange exchange)
public void release(Connection c)
release
in class HttpDestination
public void close(Connection oldConnection)
close
in class HttpDestination
public void close()
close
in interface Closeable
close
in interface AutoCloseable
close
in class HttpDestination
public void dump(Appendable out, String indent) throws IOException
dump
in interface Dumpable
dump
in class HttpDestination
IOException
public String toString()
toString
in class HttpDestination
Copyright © 1995-2017 Webtide. All Rights Reserved.