ApplicationProtocolNegotiationHandler
instead.public abstract class SpdyOrHttpChooser extends ByteToMessageDecoder
Modifier and Type | Class and Description |
---|---|
static class |
SpdyOrHttpChooser.SelectedProtocol
Deprecated.
|
ByteToMessageDecoder.Cumulator
ChannelHandler.Sharable
COMPOSITE_CUMULATOR, MERGE_CUMULATOR
Modifier | Constructor and Description |
---|---|
protected |
SpdyOrHttpChooser()
Deprecated.
|
Modifier and Type | Method and Description |
---|---|
protected abstract void |
configureHttp1(ChannelHandlerContext ctx)
Deprecated.
Configures the
Channel of the specified ctx for HTTP/1. |
protected abstract void |
configureSpdy(ChannelHandlerContext ctx,
SpdyVersion version)
Deprecated.
Configures the
Channel of the specified ctx for HTTP/2. |
protected void |
decode(ChannelHandlerContext ctx,
ByteBuf in,
java.util.List<java.lang.Object> out)
Deprecated.
Decode the from one
ByteBuf to an other. |
void |
exceptionCaught(ChannelHandlerContext ctx,
java.lang.Throwable cause)
Deprecated.
Calls
ChannelHandlerContext.fireExceptionCaught(Throwable) to forward
to the next ChannelHandler in the ChannelPipeline . |
protected SpdyOrHttpChooser.SelectedProtocol |
selectProtocol(SslHandler sslHandler)
Deprecated.
Returns the
SpdyOrHttpChooser.SelectedProtocol for the current SSL session. |
actualReadableBytes, callDecode, channelInactive, channelRead, channelReadComplete, decodeLast, discardSomeReadBytes, handlerRemoved, handlerRemoved0, internalBuffer, isSingleDecode, setCumulator, setDiscardAfterReads, setSingleDecode, userEventTriggered
channelActive, channelRegistered, channelUnregistered, channelWritabilityChanged
ensureNotSharable, handlerAdded, isSharable
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
handlerAdded
protected void decode(ChannelHandlerContext ctx, ByteBuf in, java.util.List<java.lang.Object> out) throws java.lang.Exception
ByteToMessageDecoder
ByteBuf
to an other. This method will be called till either the input
ByteBuf
has nothing to read when return from this method or till nothing was read from the input
ByteBuf
.decode
in class ByteToMessageDecoder
ctx
- the ChannelHandlerContext
which this ByteToMessageDecoder
belongs toin
- the ByteBuf
from which to read dataout
- the List
to which decoded messages should be addedjava.lang.Exception
- is thrown if an error occursprotected SpdyOrHttpChooser.SelectedProtocol selectProtocol(SslHandler sslHandler) throws java.lang.Exception
SpdyOrHttpChooser.SelectedProtocol
for the current SSL session. By default, this method returns the first
known protocol.null
if the application-level protocol name of
the specified sslHandler
is neither "http/1.1"
, "http/1.0"
nor "spdy/3.1"
java.lang.Exception
protected abstract void configureSpdy(ChannelHandlerContext ctx, SpdyVersion version) throws java.lang.Exception
Channel
of the specified ctx
for HTTP/2.
A typical implementation of this method will look like the following:
ChannelPipeline
p = ctx.pipeline(); p.addLast(newSpdyFrameCodec
(version)); p.addLast(newSpdySessionHandler
(version, true)); p.addLast(newSpdyHttpEncoder
(version)); p.addLast(newSpdyHttpDecoder
(version, maxSpdyContentLength)); p.addLast(newSpdyHttpResponseStreamIdHandler
()); p.addLast(new YourHttpRequestHandler());
java.lang.Exception
protected abstract void configureHttp1(ChannelHandlerContext ctx) throws java.lang.Exception
Channel
of the specified ctx
for HTTP/1.
A typical implementation of this method will look like the following:
ChannelPipeline
p = ctx.pipeline(); p.addLast(newHttpServerCodec
()); p.addLast(new YourHttpRequestHandler());
java.lang.Exception
public void exceptionCaught(ChannelHandlerContext ctx, java.lang.Throwable cause) throws java.lang.Exception
ChannelInboundHandlerAdapter
ChannelHandlerContext.fireExceptionCaught(Throwable)
to forward
to the next ChannelHandler
in the ChannelPipeline
.
Sub-classes may override this method to change behavior.exceptionCaught
in interface ChannelHandler
exceptionCaught
in interface ChannelInboundHandler
exceptionCaught
in class ChannelInboundHandlerAdapter
java.lang.Exception
Copyright © 2008–2018 The Netty Project. All rights reserved.