public abstract class SpdyOrHttpChooser extends java.lang.Object implements 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.| 限定符和类型 | 类和说明 |
|---|---|
static class |
SpdyOrHttpChooser.SelectedProtocol |
ChannelHandler.Sharable| 限定符 | 构造器和说明 |
|---|---|
protected |
SpdyOrHttpChooser(int maxSpdyContentLength,
int maxHttpContentLength) |
protected SpdyOrHttpChooser(int maxSpdyContentLength,
int maxHttpContentLength)
protected abstract SpdyOrHttpChooser.SelectedProtocol getProtocol(javax.net.ssl.SSLEngine engine)
SpdyOrHttpChooser.SelectedProtocol for the SSLEngine. If its not known yet implementations
MUST return SpdyOrHttpChooser.SelectedProtocol.None.public void handleUpstream(ChannelHandlerContext ctx, ChannelEvent e) throws java.lang.Exception
ChannelUpstreamHandlerhandleUpstream 在接口中 ChannelUpstreamHandlerctx - the context object for this handlere - the upstream event to process or interceptjava.lang.Exceptionprotected void addSpdyHandlers(ChannelHandlerContext ctx, SpdyVersion 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 ChannelUpstreamHandler createHttpRequestHandlerForHttp()
ChannelUpstreamHandler that is responsible for handling the HttpRequest's
when the SpdyOrHttpChooser.SelectedProtocol was SpdyOrHttpChooser.SelectedProtocol.HttpVersion1_0 or
SpdyOrHttpChooser.SelectedProtocol.HttpVersion1_1protected ChannelUpstreamHandler createHttpRequestHandlerForSpdy()
ChannelUpstreamHandler that is responsible for handling the HttpRequest's
when the SpdyOrHttpChooser.SelectedProtocol was SpdyOrHttpChooser.SelectedProtocol.SpdyVersion3_1.
By default this method will just delecate to createHttpRequestHandlerForHttp(), but
sub-classes may override this to change the behaviour.