Class SpdyOrHttpChooser
- java.lang.Object
-
- org.jboss.netty.handler.codec.spdy.SpdyOrHttpChooser
-
- All Implemented Interfaces:
ChannelHandler,ChannelUpstreamHandler
public abstract class SpdyOrHttpChooser extends java.lang.Object implements ChannelUpstreamHandler
ChannelUpstreamHandlerwhich is responsible to setup theChannelPipelineeither 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.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classSpdyOrHttpChooser.SelectedProtocol-
Nested classes/interfaces inherited from interface org.jboss.netty.channel.ChannelHandler
ChannelHandler.Sharable
-
-
Field Summary
Fields Modifier and Type Field Description private intmaxHttpContentLengthprivate intmaxSpdyContentLength
-
Constructor Summary
Constructors Modifier Constructor Description protectedSpdyOrHttpChooser(int maxSpdyContentLength, int maxHttpContentLength)
-
Method Summary
-
-
-
Method Detail
-
getProtocol
protected abstract SpdyOrHttpChooser.SelectedProtocol getProtocol(javax.net.ssl.SSLEngine engine)
Return theSpdyOrHttpChooser.SelectedProtocolfor theSSLEngine. If its not known yet implementations MUST returnSpdyOrHttpChooser.SelectedProtocol.None.
-
handleUpstream
public void handleUpstream(ChannelHandlerContext ctx, ChannelEvent e) throws java.lang.Exception
Description copied from interface:ChannelUpstreamHandlerHandles the specified upstream event.- Specified by:
handleUpstreamin interfaceChannelUpstreamHandler- Parameters:
ctx- the context object for this handlere- the upstream event to process or intercept- Throws:
java.lang.Exception
-
addSpdyHandlers
protected void addSpdyHandlers(ChannelHandlerContext ctx, SpdyVersion version)
Add allChannelHandler's that are needed for SPDY with the given version.
-
addHttpHandlers
protected void addHttpHandlers(ChannelHandlerContext ctx)
Add allChannelHandler's that are needed for HTTP.
-
createHttpRequestHandlerForHttp
protected abstract ChannelUpstreamHandler createHttpRequestHandlerForHttp()
Create theChannelUpstreamHandlerthat is responsible for handling theHttpRequest's when theSpdyOrHttpChooser.SelectedProtocolwasSpdyOrHttpChooser.SelectedProtocol.HttpVersion1_0orSpdyOrHttpChooser.SelectedProtocol.HttpVersion1_1
-
createHttpRequestHandlerForSpdy
protected ChannelUpstreamHandler createHttpRequestHandlerForSpdy()
Create theChannelUpstreamHandlerthat is responsible for handling theHttpRequest's when theSpdyOrHttpChooser.SelectedProtocolwasSpdyOrHttpChooser.SelectedProtocol.SpdyVersion3_1. By default this method will just delecate tocreateHttpRequestHandlerForHttp(), but sub-classes may override this to change the behaviour.
-
-