public abstract class SpdyOrHttpChooser
extends io.netty.handler.codec.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 |
| Modifier | Constructor and Description |
|---|---|
protected |
SpdyOrHttpChooser(int maxSpdyContentLength,
int maxHttpContentLength) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
addHttpHandlers(io.netty.channel.ChannelHandlerContext ctx)
Add all
ChannelHandler's that are needed for HTTP. |
protected void |
addSpdyHandlers(io.netty.channel.ChannelHandlerContext ctx,
int version)
Add all
ChannelHandler's that are needed for SPDY with the given version. |
protected abstract io.netty.channel.ChannelInboundHandler |
createHttpRequestHandlerForHttp()
Create the
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 io.netty.channel.ChannelInboundHandler |
createHttpRequestHandlerForSpdy()
Create the
ChannelInboundHandler that is responsible for handling the http responses
when the SpdyOrHttpChooser.SelectedProtocol was SpdyOrHttpChooser.SelectedProtocol.SPDY_2 or
SpdyOrHttpChooser.SelectedProtocol.SPDY_3. |
protected void |
decode(io.netty.channel.ChannelHandlerContext ctx,
io.netty.buffer.ByteBuf in,
List<Object> out) |
protected abstract SpdyOrHttpChooser.SelectedProtocol |
getProtocol(SSLEngine engine)
Return the
SpdyOrHttpChooser.SelectedProtocol for the SSLEngine. |
actualReadableBytes, callDecode, channelInactive, channelRead, channelReadComplete, decodeLast, handlerRemoved, handlerRemoved0, internalBuffer, isSingleDecode, setSingleDecodechannelActive, channelRegistered, channelUnregistered, channelWritabilityChanged, exceptionCaught, userEventTriggeredprotected SpdyOrHttpChooser(int maxSpdyContentLength,
int maxHttpContentLength)
protected abstract SpdyOrHttpChooser.SelectedProtocol getProtocol(SSLEngine engine)
SpdyOrHttpChooser.SelectedProtocol for the SSLEngine. If its not known yet implementations
MUST return SpdyOrHttpChooser.SelectedProtocol.UNKNOWN.protected void decode(io.netty.channel.ChannelHandlerContext ctx,
io.netty.buffer.ByteBuf in,
List<Object> out)
throws Exception
decode in class io.netty.handler.codec.ByteToMessageDecoderExceptionprotected void addSpdyHandlers(io.netty.channel.ChannelHandlerContext ctx,
int version)
ChannelHandler's that are needed for SPDY with the given version.protected void addHttpHandlers(io.netty.channel.ChannelHandlerContext ctx)
ChannelHandler's that are needed for HTTP.protected abstract io.netty.channel.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_1protected io.netty.channel.ChannelInboundHandler createHttpRequestHandlerForSpdy()
ChannelInboundHandler that is responsible for handling the http responses
when the SpdyOrHttpChooser.SelectedProtocol was SpdyOrHttpChooser.SelectedProtocol.SPDY_2 or
SpdyOrHttpChooser.SelectedProtocol.SPDY_3.
By default this getMethod will just delecate to createHttpRequestHandlerForHttp(), but
sub-classes may override this to change the behaviour.Copyright © 2008–2013 The Netty Project. All rights reserved.