Class SpdyHttpResponseStreamIdHandler
java.lang.Object
io.netty.channel.ChannelHandlerAdapter
io.netty.channel.ChannelInboundHandlerAdapter
io.netty.channel.ChannelDuplexHandler
io.netty.handler.codec.MessageToMessageCodec<java.lang.Object, HttpMessage>
io.netty.handler.codec.spdy.SpdyHttpResponseStreamIdHandler
- All Implemented Interfaces:
ChannelHandler, ChannelInboundHandler, ChannelOutboundHandler
public class SpdyHttpResponseStreamIdHandler
extends MessageToMessageCodec<java.lang.Object, HttpMessage>
MessageToMessageCodec that takes care of adding the right SpdyHttpHeaders.Names.STREAM_ID to the
HttpMessage if one is not present. This makes it possible to just re-use plan handlers current used
for HTTP.-
Nested Class Summary
Nested classes/interfaces inherited from interface ChannelHandler
ChannelHandler.Sharable -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanacceptInboundMessage(java.lang.Object msg) Returnstrueif and only if the specified message can be decoded by this codec.protected voiddecode(ChannelHandlerContext ctx, java.lang.Object msg, java.util.List<java.lang.Object> out) protected voidencode(ChannelHandlerContext ctx, HttpMessage msg, java.util.List<java.lang.Object> out) Methods inherited from class MessageToMessageCodec
acceptOutboundMessage, channelRead, channelReadComplete, writeMethods inherited from class ChannelDuplexHandler
bind, close, connect, deregister, disconnect, flush, readMethods inherited from class ChannelInboundHandlerAdapter
channelActive, channelInactive, channelRegistered, channelUnregistered, channelWritabilityChanged, exceptionCaught, userEventTriggeredMethods inherited from class ChannelHandlerAdapter
ensureNotSharable, handlerAdded, handlerRemoved, isSharableMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface ChannelHandler
handlerAdded, handlerRemoved
-
Field Details
-
NO_ID
private static final java.lang.Integer NO_ID -
ids
private final java.util.Queue<java.lang.Integer> ids
-
-
Constructor Details
-
SpdyHttpResponseStreamIdHandler
public SpdyHttpResponseStreamIdHandler()
-
-
Method Details
-
acceptInboundMessage
public boolean acceptInboundMessage(java.lang.Object msg) throws java.lang.Exception Description copied from class:MessageToMessageCodecReturnstrueif and only if the specified message can be decoded by this codec.- Overrides:
acceptInboundMessagein classMessageToMessageCodec<java.lang.Object, HttpMessage>- Parameters:
msg- the message- Throws:
java.lang.Exception
-
encode
protected void encode(ChannelHandlerContext ctx, HttpMessage msg, java.util.List<java.lang.Object> out) throws java.lang.Exception - Specified by:
encodein classMessageToMessageCodec<java.lang.Object, HttpMessage>- Throws:
java.lang.Exception- See Also:
-
decode
protected void decode(ChannelHandlerContext ctx, java.lang.Object msg, java.util.List<java.lang.Object> out) throws java.lang.Exception - Specified by:
decodein classMessageToMessageCodec<java.lang.Object, HttpMessage>- Throws:
java.lang.Exception- See Also:
-