public abstract class PoolingHttpDestination<C extends Connection> extends HttpDestination implements Callback
Callback.Adapter
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)
Callback invoked when the operation fails.
|
ConnectionPool |
getConnectionPool() |
protected ConnectionPool |
newConnectionPool(HttpClient client) |
void |
process(C connection)
Processes a new connection making it idle or active depending on whether requests are waiting to be sent.
|
void |
release(Connection c) |
void |
send() |
protected abstract void |
send(C connection,
HttpExchange exchange) |
void |
succeeded()
Callback invoked when the operation completes.
|
String |
toString() |
abort, asString, createConnection, dump, enqueue, getClientConnectionFactory, getConnectAddress, getHost, getHostField, getHttpClient, getHttpExchanges, getOrigin, getPort, getProxy, getRequestNotifier, getResponseNotifier, getScheme, newConnection, newExchangeQueue, newSslClientConnectionFactory, remove, send
public PoolingHttpDestination(HttpClient client, Origin origin)
protected ConnectionPool newConnectionPool(HttpClient client)
public ConnectionPool getConnectionPool()
public void succeeded()
Callback
Callback invoked when the operation completes.
succeeded
in interface Callback
Callback.failed(Throwable)
public void failed(Throwable x)
Callback
Callback invoked when the operation fails.
public void send()
send
in class HttpDestination
public C acquire()
public void process(C connection)
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 connectionprotected 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-2015 Webtide. All Rights Reserved.