public interface MessageRecognizer
ByteBufferinto Message. I/O worker thread calls
recognize(ByteBuffer)first to determine the proper Message,
and then it calls corresponding Message's
Message.read(ByteBuffer)method to generate
messageReceived event.Message recognize(java.nio.ByteBuffer buffer) throws MessageParseException
ByteBufferinto Message.buffer - incoming bytesnull otherwise (i.e. the recognizer
cannot determine the message type because the incoming data is
too small yet.)MessageParseException - if this recognizer does not understand the incoming data, or
if the validation is failed.Copyright © 2004-2012 Trustin Lee. All Rights Reserved.