public abstract class SpdyOrHttpChooser extends ByteToMessageDecoder
ChannelInboundHandler
which is responsible to setup the ChannelPipeline
either for
HTTP or SPDY. 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 |
SpdyOrHttpChooser.SelectedProtocol |
ByteToMessageDecoder.Cumulator
ChannelHandler.Sharable
COMPOSITE_CUMULATOR, MERGE_CUMULATOR
Modifier | Constructor and Description |
---|---|
protected |
SpdyOrHttpChooser(int maxSpdyContentLength,
int maxHttpContentLength) |
actualReadableBytes, callDecode, channelInactive, channelRead, channelReadComplete, decodeLast, discardSomeReadBytes, handlerRemoved, handlerRemoved0, internalBuffer, isSingleDecode, setCumulator, setSingleDecode
channelActive, channelRegistered, channelUnregistered, channelWritabilityChanged, exceptionCaught, userEventTriggered
handlerAdded, isSharable
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
handlerAdded
protected SpdyOrHttpChooser(int maxSpdyContentLength, int maxHttpContentLength)
protected SpdyOrHttpChooser.SelectedProtocol getProtocol(SSLEngine engine)
SpdyOrHttpChooser.SelectedProtocol
for the SSLEngine
. If its not known yet implementations MUST return
SpdyOrHttpChooser.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 addSpdyHandlers(ChannelHandlerContext ctx, SpdyVersion version)
ChannelHandler
's that are needed for SPDY with the given version.protected void addHttpHandlers(ChannelHandlerContext ctx)
ChannelHandler
's that are needed for HTTP.protected abstract ChannelInboundHandler createHttpRequestHandlerForHttp()
ChannelInboundHandler
that is responsible for handling the http requests
when the SpdyOrHttpChooser.SelectedProtocol
was SpdyOrHttpChooser.SelectedProtocol.HTTP_1_0
or
SpdyOrHttpChooser.SelectedProtocol.HTTP_1_1
protected ChannelInboundHandler createHttpRequestHandlerForSpdy()
ChannelInboundHandler
that is responsible for handling the http responses
when the SpdyOrHttpChooser.SelectedProtocol
was SpdyOrHttpChooser.SelectedProtocol.SPDY_3_1
.
By default this getMethod will just delecate to createHttpRequestHandlerForHttp()
, but sub-classes may
override this to change the behaviour.Copyright © 2008–2015 The Netty Project. All rights reserved.