@ChannelHandler.Sharable
public final class UnusedChannelExceptionHandler
extends io.netty.channel.ChannelInboundHandlerAdapter
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() |
channelActive, channelInactive, channelRead, channelReadComplete, channelRegistered, channelUnregistered, channelWritabilityChanged, userEventTriggeredensureNotSharable, handlerAdded, handlerRemoved, isSharablepublic static final UnusedChannelExceptionHandler INSTANCE
public void exceptionCaught(io.netty.channel.ChannelHandlerContext ctx,
Throwable cause)
exceptionCaught in interface io.netty.channel.ChannelHandlerexceptionCaught in interface io.netty.channel.ChannelInboundHandlerexceptionCaught in class io.netty.channel.ChannelInboundHandlerAdapterpublic static UnusedChannelExceptionHandler getInstance()
Copyright © 2019. All rights reserved.