@ManagedObject(value="The HTTP/2 client transport") public class HttpClientTransportOverHTTP2 extends AbstractHttpClientTransport
AbstractLifeCycle.AbstractLifeCycleListener
Container.InheritedListener, Container.Listener
LifeCycle.Listener
LOG
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(java.net.InetSocketAddress address,
java.util.Map<java.lang.String,java.lang.Object> context)
Establishes a physical connection to the given
address . |
protected void |
connect(SslContextFactory sslContextFactory,
java.net.InetSocketAddress address,
Session.Listener listener,
Promise<Session> promise,
java.util.Map<java.lang.String,java.lang.Object> context) |
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.
|
HTTP2Client |
getHTTP2Client() |
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 |
setUseALPN(boolean useALPN) |
getConnectionPoolFactory, getHttpClient, setConnectionPoolFactory, setHttpClient
addBean, addBean, addBean, addEventListener, addManaged, contains, destroy, dump, dump, dump, dump, dump, dumpBeans, dumpObject, dumpObjects, dumpStdErr, dumpThis, getBean, getBeans, getBeans, getContainedBeans, getContainedBeans, isAuto, isManaged, isUnmanaged, 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, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
customize
dumpObjects, dumpSelf
public HttpClientTransportOverHTTP2(HTTP2Client client)
public HTTP2Client getHTTP2Client()
@ManagedAttribute(value="The number of selectors", readonly=true) public int getSelectors()
@ManagedAttribute(value="Whether ALPN should be used when establishing connections") public boolean isUseALPN()
public void setUseALPN(boolean useALPN)
protected void doStart() throws java.lang.Exception
ContainerLifeCycle
doStart
in class ContainerLifeCycle
java.lang.Exception
protected void doStop() throws java.lang.Exception
ContainerLifeCycle
doStop
in class ContainerLifeCycle
java.lang.Exception
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.
origin
- the destination originHttpDestination
objectpublic void connect(java.net.InetSocketAddress address, java.util.Map<java.lang.String,java.lang.Object> context)
HttpClientTransport
address
.address
- the address to connect tocontext
- the context information to establish the connectionprotected void connect(SslContextFactory sslContextFactory, java.net.InetSocketAddress address, Session.Listener listener, Promise<Session> promise, java.util.Map<java.lang.String,java.lang.Object> context)
public Connection newConnection(EndPoint endPoint, java.util.Map<java.lang.String,java.lang.Object> context) throws java.io.IOException
endPoint
- the EndPoint
to link the newly created connection tocontext
- the context data to create the connectionConnection
java.io.IOException
- if the connection cannot be createdprotected HttpConnectionOverHTTP2 newHttpConnection(HttpDestination destination, Session session)
protected void onClose(HttpConnectionOverHTTP2 connection, GoAwayFrame frame)
Copyright © 1995–2023 Webtide. All rights reserved.