Top Description Fields Constructors Methods
io.netty.handler.codec.marshalling

public Class CompatibleMarshallingEncoder

extends MessageToByteEncoder<Object>
Class Inheritance
Annotations
@Sharable
Imports
io.netty.buffer.ByteBuf, io.netty.channel.Channel, .ChannelHandler.Sharable, .ChannelHandlerContext, io.netty.handler.codec.MessageToByteEncoder, org.jboss.marshalling.Marshaller

MessageToByteEncoder implementation which uses JBoss Marshalling to marshal an Object. See JBoss Marshalling website for more information Use MarshallingEncoder if possible.

Field Summary

Modifier and TypeField and Description
private final MarshallerProvider

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
protected void
encode(ChannelHandlerContext ctx, Object
the message to encode
msg
,
ByteBuf
the ByteBuf into which the encoded message will be written
out
)

Implements abstract io.netty.handler.codec.MessageToByteEncoder.encode.

Encode a message into a ByteBuf.
Inherited from io.netty.handler.codec.MessageToByteEncoder:
acceptOutboundMessageallocateBufferisPreferDirectwrite

Field Detail

providerback to summary
private final MarshallerProvider provider

Constructor Detail

CompatibleMarshallingEncoderback to summary
public CompatibleMarshallingEncoder(MarshallerProvider provider)

Create a new instance of the CompatibleMarshallingEncoder

Parameters
provider:MarshallerProvider

the MarshallerProvider to use to get the Marshaller for a Channel

Method Detail

encodeback to summary
protected void encode(ChannelHandlerContext ctx, Object msg, ByteBuf out) throws Exception

Implements abstract io.netty.handler.codec.MessageToByteEncoder.encode.

Doc from io.netty.handler.codec.MessageToByteEncoder.encode.

Encode a message into a ByteBuf. This method will be called for each written message that can be handled by this encoder.

Parameters
ctx:ChannelHandlerContext

the ChannelHandlerContext which this MessageToByteEncoder belongs to

msg:Object

the message to encode

out:ByteBuf

the ByteBuf into which the encoded message will be written

Annotations
@Override
Exceptions
Exception:
is thrown if an error occurs