INPUT
- the incoming message to decode (the low level message, usually a ByteBuffer
)OUTPUT
- the decoded message (your high level protocol Pojo/DTO)DECODING_STATE
- the context where to save the current decoding state (e.g. accumulated bytes, encoding
context switching..)public interface ProtocolDecoder<INPUT,OUTPUT,DECODING_STATE>
Modifier and Type | Method and Description |
---|---|
DECODING_STATE |
createDecoderState()
Create a new session context for this decoder
|
OUTPUT |
decode(INPUT input,
DECODING_STATE context)
Decode binary or protocol-specific content of type
INPUT into higher-level protocol message objects,
of type OUTPUT |
void |
finishDecode(DECODING_STATE context)
Finish decoding, for example if the decoder accumulated some unused input, it should discard it, or throw an
Exception
|
DECODING_STATE createDecoderState()
OUTPUT decode(INPUT input, DECODING_STATE context)
INPUT
into higher-level protocol message objects,
of type OUTPUTinput
- the received message to decodecontext
- the decoding context (will be stored in the session for the next decode call)null
if nothing was decodedvoid finishDecode(DECODING_STATE context)
Copyright © 2009–2013 Apache MINA Project. All rights reserved.