Class SpdyOrHttpChooser
java.lang.Object
org.jboss.netty.handler.codec.spdy.SpdyOrHttpChooser
- All Implemented Interfaces:
ChannelHandler, ChannelUpstreamHandler
ChannelUpstreamHandler 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.-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from interface ChannelHandler
ChannelHandler.Sharable -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final intprivate final int -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedSpdyOrHttpChooser(int maxSpdyContentLength, int maxHttpContentLength) -
Method Summary
Modifier and TypeMethodDescriptionprotected voidAdd allChannelHandler's that are needed for HTTP.protected voidaddSpdyHandlers(ChannelHandlerContext ctx, SpdyVersion version) Add allChannelHandler's that are needed for SPDY with the given version.protected abstract ChannelUpstreamHandlerCreate theChannelUpstreamHandlerthat is responsible for handling theHttpRequest's when theSpdyOrHttpChooser.SelectedProtocolwasSpdyOrHttpChooser.SelectedProtocol.HttpVersion1_0orSpdyOrHttpChooser.SelectedProtocol.HttpVersion1_1protected ChannelUpstreamHandlerCreate theChannelUpstreamHandlerthat is responsible for handling theHttpRequest's when theSpdyOrHttpChooser.SelectedProtocolwasSpdyOrHttpChooser.SelectedProtocol.SpdyVersion3_1.protected abstract SpdyOrHttpChooser.SelectedProtocolgetProtocol(SSLEngine engine) Return theSpdyOrHttpChooser.SelectedProtocolfor theSSLEngine.voidHandles the specified upstream event.
-
Field Details
-
maxSpdyContentLength
private final int maxSpdyContentLength -
maxHttpContentLength
private final int maxHttpContentLength
-
-
Constructor Details
-
SpdyOrHttpChooser
protected SpdyOrHttpChooser(int maxSpdyContentLength, int maxHttpContentLength)
-
-
Method Details
-
getProtocol
Return theSpdyOrHttpChooser.SelectedProtocolfor theSSLEngine. If its not known yet implementations MUST returnSpdyOrHttpChooser.SelectedProtocol.None. -
handleUpstream
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:
Exception
-
addSpdyHandlers
Add allChannelHandler's that are needed for SPDY with the given version. -
addHttpHandlers
Add allChannelHandler's that are needed for HTTP. -
createHttpRequestHandlerForHttp
Create theChannelUpstreamHandlerthat is responsible for handling theHttpRequest's when theSpdyOrHttpChooser.SelectedProtocolwasSpdyOrHttpChooser.SelectedProtocol.HttpVersion1_0orSpdyOrHttpChooser.SelectedProtocol.HttpVersion1_1 -
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.
-