public class SpdyHttpDecoder extends MessageToMessageDecoder<SpdyFrame>
SpdySynStreamFrame
s, SpdySynReplyFrame
s,
and SpdyDataFrame
s into FullHttpRequest
s and FullHttpResponse
s.ChannelHandler.Sharable
限定符 | 构造器和说明 |
---|---|
|
SpdyHttpDecoder(SpdyVersion version,
int maxContentLength)
Creates a new instance.
|
|
SpdyHttpDecoder(SpdyVersion version,
int maxContentLength,
boolean validateHeaders)
已过时。
Use the
SpdyHttpDecoder(SpdyVersion, int, Map, HttpHeadersFactory, HttpHeadersFactory)
constructor instead. |
protected |
SpdyHttpDecoder(SpdyVersion version,
int maxContentLength,
java.util.Map<java.lang.Integer,FullHttpMessage> messageMap)
Creates a new instance with the specified parameters.
|
protected |
SpdyHttpDecoder(SpdyVersion version,
int maxContentLength,
java.util.Map<java.lang.Integer,FullHttpMessage> messageMap,
boolean validateHeaders)
已过时。
Use the
SpdyHttpDecoder(SpdyVersion, int, Map, HttpHeadersFactory, HttpHeadersFactory)
constructor instead. |
protected |
SpdyHttpDecoder(SpdyVersion version,
int maxContentLength,
java.util.Map<java.lang.Integer,FullHttpMessage> messageMap,
HttpHeadersFactory headersFactory,
HttpHeadersFactory trailersFactory)
Creates a new instance with the specified parameters.
|
限定符和类型 | 方法和说明 |
---|---|
void |
channelInactive(ChannelHandlerContext ctx)
Calls
ChannelHandlerContext.fireChannelInactive() to forward
to the next ChannelInboundHandler in the ChannelPipeline . |
protected void |
decode(ChannelHandlerContext ctx,
SpdyFrame msg,
java.util.List<java.lang.Object> out)
Decode from one message to an other.
|
protected FullHttpMessage |
getMessage(int streamId) |
protected FullHttpMessage |
putMessage(int streamId,
FullHttpMessage message) |
protected FullHttpMessage |
removeMessage(int streamId) |
acceptInboundMessage, channelRead
channelActive, channelReadComplete, channelRegistered, channelUnregistered, channelWritabilityChanged, exceptionCaught, userEventTriggered
ensureNotSharable, handlerAdded, handlerRemoved, isSharable
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
handlerAdded, handlerRemoved
public SpdyHttpDecoder(SpdyVersion version, int maxContentLength)
version
- the protocol versionmaxContentLength
- the maximum length of the message content.
If the length of the message content exceeds this value,
a TooLongFrameException
will be raised.@Deprecated public SpdyHttpDecoder(SpdyVersion version, int maxContentLength, boolean validateHeaders)
SpdyHttpDecoder(SpdyVersion, int, Map, HttpHeadersFactory, HttpHeadersFactory)
constructor instead.version
- the protocol versionmaxContentLength
- the maximum length of the message content.
If the length of the message content exceeds this value,
a TooLongFrameException
will be raised.validateHeaders
- true
if http headers should be validatedprotected SpdyHttpDecoder(SpdyVersion version, int maxContentLength, java.util.Map<java.lang.Integer,FullHttpMessage> messageMap)
version
- the protocol versionmaxContentLength
- the maximum length of the message content.
If the length of the message content exceeds this value,
a TooLongFrameException
will be raised.messageMap
- the Map
used to hold partially received messages.@Deprecated protected SpdyHttpDecoder(SpdyVersion version, int maxContentLength, java.util.Map<java.lang.Integer,FullHttpMessage> messageMap, boolean validateHeaders)
SpdyHttpDecoder(SpdyVersion, int, Map, HttpHeadersFactory, HttpHeadersFactory)
constructor instead.version
- the protocol versionmaxContentLength
- the maximum length of the message content.
If the length of the message content exceeds this value,
a TooLongFrameException
will be raised.messageMap
- the Map
used to hold partially received messages.validateHeaders
- true
if http headers should be validatedprotected SpdyHttpDecoder(SpdyVersion version, int maxContentLength, java.util.Map<java.lang.Integer,FullHttpMessage> messageMap, HttpHeadersFactory headersFactory, HttpHeadersFactory trailersFactory)
version
- the protocol versionmaxContentLength
- the maximum length of the message content.
If the length of the message content exceeds this value,
a TooLongFrameException
will be raised.messageMap
- the Map
used to hold partially received messages.headersFactory
- The factory used for creating HTTP headerstrailersFactory
- The factory used for creating HTTP trailers.public void channelInactive(ChannelHandlerContext ctx) throws java.lang.Exception
ChannelInboundHandlerAdapter
ChannelHandlerContext.fireChannelInactive()
to forward
to the next ChannelInboundHandler
in the ChannelPipeline
.
Sub-classes may override this method to change behavior.channelInactive
在接口中 ChannelInboundHandler
channelInactive
在类中 ChannelInboundHandlerAdapter
java.lang.Exception
protected FullHttpMessage putMessage(int streamId, FullHttpMessage message)
protected FullHttpMessage getMessage(int streamId)
protected FullHttpMessage removeMessage(int streamId)
protected void decode(ChannelHandlerContext ctx, SpdyFrame msg, java.util.List<java.lang.Object> out) throws java.lang.Exception
MessageToMessageDecoder
decode
在类中 MessageToMessageDecoder<SpdyFrame>
ctx
- the ChannelHandlerContext
which this MessageToMessageDecoder
belongs tomsg
- the message to decode to an other oneout
- the List
to which decoded messages should be addedjava.lang.Exception
- is thrown if an error occurs