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
ChannelUpstreamHandler
which is responsible to setup theChannelPipeline
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.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
SpdyOrHttpChooser.SelectedProtocol
-
Nested classes/interfaces inherited from interface org.jboss.netty.channel.ChannelHandler
ChannelHandler.Sharable
-
-
Field Summary
Fields Modifier and Type Field Description private int
maxHttpContentLength
private int
maxSpdyContentLength
-
Constructor Summary
Constructors Modifier Constructor Description protected
SpdyOrHttpChooser(int maxSpdyContentLength, int maxHttpContentLength)
-
Method Summary
-
-
-
Method Detail
-
getProtocol
protected abstract SpdyOrHttpChooser.SelectedProtocol getProtocol(javax.net.ssl.SSLEngine engine)
Return theSpdyOrHttpChooser.SelectedProtocol
for 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:ChannelUpstreamHandler
Handles the specified upstream event.- Specified by:
handleUpstream
in 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 theChannelUpstreamHandler
that is responsible for handling theHttpRequest
's when theSpdyOrHttpChooser.SelectedProtocol
wasSpdyOrHttpChooser.SelectedProtocol.HttpVersion1_0
orSpdyOrHttpChooser.SelectedProtocol.HttpVersion1_1
-
createHttpRequestHandlerForSpdy
protected ChannelUpstreamHandler createHttpRequestHandlerForSpdy()
Create theChannelUpstreamHandler
that is responsible for handling theHttpRequest
's when theSpdyOrHttpChooser.SelectedProtocol
wasSpdyOrHttpChooser.SelectedProtocol.SpdyVersion3_1
. By default this method will just delecate tocreateHttpRequestHandlerForHttp()
, but sub-classes may override this to change the behaviour.
-
-