org.apache.mina.filter.codec.demux

Interface MessageEncoder

public interface MessageEncoder

Encodes messages of specific types specified by getMessageTypes().
See Also:
DemuxingProtocolCodecFactory, MessageEncoderFactory

Method Summary

void
encode(IoSession session, Object message, ProtocolEncoderOutput out)
Encodes higher-level message objects into binary or protocol-specific data.
Set>
getMessageTypes()
Returns the set of message classes this encoder can encode.

Method Details

encode

public void encode(IoSession session,
                   Object message,
                   ProtocolEncoderOutput out)
            throws Exception
Encodes higher-level message objects into binary or protocol-specific data. MINA invokes encode(IoSession,Object,ProtocolEncoderOutput) method with message which is popped from the session write queue, and then the encoder implementation puts encoded ByteBuffers into ProtocolEncoderOutput.

getMessageTypes

public Set> getMessageTypes()
Returns the set of message classes this encoder can encode.