INPUT - the incoming message to encode (your high level protocol Pojo/DTO)OUTPUT - the encoded message (the low level message, usually a ByteBuffer)ENCODING_STATE - the context where to save the current encoding state (e.g. encoding context switching..)public interface ProtocolEncoder<INPUT,OUTPUT,ENCODING_STATE>
ByteBuffer or any other
protocol level construction.
Must be immutable, a CONTEXT will be provided per session.| Modifier and Type | Method and Description |
|---|---|
ENCODING_STATE |
createEncoderState()
Create a new session context for this decoder
|
OUTPUT |
encode(INPUT message,
ENCODING_STATE context)
Encodes higher-level message objects of type
INPUT into binary or protocol-specific data of type
OUTPUT. |
ENCODING_STATE createEncoderState()
OUTPUT encode(INPUT message, ENCODING_STATE context)
INPUT into binary or protocol-specific data of type
OUTPUT.message - the message to encodecontext - the encoding context (will be stored in the session for the next decode call)Copyright © 2009–2013 Apache MINA Project. All rights reserved.