Top Description Fields Constructors Methods
reactor.netty5.channel

public abstract Class AbstractChannelMetricsHandler

extends ChannelHandlerAdapter
Class Inheritance
Known Direct Subclasses
reactor.netty5.channel.ChannelMetricsHandler, reactor.netty5.channel.ContextAwareChannelMetricsHandler, reactor.netty5.channel.MicrometerChannelMetricsHandler
Imports
io.netty5.buffer.Buffer, io.netty5.channel.ChannelHandler, .ChannelHandlerAdapter, .ChannelHandlerContext, io.netty5.channel.socket.DatagramPacket, io.netty5.util.concurrent.Future, reactor.netty5.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
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
channelExceptionCaught(ChannelHandlerContext ctx, Throwable cause)

Overrides default io.netty5.channel.ChannelHandler.channelExceptionCaught.

Gets called if a Throwable was thrown when handling inbound events.
public void
channelInactive(ChannelHandlerContext ctx)

Overrides default io.netty5.channel.ChannelHandler.channelInactive.

The Channel of the ChannelHandlerContext was registered is now inactive and reached its end of lifetime.
public void
channelRead(ChannelHandlerContext ctx, Object msg)

Overrides default io.netty5.channel.ChannelHandler.channelRead.

Invoked when the current Channel has read a message from the peer.
public void
public abstract ChannelHandler
public abstract ChannelMetricsRecorder
protected void
protected void
protected void
public abstract ChannelHandler
public Future<Void>
write(ChannelHandlerContext
the ChannelHandlerContext for which the write operation is made
ctx
,
Object
the message to write
msg
)

Overrides default io.netty5.channel.ChannelHandler.write.

Called once a write operation is made.

Field Detail

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 default io.netty5.channel.ChannelHandler.channelActive.

Doc from io.netty5.channel.ChannelHandler.channelActive.

The Channel of the ChannelHandlerContext is now active

Annotations
@Override
channelExceptionCaughtback to summary
public void channelExceptionCaught(ChannelHandlerContext ctx, Throwable cause)

Overrides default io.netty5.channel.ChannelHandler.channelExceptionCaught.

Doc from io.netty5.channel.ChannelHandler.channelExceptionCaught.

Gets called if a Throwable was thrown when handling inbound events.

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

Overrides default io.netty5.channel.ChannelHandler.channelInactive.

Doc from io.netty5.channel.ChannelHandler.channelInactive.

The Channel of the ChannelHandlerContext was registered is now inactive and reached its end of lifetime.

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

Overrides default io.netty5.channel.ChannelHandler.channelRead.

Doc from io.netty5.channel.ChannelHandler.channelRead.

Invoked when the current Channel has read a message from the peer.

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

Overrides default io.netty5.channel.ChannelHandler.channelRegistered.

Doc from io.netty5.channel.ChannelHandler.channelRegistered.

The Channel of the ChannelHandlerContext was registered with its EventLoop

Annotations
@Override
connectMetricsHandlerback to summary
public abstract ChannelHandler connectMetricsHandler()
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 Future<Void> write(ChannelHandlerContext ctx, Object msg)

Overrides default io.netty5.channel.ChannelHandler.write.

Doc from io.netty5.channel.ChannelHandler.write.

Called once a write operation is made. The write operation will write the messages through the ChannelPipeline. Those are then ready to be flushed to the actual Channel once Channel#flush() is called.

Parameters
ctx:ChannelHandlerContext

the ChannelHandlerContext for which the write operation is made

msg:Object

the message to write

Returns:Future<Void>

the Future which will be notified once the operation completes.

Annotations
@Override