public abstract class AbstractMessageEncoder<T extends AbstractMessage> extends Object implements MessageEncoder<T>
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(IoSession session,
T message,
ProtocolEncoderOutput out)
Encodes higher-level message objects into binary or protocol-specific data.
|
protected abstract void |
encodeBody(IoSession session,
T message,
IoBuffer out) |
public void encode(IoSession session, T message, ProtocolEncoderOutput out) throws Exception
MessageEncoder
MessageEncoder.encode(IoSession, Object, ProtocolEncoderOutput)
method with message which is popped from the session write queue, and then
the encoder implementation puts encoded IoBuffer
s into
ProtocolEncoderOutput
.encode
in interface MessageEncoder<T extends AbstractMessage>
Exception
- if the message violated protocol specificationCopyright © 2004–2014 Apache MINA Project. All rights reserved.