org.apache.mina.filter.codec.demux
Interface MessageEncoder<T>


public interface MessageEncoder<T>

Encodes a certain type of messages.

We didn't provide any dispose method for MessageEncoder because it can give you performance penalty in case you have a lot of message types to handle.

Version:
$Rev: 590006 $, $Date: 2007-10-30 10:44:02 +0100 (Tue, 30 Oct 2007) $
Author:
The Apache MINA Project (dev@mina.apache.org)
See Also:
DemuxingProtocolEncoder, MessageEncoderFactory

Method Summary
 void encode(IoSession session, T message, ProtocolEncoderOutput out)
          Encodes higher-level message objects into binary or protocol-specific data.
 

Method Detail

encode

void encode(IoSession session,
            T 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 IoBuffers into ProtocolEncoderOutput.

Throws:
Exception - if the message violated protocol specification


Copyright © 2004-2009 Apache MINA Project. All Rights Reserved.