@ManagedObject(value="The HTTP/2 client transport") public class HttpClientTransportOverHTTP2 extends ContainerLifeCycle implements HttpClientTransport
AbstractLifeCycle.AbstractLifeCycleListenerContainer.InheritedListener, Container.ListenerLifeCycle.ListenerFAILED, RUNNING, STARTED, STARTING, STOP_ON_FAILURE, STOPPED, STOPPINGHTTP_CONNECTION_PROMISE_CONTEXT_KEY, HTTP_DESTINATION_CONTEXT_KEYCONNECTOR_CONTEXT_KEY| Constructor and Description |
|---|
HttpClientTransportOverHTTP2(HTTP2Client client) |
| Modifier and Type | Method and Description |
|---|---|
void |
connect(java.net.InetSocketAddress address,
java.util.Map<java.lang.String,java.lang.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,
java.util.Map<java.lang.String,java.lang.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, updateBeansaddLifeCycleListener, getState, getState, getStopTimeout, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, removeLifeCycleListener, start, stopclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitcustomizepublic 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 java.lang.Exception
ContainerLifeCycledoStart in class ContainerLifeCyclejava.lang.Exceptionprotected void doStop()
throws java.lang.Exception
ContainerLifeCycledoStop in class ContainerLifeCyclejava.lang.Exceptionprotected HttpClient getHttpClient()
public void setHttpClient(HttpClient client)
HttpClientTransportHttpClient 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 HttpClientTransportclient - the HttpClient that uses this transport.public HttpDestination newHttpDestination(Origin origin)
HttpClientTransportHttpDestination 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 HttpClientTransportorigin - the destination originHttpDestination objectpublic void connect(java.net.InetSocketAddress address,
java.util.Map<java.lang.String,java.lang.Object> context)
HttpClientTransportaddress.connect in interface HttpClientTransportaddress - the address to connect tocontext - the context information to establish the connectionpublic Connection newConnection(EndPoint endPoint, java.util.Map<java.lang.String,java.lang.Object> context) throws java.io.IOException
newConnection in interface ClientConnectionFactoryendPoint - the EndPoint to link the newly created connection tocontext - the context data to create the connectionConnectionjava.io.IOException - if the connection cannot be createdprotected HttpConnectionOverHTTP2 newHttpConnection(HttpDestination destination, Session session)
protected void onClose(HttpConnectionOverHTTP2 connection, GoAwayFrame frame)
Copyright © 1995–2017 Webtide. All rights reserved.