Interface MessageEncoder<T>
-
- Type Parameters:
T- The message type
public interface MessageEncoder<T>Encodes a certain type of messages.We didn't provide any
disposemethod forMessageEncoderbecause it can give you performance penalty in case you have a lot of message types to handle.- Author:
- Apache MINA Project
- See Also:
DemuxingProtocolEncoder,MessageEncoderFactory
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidencode(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 invokesencode(IoSession, Object, ProtocolEncoderOutput)method with message which is popped from the session write queue, and then the encoder implementation puts encodedIoBuffers intoProtocolEncoderOutput.- Parameters:
session- The current sessionmessage- The message to encodeout- The instance ofProtocolEncoderOutputthat will receive the encoded message- Throws:
Exception- if the message violated protocol specification
-
-