@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, writebind, close, connect, deregister, disconnect, flush, readensureNotSharable, exceptionCaught, handlerAdded, handlerRemoved, isSharableclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitexceptionCaught, handlerAdded, handlerRemovedpublic 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.