public class HttpDestinationOverHTTP extends HttpDestination implements Promise<Connection>
Promise.Adapter<C>
Destination.Address
LOG
Constructor and Description |
---|
HttpDestinationOverHTTP(HttpClient client,
String scheme,
String host,
int port) |
Modifier and Type | Method and Description |
---|---|
protected HttpConnectionOverHTTP |
acquire() |
void |
close() |
void |
dump(Appendable out,
String indent) |
void |
failed(Throwable x)
Callback invoked when the operation fails.
|
HttpConnectionPool |
getHttpConnectionPool() |
protected HttpConnectionPool |
newHttpConnectionPool(HttpClient client) |
protected void |
process(HttpConnectionOverHTTP connection,
boolean dispatch)
Processes a new connection making it idle or active depending on whether requests are waiting to be sent.
|
protected void |
release(HttpConnectionOverHTTP connection) |
protected void |
remove(HttpConnectionOverHTTP connection) |
protected void |
send() |
void |
succeeded(Connection connection)
Callback invoked when the operation completes.
|
abort, abort, asString, createConnection, dump, getConnectAddress, getHost, getHostField, getHttpClient, getHttpExchanges, getPort, getProxyURI, getRequestNotifier, getResponseNotifier, getScheme, isProxied, newConnection, remove, send, toString, tunnelFailed, tunnelSucceeded
public HttpDestinationOverHTTP(HttpClient client, String scheme, String host, int port)
protected HttpConnectionPool newHttpConnectionPool(HttpClient client)
public HttpConnectionPool getHttpConnectionPool()
public void succeeded(Connection connection)
Promise
Callback invoked when the operation completes.
succeeded
in interface Promise<Connection>
connection
- the contextPromise.failed(Throwable)
public void failed(Throwable x)
Promise
Callback invoked when the operation fails.
failed
in interface Promise<Connection>
x
- the reason for the operation failureprotected void send()
send
in class HttpDestination
protected HttpConnectionOverHTTP acquire()
protected void process(HttpConnectionOverHTTP 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 void release(HttpConnectionOverHTTP connection)
protected void remove(HttpConnectionOverHTTP connection)
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
Copyright © 1995-2013 Mort Bay Consulting. All Rights Reserved.