org.apache.mina.example.sumup.codec
Class AbstractMessageEncoder<T extends AbstractMessage>
java.lang.Object
org.apache.mina.example.sumup.codec.AbstractMessageEncoder<T>
- All Implemented Interfaces:
- MessageEncoder<T>
- Direct Known Subclasses:
- AddMessageEncoder, ResultMessageEncoder
public abstract class AbstractMessageEncoder<T extends AbstractMessage>
- extends Object
- implements MessageEncoder<T>
A MessageEncoder
that encodes message header and forwards
the encoding of body to a subclass.
- Author:
- Apache MINA Project
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
AbstractMessageEncoder
protected AbstractMessageEncoder(int type)
encode
public void encode(IoSession session,
T message,
ProtocolEncoderOutput out)
throws Exception
- Description copied from interface:
MessageEncoder
- Encodes higher-level message objects into binary or protocol-specific data.
MINA invokes
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
.
- Specified by:
encode
in interface MessageEncoder<T extends AbstractMessage>
- Throws:
Exception
- if the message violated protocol specification
encodeBody
protected abstract void encodeBody(IoSession session,
T message,
IoBuffer out)
Copyright © 2004-2011 Apache MINA Project. All Rights Reserved.