public abstract class AbstractMessageEncoder extends java.lang.Object implements MessageEncoder
MessageEncoder
that encodes message header and forwards
the encoding of body to a subclass.Modifier | Constructor and Description |
---|---|
protected |
AbstractMessageEncoder(int type) |
Modifier and Type | Method and Description |
---|---|
void |
encode(ProtocolSession session,
java.lang.Object message,
ProtocolEncoderOutput out)
Encodes higher-level message objects into binary or protocol-specific data.
|
protected abstract void |
encodeBody(ProtocolSession session,
AbstractMessage message,
ByteBuffer out) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getMessageTypes
public void encode(ProtocolSession session, java.lang.Object message, ProtocolEncoderOutput out) throws ProtocolViolationException
ProtocolEncoder
ProtocolEncoder.encode(ProtocolSession, Object, ProtocolEncoderOutput)
method with message which is popped from the session write queue, and then
the encoder implementation puts encoded ByteBuffer
s into
ProtocolEncoderOutput
.encode
in interface ProtocolEncoder
ProtocolViolationException
- if the message violated protocol
specificationprotected abstract void encodeBody(ProtocolSession session, AbstractMessage message, ByteBuffer out)