Top Description Fields Constructors Methods
reactor.netty.channel

public abstract Class AbstractChannelMetricsHandler

extends ChannelDuplexHandler
Class Inheritance
Known Direct Subclasses
reactor.netty.channel.ChannelMetricsHandler, reactor.netty.channel.ContextAwareChannelMetricsHandler, reactor.netty.channel.MicrometerChannelMetricsHandler
Imports
io.netty.buffer.ByteBuf, io.netty.channel.ChannelDuplexHandler, .ChannelHandler, .ChannelHandlerContext, .ChannelPromise, io.netty.channel.socket.DatagramPacket, io.netty.handler.ssl.AbstractSniHandler, .SslHandler, reactor.netty.NettyPipeline, reactor.util.Logger, .Loggers, reactor.util.annotation.Nullable, java.net.SocketAddress

Base ChannelHandler for collecting metrics on protocol level.
Author
Violeta Georgieva
Since
1.0.8

Field Summary

Modifier and TypeField and Description
pack-priv boolean
private static final Logger
pack-priv final boolean
pack-priv final SocketAddress

Constructor Summary

AccessConstructor and Description
protected
AbstractChannelMetricsHandler(SocketAddress remoteAddress, boolean onServer)

Method Summary

Modifier and TypeMethod and Description
public void
public void
public void
public void
public abstract ChannelHandler
public void
public abstract ChannelMetricsRecorder
protected void
protected void
protected void
public abstract ChannelHandler
public void
write(ChannelHandlerContext
the ChannelHandlerContext for which the write operation is made
ctx
,
Object
the message to write
msg
,
ChannelPromise
the ChannelPromise to notify once the operation completes
promise
)

Overrides io.netty.channel.ChannelDuplexHandler.write.

Implements io.netty.channel.ChannelOutboundHandler.write.

Calls ChannelHandlerContext#write(Object, ChannelPromise) to forward to the next ChannelOutboundHandler in the ChannelPipeline.
Inherited from io.netty.channel.ChannelDuplexHandler:
bindcloseconnectderegisterdisconnectflushread

Field Detail

channelOpenedback to summary
pack-priv boolean channelOpened
logback to summary
private static final Logger log
onServerback to summary
pack-priv final boolean onServer
remoteAddressback to summary
pack-priv final SocketAddress remoteAddress

Constructor Detail

AbstractChannelMetricsHandlerback to summary
protected AbstractChannelMetricsHandler(SocketAddress remoteAddress, boolean onServer)

Method Detail

channelActiveback to summary
public void channelActive(ChannelHandlerContext ctx)

Overrides io.netty.channel.ChannelInboundHandlerAdapter.channelActive.

Implements io.netty.channel.ChannelInboundHandler.channelActive.

Doc from io.netty.channel.ChannelInboundHandlerAdapter.channelActive.

Calls ChannelHandlerContext#fireChannelActive() to forward to the next ChannelInboundHandler in the ChannelPipeline. Sub-classes may override this method to change behavior.

Annotations
@Override
channelInactiveback to summary
public void channelInactive(ChannelHandlerContext ctx)

Overrides io.netty.channel.ChannelInboundHandlerAdapter.channelInactive.

Implements io.netty.channel.ChannelInboundHandler.channelInactive.

Doc from io.netty.channel.ChannelInboundHandlerAdapter.channelInactive.

Calls ChannelHandlerContext#fireChannelInactive() to forward to the next ChannelInboundHandler in the ChannelPipeline. Sub-classes may override this method to change behavior.

Annotations
@Override
channelReadback to summary
public void channelRead(ChannelHandlerContext ctx, Object msg)

Overrides io.netty.channel.ChannelInboundHandlerAdapter.channelRead.

Implements io.netty.channel.ChannelInboundHandler.channelRead.

Doc from io.netty.channel.ChannelInboundHandlerAdapter.channelRead.

Calls ChannelHandlerContext#fireChannelRead(Object) to forward to the next ChannelInboundHandler in the ChannelPipeline. Sub-classes may override this method to change behavior.

Annotations
@Override
channelRegisteredback to summary
public void channelRegistered(ChannelHandlerContext ctx)

Overrides io.netty.channel.ChannelInboundHandlerAdapter.channelRegistered.

Implements io.netty.channel.ChannelInboundHandler.channelRegistered.

Doc from io.netty.channel.ChannelInboundHandlerAdapter.channelRegistered.

Calls ChannelHandlerContext#fireChannelRegistered() to forward to the next ChannelInboundHandler in the ChannelPipeline. Sub-classes may override this method to change behavior.

Annotations
@Override
connectMetricsHandlerback to summary
public abstract ChannelHandler connectMetricsHandler()
exceptionCaughtback to summary
public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause)

Overrides io.netty.channel.ChannelInboundHandlerAdapter.exceptionCaught.

Implements io.netty.channel.ChannelHandler.exceptionCaught, io.netty.channel.ChannelInboundHandler.exceptionCaught.

Doc from io.netty.channel.ChannelHandler.exceptionCaught.

Gets called if a Throwable was thrown.

Annotations
@Override
recorderback to summary
public abstract ChannelMetricsRecorder recorder()
recordExceptionback to summary
protected void recordException(ChannelHandlerContext ctx, SocketAddress address)
recordReadback to summary
protected void recordRead(ChannelHandlerContext ctx, SocketAddress address, long bytes)
recordWriteback to summary
protected void recordWrite(ChannelHandlerContext ctx, SocketAddress address, long bytes)
tlsMetricsHandlerback to summary
public abstract ChannelHandler tlsMetricsHandler()
writeback to summary
public void write(ChannelHandlerContext ctx, Object msg, ChannelPromise promise)

Overrides io.netty.channel.ChannelDuplexHandler.write.

Implements io.netty.channel.ChannelOutboundHandler.write.

Doc from io.netty.channel.ChannelDuplexHandler.write.

Calls ChannelHandlerContext#write(Object, ChannelPromise) to forward to the next ChannelOutboundHandler in the ChannelPipeline. Sub-classes may override this method to change behavior.

Parameters
ctx:ChannelHandlerContext

Doc from io.netty.channel.ChannelOutboundHandler.write.

the ChannelHandlerContext for which the write operation is made

msg:Object

Doc from io.netty.channel.ChannelOutboundHandler.write.

the message to write

promise:ChannelPromise

Doc from io.netty.channel.ChannelOutboundHandler.write.

the ChannelPromise to notify once the operation completes

Annotations
@Override
@SuppressWarnings:FutureReturnValueIgnored