@ManagedObject(value="The HTTP/2 client transport") public class HttpClientTransportOverHTTP2 extends ContainerLifeCycle implements HttpClientTransport
AbstractLifeCycle.AbstractLifeCycleListener
Container.InheritedListener, Container.Listener
LifeCycle.Listener
FAILED, RUNNING, STARTED, STARTING, STOPPED, STOPPING
HTTP_CONNECTION_PROMISE_CONTEXT_KEY, HTTP_DESTINATION_CONTEXT_KEY
CONNECTOR_CONTEXT_KEY
Constructor and Description |
---|
HttpClientTransportOverHTTP2(HTTP2Client client) |
Modifier and Type | Method and Description |
---|---|
void |
connect(InetSocketAddress address,
Map<String,Object> context)
Establishes a physical connection to the given
address . |
protected void |
doStart()
Starts the managed lifecycle beans in the order they were added.
|
protected void |
doStop()
Stops the managed lifecycle beans in the reverse order they were added.
|
protected HttpClient |
getHttpClient() |
int |
getSelectors() |
boolean |
isUseALPN() |
Connection |
newConnection(EndPoint endPoint,
Map<String,Object> context) |
protected HttpConnectionOverHTTP2 |
newHttpConnection(HttpDestination destination,
Session session) |
HttpDestination |
newHttpDestination(Origin origin)
Creates a new, transport-specific,
HttpDestination object. |
protected void |
onClose(HttpConnectionOverHTTP2 connection,
GoAwayFrame frame) |
void |
setHttpClient(HttpClient client)
Sets the
HttpClient instance on this transport. |
void |
setUseALPN(boolean useALPN) |
addBean, addBean, addBean, addEventListener, addManaged, contains, destroy, dump, dump, dump, dump, dump, dumpBeans, dumpObject, dumpStdErr, dumpThis, getBean, getBeans, getBeans, isManaged, manage, removeBean, removeBeans, removeEventListener, setBeans, setStopTimeout, start, stop, unmanage, updateBean, 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
customize
public HttpClientTransportOverHTTP2(HTTP2Client client)
@ManagedAttribute(value="The number of selectors", readonly=true) public int getSelectors()
public boolean isUseALPN()
public void setUseALPN(boolean useALPN)
protected void doStart() throws Exception
ContainerLifeCycle
doStart
in class ContainerLifeCycle
Exception
protected void doStop() throws Exception
ContainerLifeCycle
doStop
in class ContainerLifeCycle
Exception
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.public HttpDestination newHttpDestination(Origin origin)
HttpClientTransport
HttpDestination
object.
HttpDestination
controls the destination-connection cardinality: protocols like
HTTP have 1-N cardinality, while multiplexed protocols like HTTP/2 have a 1-1 cardinality.
newHttpDestination
in interface HttpClientTransport
origin
- the destination originHttpDestination
objectpublic void connect(InetSocketAddress address, Map<String,Object> context)
HttpClientTransport
address
.connect
in interface HttpClientTransport
address
- the address to connect tocontext
- the context information to establish the connectionpublic Connection newConnection(EndPoint endPoint, Map<String,Object> context) throws IOException
newConnection
in interface ClientConnectionFactory
endPoint
- the EndPoint
to link the newly created connection tocontext
- the context data to create the connectionConnection
IOException
- if the connection cannot be createdprotected HttpConnectionOverHTTP2 newHttpConnection(HttpDestination destination, Session session)
protected void onClose(HttpConnectionOverHTTP2 connection, GoAwayFrame frame)
Copyright © 1995-2016 Webtide. All Rights Reserved.