public abstract class SpdyOrHttpChooser extends ChannelInboundHandlerAdapter
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 |
ChannelHandler.Sharable| Modifier | Constructor and Description |
|---|---|
protected |
SpdyOrHttpChooser(int maxSpdyContentLength,
int maxHttpContentLength) |
channelActive, channelInactive, channelReadComplete, channelRegistered, channelUnregistered, channelWritabilityChanged, userEventTriggeredexceptionCaught, handlerAdded, handlerRemovedclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitexceptionCaught, handlerAdded, handlerRemovedprotected 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.public void channelRead(ChannelHandlerContext ctx, Object msg) throws Exception
ChannelInboundHandlerAdapterChannelHandlerContext.fireChannelRead(Object) to forward
to the next ChannelInboundHandler in the ChannelPipeline.
Sub-classes may override this method to change behavior.channelRead in interface ChannelInboundHandlerchannelRead in class ChannelInboundHandlerAdapterExceptionprotected void addSpdyHandlers(ChannelHandlerContext ctx, int 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_1protected 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.
Bye 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.