public abstract class Http2OrHttpChooser extends ByteToMessageDecoder
ChannelHandler
which is responsible to setup the
ChannelPipeline
either for HTTP or HTTP2. This offers an easy way for
users to support both at the same time while not care to much about the low-level details.Modifier and Type | Class and Description |
---|---|
static class |
Http2OrHttpChooser.SelectedProtocol |
ByteToMessageDecoder.Cumulator
ChannelHandler.Sharable, ChannelHandler.Skip
COMPOSITE_CUMULATOR, MERGE_CUMULATOR
Modifier | Constructor and Description |
---|---|
protected |
Http2OrHttpChooser(int maxHttpContentLength) |
actualReadableBytes, callDecode, channelInactive, channelRead, channelReadComplete, decodeLast, handlerRemoved, handlerRemoved0, internalBuffer, isSingleDecode, setCumulator, setSingleDecode
bind, channelActive, channelRegistered, channelUnregistered, channelWritabilityChanged, close, connect, deregister, disconnect, exceptionCaught, flush, handlerAdded, isSharable, read, userEventTriggered, write
protected abstract Http2OrHttpChooser.SelectedProtocol getProtocol(SSLEngine engine)
Http2OrHttpChooser.SelectedProtocol
for the SSLEngine
. If its not known
yet implementations MUST return Http2OrHttpChooser.SelectedProtocol.UNKNOWN
.protected void decode(ChannelHandlerContext ctx, ByteBuf in, List<Object> out) throws Exception
ByteToMessageDecoder
ByteBuf
to an other. This method will be called till either the input
ByteBuf
has nothing to read when return from this method or till nothing was read from the input
ByteBuf
.decode
in class ByteToMessageDecoder
ctx
- the ChannelHandlerContext
which this ByteToMessageDecoder
belongs toin
- the ByteBuf
from which to read dataout
- the List
to which decoded messages should be addedException
- is thrown if an error accourprotected void addHttp2Handlers(ChannelHandlerContext ctx)
ChannelHandler
's that are needed for HTTP_2.protected void addHttpHandlers(ChannelHandlerContext ctx)
ChannelHandler
's that are needed for HTTP.protected abstract ChannelHandler createHttp1RequestHandler()
ChannelHandler
that is responsible for handling the http
requests when the Http2OrHttpChooser.SelectedProtocol
was Http2OrHttpChooser.SelectedProtocol.HTTP_1_0
or
Http2OrHttpChooser.SelectedProtocol.HTTP_1_1
protected abstract Http2ConnectionHandler createHttp2RequestHandler()
ChannelHandler
that is responsible for handling the http responses
when the when the Http2OrHttpChooser.SelectedProtocol
was Http2OrHttpChooser.SelectedProtocol.HTTP_2
.Copyright © 2008–2015 The Netty Project. All rights reserved.