@ChannelHandler.Sharable public class RuleBasedIpFilter extends AbstractRemoteAddressFilter<java.net.InetSocketAddress>
Channel
s based on the
IpFilterRule
s passed to its constructor. If no rules are provided, all connections
will be accepted.
If you would like to explicitly take action on rejected Channel
s, you should override
AbstractRemoteAddressFilter.channelRejected(ChannelHandlerContext, SocketAddress)
.ChannelHandler.Sharable
构造器和说明 |
---|
RuleBasedIpFilter(IpFilterRule... rules) |
限定符和类型 | 方法和说明 |
---|---|
protected boolean |
accept(ChannelHandlerContext ctx,
java.net.InetSocketAddress remoteAddress)
This method is called immediately after a
Channel gets registered. |
channelAccepted, channelActive, channelRegistered, channelRejected
channelInactive, channelRead, channelReadComplete, channelUnregistered, channelWritabilityChanged, exceptionCaught, userEventTriggered
ensureNotSharable, handlerAdded, handlerRemoved, isSharable
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
handlerAdded, handlerRemoved
public RuleBasedIpFilter(IpFilterRule... rules)
protected boolean accept(ChannelHandlerContext ctx, java.net.InetSocketAddress remoteAddress) throws java.lang.Exception
AbstractRemoteAddressFilter
Channel
gets registered.accept
在类中 AbstractRemoteAddressFilter<java.net.InetSocketAddress>
java.lang.Exception