Package org.eclipse.jetty.http2.server
Class HTTP2ServerConnection
- java.lang.Object
-
- org.eclipse.jetty.io.AbstractConnection
-
- org.eclipse.jetty.http2.HTTP2Connection
-
- org.eclipse.jetty.http2.server.HTTP2ServerConnection
-
- All Implemented Interfaces:
java.io.Closeable,java.lang.AutoCloseable,Connection,Connection.UpgradeTo,WriteFlusher.Listener
public class HTTP2ServerConnection extends HTTP2Connection implements Connection.UpgradeTo
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected classHTTP2ServerConnection.ServerHttpChannelOverHTTP2-
Nested classes/interfaces inherited from class org.eclipse.jetty.http2.HTTP2Connection
HTTP2Connection.HTTP2Producer
-
Nested classes/interfaces inherited from interface org.eclipse.jetty.io.Connection
Connection.Listener, Connection.UpgradeFrom, Connection.UpgradeTo
-
-
Field Summary
-
Fields inherited from class org.eclipse.jetty.http2.HTTP2Connection
LOG
-
-
Constructor Summary
Constructors Constructor Description HTTP2ServerConnection(ByteBufferPool byteBufferPool, java.util.concurrent.Executor executor, EndPoint endPoint, HttpConfiguration httpConfig, ServerParser parser, ISession session, int inputBufferSize, ServerSessionListener listener)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description longgetMessagesIn()longgetMessagesOut()protected ServerParsergetParser()booleanisRecycleHttpChannels()static booleanisSupportedProtocol(java.lang.String protocol)protected HTTP2ServerConnection.ServerHttpChannelOverHTTP2newServerHttpChannelOverHTTP2(Connector connector, HttpConfiguration httpConfig, HttpTransportOverHTTP2 transport)voidonData(IStream stream, DataFrame frame, Callback callback)voidonNewStream(Connector connector, IStream stream, HeadersFrame frame)voidonOpen()Callback method invoked when this connection is opened.voidonSessionFailure(java.lang.Throwable failure, Callback callback)booleanonSessionTimeout(java.lang.Throwable failure)voidonStreamFailure(IStream stream, java.lang.Throwable failure, Callback callback)booleanonStreamTimeout(IStream stream, java.lang.Throwable failure)voidonTrailers(IStream stream, HeadersFrame frame)voidonUpgradeTo(java.nio.ByteBuffer buffer)Callback method invoked when this connection is upgraded.voidpush(Connector connector, IStream stream, MetaData.Request request)voidsetRecycleHttpChannels(boolean recycleHttpChannels)booleanupgrade(MetaData.Request request)-
Methods inherited from class org.eclipse.jetty.http2.HTTP2Connection
close, dispatch, getBytesIn, getBytesOut, getSession, offerTask, onClose, onFillable, onFlushed, onIdleExpired, produce, setInputBuffer
-
Methods inherited from class org.eclipse.jetty.io.AbstractConnection
addListener, failedCallback, fillInterested, getCreatedTimeStamp, getEndPoint, getExecutor, getInputBufferSize, isFillInterested, onFillInterestedFailed, onReadTimeout, removeListener, setInputBufferSize, toConnectionString, toString, tryFillInterested, tryFillInterested
-
-
-
-
Constructor Detail
-
HTTP2ServerConnection
public HTTP2ServerConnection(ByteBufferPool byteBufferPool, java.util.concurrent.Executor executor, EndPoint endPoint, HttpConfiguration httpConfig, ServerParser parser, ISession session, int inputBufferSize, ServerSessionListener listener)
-
-
Method Detail
-
isSupportedProtocol
public static boolean isSupportedProtocol(java.lang.String protocol)
- Parameters:
protocol- An HTTP2 protocol variant- Returns:
- True if the protocol version is supported
-
getMessagesIn
public long getMessagesIn()
- Specified by:
getMessagesInin interfaceConnection- Overrides:
getMessagesInin classAbstractConnection
-
getMessagesOut
public long getMessagesOut()
- Specified by:
getMessagesOutin interfaceConnection- Overrides:
getMessagesOutin classAbstractConnection
-
getParser
protected ServerParser getParser()
- Overrides:
getParserin classHTTP2Connection
-
isRecycleHttpChannels
public boolean isRecycleHttpChannels()
-
setRecycleHttpChannels
public void setRecycleHttpChannels(boolean recycleHttpChannels)
-
onUpgradeTo
public void onUpgradeTo(java.nio.ByteBuffer buffer)
Description copied from interface:Connection.UpgradeToCallback method invoked when this connection is upgraded.
This must be called before
Connection.onOpen().- Specified by:
onUpgradeToin interfaceConnection.UpgradeTo- Parameters:
buffer- An optional buffer that can contain prefilled data. Typically this results from an upgrade of one protocol to the other where the old connection has buffered data destined for the new connection. The new connection must take ownership of the buffer and is responsible for returning it to the buffer pool
-
onOpen
public void onOpen()
Description copied from interface:ConnectionCallback method invoked when this connection is opened.
Creators of the connection implementation are responsible for calling this method.
- Specified by:
onOpenin interfaceConnection- Overrides:
onOpenin classHTTP2Connection
-
onNewStream
public void onNewStream(Connector connector, IStream stream, HeadersFrame frame)
-
onTrailers
public void onTrailers(IStream stream, HeadersFrame frame)
-
onStreamTimeout
public boolean onStreamTimeout(IStream stream, java.lang.Throwable failure)
-
onStreamFailure
public void onStreamFailure(IStream stream, java.lang.Throwable failure, Callback callback)
-
onSessionTimeout
public boolean onSessionTimeout(java.lang.Throwable failure)
-
onSessionFailure
public void onSessionFailure(java.lang.Throwable failure, Callback callback)
-
push
public void push(Connector connector, IStream stream, MetaData.Request request)
-
newServerHttpChannelOverHTTP2
protected HTTP2ServerConnection.ServerHttpChannelOverHTTP2 newServerHttpChannelOverHTTP2(Connector connector, HttpConfiguration httpConfig, HttpTransportOverHTTP2 transport)
-
upgrade
public boolean upgrade(MetaData.Request request)
-
-