public class SpdyFrameCodec extends ByteToMessageDecoder implements SpdyFrameDecoderDelegate, ChannelOutboundHandler
ChannelHandler that encodes and decodes SPDY Frames.ByteToMessageDecoder.CumulatorChannelHandler.SharableCOMPOSITE_CUMULATOR, MERGE_CUMULATOR| 限定符 | 构造器和说明 |
|---|---|
|
SpdyFrameCodec(SpdyVersion version)
Creates a new instance with the specified
version,
validateHeaders (true), and
the default decoder and encoder options
(maxChunkSize (8192), maxHeaderSize (16384),
compressionLevel (6), windowBits (15),
and memLevel (8)). |
|
SpdyFrameCodec(SpdyVersion version,
boolean validateHeaders)
Creates a new instance with the specified
version,
validateHeaders, and
the default decoder and encoder options
(maxChunkSize (8192), maxHeaderSize (16384),
compressionLevel (6), windowBits (15),
and memLevel (8)). |
|
SpdyFrameCodec(SpdyVersion version,
int maxChunkSize,
int maxHeaderSize,
int compressionLevel,
int windowBits,
int memLevel)
Creates a new instance with the specified
version, validateHeaders (true),
decoder and encoder options. |
|
SpdyFrameCodec(SpdyVersion version,
int maxChunkSize,
int maxHeaderSize,
int compressionLevel,
int windowBits,
int memLevel,
boolean validateHeaders)
Creates a new instance with the specified
version, validateHeaders,
decoder and encoder options. |
protected |
SpdyFrameCodec(SpdyVersion version,
int maxChunkSize,
SpdyHeaderBlockDecoder spdyHeaderBlockDecoder,
SpdyHeaderBlockEncoder spdyHeaderBlockEncoder,
boolean validateHeaders) |
| 限定符和类型 | 方法和说明 |
|---|---|
void |
bind(ChannelHandlerContext ctx,
java.net.SocketAddress localAddress,
ChannelPromise promise)
Called once a bind operation is made.
|
void |
channelReadComplete(ChannelHandlerContext ctx)
Calls
ChannelHandlerContext.fireChannelReadComplete() to forward
to the next ChannelInboundHandler in the ChannelPipeline. |
void |
close(ChannelHandlerContext ctx,
ChannelPromise promise)
Called once a close operation is made.
|
void |
connect(ChannelHandlerContext ctx,
java.net.SocketAddress remoteAddress,
java.net.SocketAddress localAddress,
ChannelPromise promise)
Called once a connect operation is made.
|
protected void |
decode(ChannelHandlerContext ctx,
ByteBuf in,
java.util.List<java.lang.Object> out)
Decode the from one
ByteBuf to an other. |
void |
deregister(ChannelHandlerContext ctx,
ChannelPromise promise)
Called once a deregister operation is made from the current registered
EventLoop. |
void |
disconnect(ChannelHandlerContext ctx,
ChannelPromise promise)
Called once a disconnect operation is made.
|
void |
flush(ChannelHandlerContext ctx)
Called once a flush operation is made.
|
void |
handlerAdded(ChannelHandlerContext ctx)
Do nothing by default, sub-classes may override this method.
|
void |
read(ChannelHandlerContext ctx)
Intercepts
ChannelHandlerContext.read(). |
void |
readDataFrame(int streamId,
boolean last,
ByteBuf data)
Called when a DATA frame is received.
|
void |
readFrameError(java.lang.String message)
Called when an unrecoverable session error has occurred.
|
void |
readGoAwayFrame(int lastGoodStreamId,
int statusCode)
Called when a GOAWAY frame is received.
|
void |
readHeaderBlock(ByteBuf headerBlock)
Called when the header block within a SYN_STREAM, SYN_REPLY, or HEADERS frame is received.
|
void |
readHeaderBlockEnd()
Called when an entire header block has been received.
|
void |
readHeadersFrame(int streamId,
boolean last)
Called when a HEADERS frame is received.
|
void |
readPingFrame(int id)
Called when a PING frame is received.
|
void |
readRstStreamFrame(int streamId,
int statusCode)
Called when a RST_STREAM frame is received.
|
void |
readSetting(int id,
int value,
boolean persistValue,
boolean persisted)
Called when an individual setting within a SETTINGS frame is received.
|
void |
readSettingsEnd()
Called when the entire SETTINGS frame has been received.
|
void |
readSettingsFrame(boolean clearPersisted)
Called when a SETTINGS frame is received.
|
void |
readSynReplyFrame(int streamId,
boolean last)
Called when a SYN_REPLY frame is received.
|
void |
readSynStreamFrame(int streamId,
int associatedToStreamId,
byte priority,
boolean last,
boolean unidirectional)
Called when a SYN_STREAM frame is received.
|
void |
readWindowUpdateFrame(int streamId,
int deltaWindowSize)
Called when a WINDOW_UPDATE frame is received.
|
void |
write(ChannelHandlerContext ctx,
java.lang.Object msg,
ChannelPromise promise)
Called once a write operation is made.
|
actualReadableBytes, callDecode, channelInactive, channelRead, decodeLast, discardSomeReadBytes, handlerRemoved, handlerRemoved0, internalBuffer, isSingleDecode, setCumulator, setDiscardAfterReads, setSingleDecode, userEventTriggeredchannelActive, channelRegistered, channelUnregistered, channelWritabilityChanged, exceptionCaughtensureNotSharable, isSharableclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitexceptionCaught, handlerRemovedpublic SpdyFrameCodec(SpdyVersion version)
version,
validateHeaders (true), and
the default decoder and encoder options
(maxChunkSize (8192), maxHeaderSize (16384),
compressionLevel (6), windowBits (15),
and memLevel (8)).public SpdyFrameCodec(SpdyVersion version, boolean validateHeaders)
version,
validateHeaders, and
the default decoder and encoder options
(maxChunkSize (8192), maxHeaderSize (16384),
compressionLevel (6), windowBits (15),
and memLevel (8)).public SpdyFrameCodec(SpdyVersion version, int maxChunkSize, int maxHeaderSize, int compressionLevel, int windowBits, int memLevel)
version, validateHeaders (true),
decoder and encoder options.public SpdyFrameCodec(SpdyVersion version, int maxChunkSize, int maxHeaderSize, int compressionLevel, int windowBits, int memLevel, boolean validateHeaders)
version, validateHeaders,
decoder and encoder options.protected SpdyFrameCodec(SpdyVersion version, int maxChunkSize, SpdyHeaderBlockDecoder spdyHeaderBlockDecoder, SpdyHeaderBlockEncoder spdyHeaderBlockEncoder, boolean validateHeaders)
public void handlerAdded(ChannelHandlerContext ctx) throws java.lang.Exception
ChannelHandlerAdapterhandlerAdded 在接口中 ChannelHandlerhandlerAdded 在类中 ChannelHandlerAdapterjava.lang.Exceptionprotected void decode(ChannelHandlerContext ctx, ByteBuf in, java.util.List<java.lang.Object> out) throws java.lang.Exception
ByteToMessageDecoderByteBuf 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 在类中 ByteToMessageDecoderctx - 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 occurspublic void channelReadComplete(ChannelHandlerContext ctx) throws java.lang.Exception
ChannelInboundHandlerAdapterChannelHandlerContext.fireChannelReadComplete() to forward
to the next ChannelInboundHandler in the ChannelPipeline.
Sub-classes may override this method to change behavior.channelReadComplete 在接口中 ChannelInboundHandlerchannelReadComplete 在类中 ByteToMessageDecoderjava.lang.Exceptionpublic void bind(ChannelHandlerContext ctx, java.net.SocketAddress localAddress, ChannelPromise promise) throws java.lang.Exception
ChannelOutboundHandlerbind 在接口中 ChannelOutboundHandlerctx - the ChannelHandlerContext for which the bind operation is madelocalAddress - the SocketAddress to which it should boundpromise - the ChannelPromise to notify once the operation completesjava.lang.Exception - thrown if an error occurspublic void connect(ChannelHandlerContext ctx, java.net.SocketAddress remoteAddress, java.net.SocketAddress localAddress, ChannelPromise promise) throws java.lang.Exception
ChannelOutboundHandlerconnect 在接口中 ChannelOutboundHandlerctx - the ChannelHandlerContext for which the connect operation is maderemoteAddress - the SocketAddress to which it should connectlocalAddress - the SocketAddress which is used as source on connectpromise - the ChannelPromise to notify once the operation completesjava.lang.Exception - thrown if an error occurspublic void disconnect(ChannelHandlerContext ctx, ChannelPromise promise) throws java.lang.Exception
ChannelOutboundHandlerdisconnect 在接口中 ChannelOutboundHandlerctx - the ChannelHandlerContext for which the disconnect operation is madepromise - the ChannelPromise to notify once the operation completesjava.lang.Exception - thrown if an error occurspublic void close(ChannelHandlerContext ctx, ChannelPromise promise) throws java.lang.Exception
ChannelOutboundHandlerclose 在接口中 ChannelOutboundHandlerctx - the ChannelHandlerContext for which the close operation is madepromise - the ChannelPromise to notify once the operation completesjava.lang.Exception - thrown if an error occurspublic void deregister(ChannelHandlerContext ctx, ChannelPromise promise) throws java.lang.Exception
ChannelOutboundHandlerEventLoop.deregister 在接口中 ChannelOutboundHandlerctx - the ChannelHandlerContext for which the close operation is madepromise - the ChannelPromise to notify once the operation completesjava.lang.Exception - thrown if an error occurspublic void read(ChannelHandlerContext ctx) throws java.lang.Exception
ChannelOutboundHandlerChannelHandlerContext.read().read 在接口中 ChannelOutboundHandlerjava.lang.Exceptionpublic void flush(ChannelHandlerContext ctx) throws java.lang.Exception
ChannelOutboundHandlerflush 在接口中 ChannelOutboundHandlerctx - the ChannelHandlerContext for which the flush operation is madejava.lang.Exception - thrown if an error occurspublic void write(ChannelHandlerContext ctx, java.lang.Object msg, ChannelPromise promise) throws java.lang.Exception
ChannelOutboundHandlerChannelPipeline. Those are then ready to be flushed to the actual Channel once
Channel.flush() is calledwrite 在接口中 ChannelOutboundHandlerctx - the ChannelHandlerContext for which the write operation is mademsg - the message to writepromise - the ChannelPromise to notify once the operation completesjava.lang.Exception - thrown if an error occurspublic void readDataFrame(int streamId,
boolean last,
ByteBuf data)
SpdyFrameDecoderDelegatereadDataFrame 在接口中 SpdyFrameDecoderDelegatepublic void readSynStreamFrame(int streamId,
int associatedToStreamId,
byte priority,
boolean last,
boolean unidirectional)
SpdyFrameDecoderDelegatereadSynStreamFrame 在接口中 SpdyFrameDecoderDelegatepublic void readSynReplyFrame(int streamId,
boolean last)
SpdyFrameDecoderDelegatereadSynReplyFrame 在接口中 SpdyFrameDecoderDelegatepublic void readRstStreamFrame(int streamId,
int statusCode)
SpdyFrameDecoderDelegatereadRstStreamFrame 在接口中 SpdyFrameDecoderDelegatepublic void readSettingsFrame(boolean clearPersisted)
SpdyFrameDecoderDelegatereadSettingsFrame 在接口中 SpdyFrameDecoderDelegatepublic void readSetting(int id,
int value,
boolean persistValue,
boolean persisted)
SpdyFrameDecoderDelegatereadSetting 在接口中 SpdyFrameDecoderDelegatepublic void readSettingsEnd()
SpdyFrameDecoderDelegatereadSettingsEnd 在接口中 SpdyFrameDecoderDelegatepublic void readPingFrame(int id)
SpdyFrameDecoderDelegatereadPingFrame 在接口中 SpdyFrameDecoderDelegatepublic void readGoAwayFrame(int lastGoodStreamId,
int statusCode)
SpdyFrameDecoderDelegatereadGoAwayFrame 在接口中 SpdyFrameDecoderDelegatepublic void readHeadersFrame(int streamId,
boolean last)
SpdyFrameDecoderDelegatereadHeadersFrame 在接口中 SpdyFrameDecoderDelegatepublic void readWindowUpdateFrame(int streamId,
int deltaWindowSize)
SpdyFrameDecoderDelegatepublic void readHeaderBlock(ByteBuf headerBlock)
SpdyFrameDecoderDelegatereadHeaderBlock 在接口中 SpdyFrameDecoderDelegatepublic void readHeaderBlockEnd()
SpdyFrameDecoderDelegatereadHeaderBlockEnd 在接口中 SpdyFrameDecoderDelegatepublic void readFrameError(java.lang.String message)
SpdyFrameDecoderDelegatereadFrameError 在接口中 SpdyFrameDecoderDelegate