@ChannelHandler.Sharable public class CompatibleMarshallingEncoder extends OneToOneEncoder
OneToOneEncoder
implementation which uses JBoss Marshalling to marshal
an Object.
See JBoss Marshalling website
for more informations
Use MarshallingEncoder
if possible.ChannelHandler.Sharable
构造器和说明 |
---|
CompatibleMarshallingEncoder(MarshallerProvider provider)
Create a new instance of the
CompatibleMarshallingEncoder |
限定符和类型 | 方法和说明 |
---|---|
protected java.lang.Object |
encode(ChannelHandlerContext ctx,
Channel channel,
java.lang.Object msg)
Transforms the specified message into another message and return the
transformed message.
|
doEncode, handleDownstream
public CompatibleMarshallingEncoder(MarshallerProvider provider)
CompatibleMarshallingEncoder
provider
- the MarshallerProvider
to use to get the Marshaller
for a Channel
protected java.lang.Object encode(ChannelHandlerContext ctx, Channel channel, java.lang.Object msg) throws java.lang.Exception
OneToOneEncoder
null
, unlike
you can in OneToOneDecoder.decode(ChannelHandlerContext, Channel, Object)
;
you must return something, at least ChannelBuffers.EMPTY_BUFFER
.encode
在类中 OneToOneEncoder
java.lang.Exception