public abstract class ChannelInboundMessageHandlerAdapter<I> extends ChannelInboundHandlerAdapter implements ChannelInboundMessageHandler<I>
ChannelHandler.Sharable| Modifier | Constructor and Description |
|---|---|
protected |
ChannelInboundMessageHandlerAdapter(Class<?>... acceptedMsgTypes) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
beginMessageReceived(ChannelHandlerContext ctx)
Will get notified once
inboundBufferUpdated(ChannelHandlerContext) was called. |
void |
endMessageReceived(ChannelHandlerContext ctx) |
void |
inboundBufferUpdated(ChannelHandlerContext ctx)
Does nothing by default.
|
boolean |
isSupported(Object msg)
Returns
true if and only if the specified message can be handled by this handler. |
abstract void |
messageReceived(ChannelHandlerContext ctx,
I msg) |
io.netty.buffer.MessageBuf<I> |
newInboundBuffer(ChannelHandlerContext ctx)
Return the
MessageBuf which will be used for inbound data to store. |
afterAdd, afterRemove, beforeAdd, beforeRemove, channelActive, channelInactive, channelRegistered, channelUnregistered, exceptionCaught, userEventTriggeredclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitchannelActive, channelInactive, channelRegistered, channelUnregisteredafterAdd, afterRemove, beforeAdd, beforeRemove, exceptionCaught, userEventTriggeredprotected ChannelInboundMessageHandlerAdapter(Class<?>... acceptedMsgTypes)
public io.netty.buffer.MessageBuf<I> newInboundBuffer(ChannelHandlerContext ctx) throws Exception
ChannelInboundMessageHandlerMessageBuf which will be used for inbound data to store.newInboundBuffer in interface ChannelInboundHandlernewInboundBuffer in interface ChannelInboundMessageHandler<I>Exceptionpublic final void inboundBufferUpdated(ChannelHandlerContext ctx) throws Exception
ChannelInboundHandlerAdapterinboundBufferUpdated in interface ChannelStateHandlerinboundBufferUpdated in class ChannelInboundHandlerAdapterExceptionpublic boolean isSupported(Object msg) throws Exception
true if and only if the specified message can be handled by this handler.msg - the messageExceptionpublic boolean beginMessageReceived(ChannelHandlerContext ctx) throws Exception
inboundBufferUpdated(ChannelHandlerContext) was called.
If this method returns false no further processing of the MessageBuf
will be done until the next call of inboundBufferUpdated(ChannelHandlerContext).
This will return true by default, and may get overriden by sub-classes for
special handling.Exceptionpublic abstract void messageReceived(ChannelHandlerContext ctx, I msg) throws Exception
Exceptionpublic void endMessageReceived(ChannelHandlerContext ctx) throws Exception
ExceptionCopyright © 2008-2012 The Netty Project. All Rights Reserved.