Package org.elasticsearch.http.nio
Class NioHttpPipeliningHandler
java.lang.Object
io.netty.channel.ChannelHandlerAdapter
io.netty.channel.ChannelInboundHandlerAdapter
io.netty.channel.ChannelDuplexHandler
org.elasticsearch.http.nio.NioHttpPipeliningHandler
- All Implemented Interfaces:
io.netty.channel.ChannelHandler,io.netty.channel.ChannelInboundHandler,io.netty.channel.ChannelOutboundHandler
public class NioHttpPipeliningHandler
extends io.netty.channel.ChannelDuplexHandler
Implements HTTP pipelining ordering, ensuring that responses are completely served in the same order as their corresponding requests.
-
Nested Class Summary
-
Constructor Summary
Constructors Constructor Description NioHttpPipeliningHandler(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, readMethods inherited from class io.netty.channel.ChannelInboundHandlerAdapter
channelActive, channelInactive, channelReadComplete, channelRegistered, channelUnregistered, channelWritabilityChanged, exceptionCaught, userEventTriggeredMethods inherited from class io.netty.channel.ChannelHandlerAdapter
ensureNotSharable, handlerAdded, handlerRemoved, isSharable
-
Constructor Details
-
NioHttpPipeliningHandler
public NioHttpPipeliningHandler(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 Details
-
channelRead
public void channelRead(io.netty.channel.ChannelHandlerContext ctx, java.lang.Object msg)- Specified by:
channelReadin interfaceio.netty.channel.ChannelInboundHandler- Overrides:
channelReadin classio.netty.channel.ChannelInboundHandlerAdapter
-
write
public void write(io.netty.channel.ChannelHandlerContext ctx, java.lang.Object msg, io.netty.channel.ChannelPromise promise)- Specified by:
writein interfaceio.netty.channel.ChannelOutboundHandler- Overrides:
writein classio.netty.channel.ChannelDuplexHandler
-
close
public void close(io.netty.channel.ChannelHandlerContext ctx, io.netty.channel.ChannelPromise promise)- Specified by:
closein interfaceio.netty.channel.ChannelOutboundHandler- Overrides:
closein classio.netty.channel.ChannelDuplexHandler
-