ApplicationProtocolNegotiationHandler
instead.public abstract class SpdyOrHttpChooser extends ByteToMessageDecoder
限定符和类型 | 类和说明 |
---|---|
static class |
SpdyOrHttpChooser.SelectedProtocol
已过时。
|
ByteToMessageDecoder.Cumulator
ChannelHandler.Sharable
COMPOSITE_CUMULATOR, MERGE_CUMULATOR
限定符 | 构造器和说明 |
---|---|
protected |
SpdyOrHttpChooser()
已过时。
|
限定符和类型 | 方法和说明 |
---|---|
protected abstract void |
configureHttp1(ChannelHandlerContext ctx)
已过时。
Configures the
Channel of the specified ctx for HTTP/1. |
protected abstract void |
configureSpdy(ChannelHandlerContext ctx,
SpdyVersion version)
已过时。
Configures the
Channel of the specified ctx for HTTP/2. |
protected void |
decode(ChannelHandlerContext ctx,
ByteBuf in,
java.util.List<java.lang.Object> out)
已过时。
Decode the from one
ByteBuf to an other. |
void |
exceptionCaught(ChannelHandlerContext ctx,
java.lang.Throwable cause)
已过时。
Calls
ChannelHandlerContext.fireExceptionCaught(Throwable) to forward
to the next ChannelHandler in the ChannelPipeline . |
protected SpdyOrHttpChooser.SelectedProtocol |
selectProtocol(SslHandler sslHandler)
已过时。
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
在类中 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
在接口中 ChannelHandler
exceptionCaught
在接口中 ChannelInboundHandler
exceptionCaught
在类中 ChannelInboundHandlerAdapter
java.lang.Exception