Package org.elasticsearch.http.netty4
Class Netty4HttpPipeliningHandler
java.lang.Object
io.netty.channel.ChannelHandlerAdapter
io.netty.channel.ChannelInboundHandlerAdapter
io.netty.channel.ChannelDuplexHandler
org.elasticsearch.http.netty4.Netty4HttpPipeliningHandler
- All Implemented Interfaces:
io.netty.channel.ChannelHandler,io.netty.channel.ChannelInboundHandler,io.netty.channel.ChannelOutboundHandler
public class Netty4HttpPipeliningHandler
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
Nested classes/interfaces inherited from interface io.netty.channel.ChannelHandler
io.netty.channel.ChannelHandler.Sharable -
Constructor Summary
Constructors Constructor Description Netty4HttpPipeliningHandler(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, isSharableMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.netty.channel.ChannelHandler
handlerAdded, handlerRemoved
-
Constructor Details
-
Netty4HttpPipeliningHandler
public Netty4HttpPipeliningHandler(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
-