Class HttpPipeliningHandler
- java.lang.Object
-
- io.netty.channel.ChannelHandlerAdapter
-
- io.netty.channel.ChannelInboundHandlerAdapter
-
- io.netty.channel.ChannelDuplexHandler
-
- org.elasticsearch.http.netty4.pipelining.HttpPipeliningHandler
-
- All Implemented Interfaces:
io.netty.channel.ChannelHandler,io.netty.channel.ChannelInboundHandler,io.netty.channel.ChannelOutboundHandler
public class HttpPipeliningHandler extends io.netty.channel.ChannelDuplexHandlerImplements HTTP pipelining ordering, ensuring that responses are completely served in the same order as their corresponding requests.
-
-
Constructor Summary
Constructors Constructor Description HttpPipeliningHandler(org.apache.logging.log4j.Logger logger, int maxEventsHeld)Construct a new pipelining handler; this handler should be used downstream of HTTP decoding/aggregation.
-
Method Summary
Modifier and Type Method Description voidchannelRead(io.netty.channel.ChannelHandlerContext ctx, java.lang.Object msg)voidclose(io.netty.channel.ChannelHandlerContext ctx, io.netty.channel.ChannelPromise promise)voidwrite(io.netty.channel.ChannelHandlerContext ctx, java.lang.Object msg, io.netty.channel.ChannelPromise promise)-
Methods inherited from class io.netty.channel.ChannelDuplexHandler
bind, connect, deregister, disconnect, flush, read
-
Methods inherited from class io.netty.channel.ChannelInboundHandlerAdapter
channelActive, channelInactive, channelReadComplete, channelRegistered, channelUnregistered, channelWritabilityChanged, exceptionCaught, userEventTriggered
-
Methods inherited from class io.netty.channel.ChannelHandlerAdapter
ensureNotSharable, handlerAdded, handlerRemoved, isSharable
-
-
-
-
Constructor Detail
-
HttpPipeliningHandler
public HttpPipeliningHandler(org.apache.logging.log4j.Logger logger, int maxEventsHeld)Construct a new pipelining handler; this handler should be used downstream of HTTP decoding/aggregation.- Parameters:
logger- for logging unexpected errorsmaxEventsHeld- the maximum number of channel events that will be retained prior to aborting the channel connection; this is required as events cannot queue up indefinitely
-
-
Method Detail
-
channelRead
public void channelRead(io.netty.channel.ChannelHandlerContext ctx, java.lang.Object msg) throws java.lang.Exception- Specified by:
channelReadin interfaceio.netty.channel.ChannelInboundHandler- Overrides:
channelReadin classio.netty.channel.ChannelInboundHandlerAdapter- Throws:
java.lang.Exception
-
write
public void write(io.netty.channel.ChannelHandlerContext ctx, java.lang.Object msg, io.netty.channel.ChannelPromise promise) throws java.lang.Exception- Specified by:
writein interfaceio.netty.channel.ChannelOutboundHandler- Overrides:
writein classio.netty.channel.ChannelDuplexHandler- Throws:
java.lang.Exception
-
close
public void close(io.netty.channel.ChannelHandlerContext ctx, io.netty.channel.ChannelPromise promise) throws java.lang.Exception- Specified by:
closein interfaceio.netty.channel.ChannelOutboundHandler- Overrides:
closein classio.netty.channel.ChannelDuplexHandler- Throws:
java.lang.Exception
-
-