org.apache.mina.protocol
Interface ProtocolEncoder

All Known Subinterfaces:
MessageEncoder

public interface ProtocolEncoder

Encodes higher-level message objects into binary or protocol-specific data. MINA invokes encode(ProtocolSession, Object, ProtocolEncoderOutput) method with message which is popped from the session write queue, and then the encoder implementation puts encoded ByteBuffers into ProtocolEncoderOutput by calling ProtocolEncoderOutput.write(ByteBuffer).

Please refer to TextLineEncoder example.

Version:
$Rev: 332218 $, $Date: 2005-11-10 12:52:42 +0900 $
Author:
The Apache Directory Project (dev@directory.apache.org)

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

Method Detail

encode

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

Throws:
ProtocolViolationException - if the message violated protocol specification


Copyright © 2004-2005 . All Rights Reserved.