public abstract class AbstractMessageDecoder extends Object implements MessageDecoder
MessageDecoder
that decodes message header and forwards
the decoding of body to a subclass.NEED_DATA, NOT_OK, OK
Modifier | Constructor and Description |
---|---|
protected |
AbstractMessageDecoder(int type) |
Modifier and Type | Method and Description |
---|---|
MessageDecoderResult |
decodable(IoSession session,
IoBuffer in)
Checks the specified buffer is decodable by this decoder.
|
MessageDecoderResult |
decode(IoSession session,
IoBuffer in,
ProtocolDecoderOutput out)
Decodes binary or protocol-specific content into higher-level message objects.
|
protected abstract AbstractMessage |
decodeBody(IoSession session,
IoBuffer in) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
finishDecode
public MessageDecoderResult decodable(IoSession session, IoBuffer in)
MessageDecoder
decodable
in interface MessageDecoder
MessageDecoder.OK
if this decoder can decode the specified buffer.
MessageDecoder.NOT_OK
if this decoder cannot decode the specified buffer.
MessageDecoder.NEED_DATA
if more data is required to determine if the
specified buffer is decodable (MessageDecoder.OK
) or not decodable
MessageDecoder.NOT_OK
.public MessageDecoderResult decode(IoSession session, IoBuffer in, ProtocolDecoderOutput out) throws Exception
MessageDecoder
MessageDecoder.decode(IoSession, IoBuffer, ProtocolDecoderOutput)
method with read data, and then the decoder implementation puts decoded
messages into ProtocolDecoderOutput
.decode
in interface MessageDecoder
MessageDecoder.OK
if you finished decoding messages successfully.
MessageDecoder.NEED_DATA
if you need more data to finish decoding current message.
MessageDecoder.NOT_OK
if you cannot decode current message due to protocol specification violation.Exception
- if the read data violated protocol specificationprotected abstract AbstractMessage decodeBody(IoSession session, IoBuffer in)
Copyright © 2004–2014 Apache MINA Project. All rights reserved.