@ChannelHandler.Sharable
public final class UnusedChannelExceptionHandler
extends io.netty.channel.ChannelHandlerAdapter
ChannelAttributeKey.IN_USE
). This
does nothing if the channel is currently in use. If it's not currently in use, it will close the channel and log an
appropriate notification.
This prevents spamming customer logs when errors (eg. connection resets) occur on an unused channel.Modifier and Type | Field and Description |
---|---|
static UnusedChannelExceptionHandler |
INSTANCE |
Modifier and Type | Method and Description |
---|---|
void |
exceptionCaught(io.netty.channel.ChannelHandlerContext ctx,
Throwable cause) |
static UnusedChannelExceptionHandler |
getInstance() |
public static final UnusedChannelExceptionHandler INSTANCE
public void exceptionCaught(io.netty.channel.ChannelHandlerContext ctx, Throwable cause)
exceptionCaught
in interface io.netty.channel.ChannelHandler
exceptionCaught
in class io.netty.channel.ChannelHandlerAdapter
public static UnusedChannelExceptionHandler getInstance()
Copyright © 2019. All rights reserved.