public abstract class AbstractHttpClientTransport extends ContainerLifeCycle implements HttpClientTransport
Modifier and Type | Class and Description |
---|---|
protected class |
AbstractHttpClientTransport.ClientSelectorManager |
AbstractLifeCycle.AbstractLifeCycleListener
Container.InheritedListener, Container.Listener
LifeCycle.Listener
Modifier | Constructor and Description |
---|---|
protected |
AbstractHttpClientTransport(int selectors) |
Modifier and Type | Method and Description |
---|---|
protected void |
configure(HttpClient client,
SocketChannel channel) |
void |
connect(HttpDestination destination,
SocketAddress address,
Promise<Connection> promise)
Establishes a physical connection to the given
address . |
protected SslConnection |
createSslConnection(EndPoint endPoint,
HttpDestination destination) |
protected void |
doStart()
Starts the managed lifecycle beans in the order they were added.
|
protected HttpClient |
getHttpClient() |
protected abstract Connection |
newConnection(EndPoint endPoint,
HttpDestination destination) |
protected SelectorManager |
newSelectorManager(HttpClient client) |
protected SslConnection |
newSslConnection(HttpClient httpClient,
EndPoint endPoint,
SSLEngine engine) |
void |
setHttpClient(HttpClient client)
Sets the
HttpClient instance on this transport. |
protected Connection |
tunnel(EndPoint endPoint,
HttpDestination destination,
Connection connection) |
addBean, addBean, addBean, addEventListener, contains, destroy, doStop, dump, dump, dump, dump, dump, dumpBeans, dumpObject, dumpStdErr, dumpThis, getBean, getBeans, getBeans, isManaged, manage, removeBean, removeBeans, removeEventListener, setBeans, setStopTimeout, start, stop, unmanage, updateBean, updateBeans
addLifeCycleListener, getState, getState, getStopTimeout, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, removeLifeCycleListener, start, stop
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
newHttpDestination, tunnel
protected static final Logger LOG
protected HttpClient getHttpClient()
public void setHttpClient(HttpClient client)
HttpClientTransport
HttpClient
instance on this transport.
This is needed because of a chicken-egg problem: in order to create the HttpClient
a HttpClientTransport
is needed, that therefore cannot have a reference yet to the
HttpClient
.setHttpClient
in interface HttpClientTransport
client
- the HttpClient
that uses this transport.protected void doStart() throws Exception
ContainerLifeCycle
doStart
in class ContainerLifeCycle
Exception
public void connect(HttpDestination destination, SocketAddress address, Promise<Connection> promise)
HttpClientTransport
address
.connect
in interface HttpClientTransport
destination
- the destinationaddress
- the address to connect topromise
- the promise to notify when the connection succeeds or failsprotected void configure(HttpClient client, SocketChannel channel) throws SocketException
SocketException
protected SelectorManager newSelectorManager(HttpClient client)
protected SslConnection createSslConnection(EndPoint endPoint, HttpDestination destination)
protected SslConnection newSslConnection(HttpClient httpClient, EndPoint endPoint, SSLEngine engine)
protected abstract Connection newConnection(EndPoint endPoint, HttpDestination destination)
protected Connection tunnel(EndPoint endPoint, HttpDestination destination, Connection connection)
Copyright © 1995-2013 Mort Bay Consulting. All Rights Reserved.