public class CompatibleMarshallingDecoder extends ReplayingDecoder<Object,Void>
ReplayingDecoder which use an Unmarshaller to read the Object out of the ByteBuf.
If you can you should use MarshallingDecoder.ChannelHandler.Sharable| Modifier and Type | Field and Description |
|---|---|
protected int |
maxObjectSize |
protected UnmarshallerProvider |
provider |
| Constructor and Description |
|---|
CompatibleMarshallingDecoder(UnmarshallerProvider provider,
int maxObjectSize)
Create a new instance of
CompatibleMarshallingDecoder. |
| Modifier and Type | Method and Description |
|---|---|
Object |
decode(ChannelHandlerContext ctx,
ByteBuf buffer) |
Object |
decodeLast(ChannelHandlerContext ctx,
ByteBuf buffer) |
void |
exceptionCaught(ChannelHandlerContext ctx,
Throwable cause) |
actualReadableBytes, callDecode, channelInactive, checkpoint, checkpoint, internalBuffer, newInboundBuffer, state, statebeforeAdd, inboundBufferUpdated, replaceafterAdd, afterRemove, beforeRemove, channelActive, channelRegistered, channelUnregistered, userEventTriggeredclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitchannelActive, channelRegistered, channelUnregisteredafterAdd, afterRemove, beforeRemove, userEventTriggeredprotected final UnmarshallerProvider provider
protected final int maxObjectSize
public CompatibleMarshallingDecoder(UnmarshallerProvider provider, int maxObjectSize)
CompatibleMarshallingDecoder.provider - the UnmarshallerProvider which is used to obtain the Unmarshaller
for the ChannelmaxObjectSize - the maximal size (in bytes) of the Object to unmarshal. Once the size is
exceeded the Channel will get closed. Use a a maxObjectSize of
Integer.MAX_VALUE to disable this. You should only do this if you are sure
that the received Objects will never be big and the sending side are trusted, as this
opens the possibility for a DOS-Attack due an OutOfMemoryError.public Object decode(ChannelHandlerContext ctx, ByteBuf buffer) throws Exception
decode in class ByteToMessageDecoder<Object>Exceptionpublic Object decodeLast(ChannelHandlerContext ctx, ByteBuf buffer) throws Exception
decodeLast in class ByteToMessageDecoder<Object>Exceptionpublic void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws Exception
exceptionCaught in interface ChannelHandlerexceptionCaught in class ChannelStateHandlerAdapterExceptionCopyright © 2008-2012 The Netty Project. All Rights Reserved.