@ChannelHandler.Sharable public class CompatibleMarshallingEncoder extends MessageToByteEncoder<java.lang.Object>
MessageToByteEncoder
使用JBoss编组来封送对象的实现。
请参阅JBoss Marshalling website获取更多信息如果可能,请使用MarshallingEncoder
。
ChannelHandler.Sharable
Constructor and Description |
---|
CompatibleMarshallingEncoder(MarshallerProvider provider)
|
Modifier and Type | Method and Description |
---|---|
protected void |
encode(ChannelHandlerContext ctx, java.lang.Object msg, ByteBuf out)
将消息编码成 ByteBuf 。
|
acceptOutboundMessage, allocateBuffer, isPreferDirect, write
bind, close, connect, deregister, disconnect, flush, read
ensureNotSharable, exceptionCaught, handlerAdded, handlerRemoved, isSharable
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
exceptionCaught, handlerAdded, handlerRemoved
public CompatibleMarshallingEncoder(MarshallerProvider provider)
provider
- MarshallerProvider
用于获得Marshaller
Channel
protected void encode(ChannelHandlerContext ctx, java.lang.Object msg, ByteBuf out) throws java.lang.Exception
MessageToByteEncoder
ByteBuf
。
这个方法将被编码器处理的每个书面信息调用。
encode
在课程
MessageToByteEncoder<java.lang.Object>
ctx
- MessageToByteEncoder
所属的ChannelHandlerContext
msg
- 要编码的消息
out
- 将写入编码信息的ByteBuf
java.lang.Exception
- is thrown if an error occurs
Copyright © 2008–2018 The Netty Project. All rights reserved.