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
Modifier and Type | Method and Description |
---|---|
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, handlerRemoved
void channelRegistered(ChannelHandlerContext ctx) throws java.lang.Exception
java.lang.Exception
void channelUnregistered(ChannelHandlerContext ctx) throws java.lang.Exception
java.lang.Exception
void channelActive(ChannelHandlerContext ctx) throws java.lang.Exception
Channel
of the ChannelHandlerContext
is now activejava.lang.Exception
void channelInactive(ChannelHandlerContext ctx) throws java.lang.Exception
Channel
of the ChannelHandlerContext
was registered is now inactive and reached its
end of lifetime.java.lang.Exception
void channelRead(ChannelHandlerContext ctx, java.lang.Object msg) throws java.lang.Exception
Channel
has read a message from the peer.java.lang.Exception
void 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.Exception
void userEventTriggered(ChannelHandlerContext ctx, java.lang.Object evt) throws java.lang.Exception
java.lang.Exception
void channelWritabilityChanged(ChannelHandlerContext ctx) throws java.lang.Exception
Channel
changed. You can check the state with
Channel.isWritable()
.java.lang.Exception
void exceptionCaught(ChannelHandlerContext ctx, java.lang.Throwable cause) throws java.lang.Exception
Throwable
was thrown.exceptionCaught
in interface ChannelHandler
java.lang.Exception
Copyright © 2008–2018 The Netty Project. All rights reserved.