public interface ChannelInboundHandler extends ChannelHandler
ChannelHandler which adds callbacks for state changes. This allows the user
to hook in to state changes easily.ChannelHandler.Sharable| 限定符和类型 | 方法和说明 |
|---|---|
void |
channelActive(ChannelHandlerContext ctx)
The
Channel of the ChannelHandlerContext is now active |
void |
channelInactive(ChannelHandlerContext ctx)
The
Channel of the ChannelHandlerContext was registered is now inactive and reached its
end of lifetime. |
void |
channelRead(ChannelHandlerContext ctx,
java.lang.Object msg)
Invoked when the current
Channel has read a message from the peer. |
void |
channelReadComplete(ChannelHandlerContext ctx)
Invoked when the last message read by the current read operation has been consumed by
channelRead(ChannelHandlerContext, Object). |
void |
channelRegistered(ChannelHandlerContext ctx)
|
void |
channelUnregistered(ChannelHandlerContext ctx)
|
void |
channelWritabilityChanged(ChannelHandlerContext ctx)
Gets called once the writable state of a
Channel changed. |
void |
exceptionCaught(ChannelHandlerContext ctx,
java.lang.Throwable cause)
Gets called if a
Throwable was thrown. |
void |
userEventTriggered(ChannelHandlerContext ctx,
java.lang.Object evt)
Gets called if an user event was triggered.
|
handlerAdded, handlerRemovedvoid channelRegistered(ChannelHandlerContext ctx) throws java.lang.Exception
java.lang.Exceptionvoid channelUnregistered(ChannelHandlerContext ctx) throws java.lang.Exception
java.lang.Exceptionvoid channelActive(ChannelHandlerContext ctx) throws java.lang.Exception
Channel of the ChannelHandlerContext is now activejava.lang.Exceptionvoid channelInactive(ChannelHandlerContext ctx) throws java.lang.Exception
Channel of the ChannelHandlerContext was registered is now inactive and reached its
end of lifetime.java.lang.Exceptionvoid channelRead(ChannelHandlerContext ctx, java.lang.Object msg) throws java.lang.Exception
Channel has read a message from the peer.java.lang.Exceptionvoid channelReadComplete(ChannelHandlerContext ctx) throws java.lang.Exception
channelRead(ChannelHandlerContext, Object). If ChannelOption.AUTO_READ is off, no further
attempt to read an inbound data from the current Channel will be made until
ChannelHandlerContext.read() is called.java.lang.Exceptionvoid userEventTriggered(ChannelHandlerContext ctx, java.lang.Object evt) throws java.lang.Exception
java.lang.Exceptionvoid channelWritabilityChanged(ChannelHandlerContext ctx) throws java.lang.Exception
Channel changed. You can check the state with
Channel.isWritable().java.lang.Exceptionvoid exceptionCaught(ChannelHandlerContext ctx, java.lang.Throwable cause) throws java.lang.Exception
Throwable was thrown.exceptionCaught 在接口中 ChannelHandlerjava.lang.Exception