net.gleamynode.netty2
Interface MessageRecognizer
public interface MessageRecognizer
Converts 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.
- Version:
- $Rev: 4 $, $Date: 2005-04-18 12:04:09 +0900 $
- Author:
- Trustin Lee (http://gleamynode.net/dev/)
recognize
Message recognize(ByteBuffer buffer)
throws MessageParseException
- Converts
ByteBufferinto Message.
- Parameters:
buffer - incoming bytes
- Returns:
- the converted message only if this recognizer understands the
incoming data.
null otherwise (i.e. the recognizer
cannot determine the message type because the incoming data is
too small yet.)
- Throws:
MessageParseException - if this recognizer does not understand the incoming data, or
if the validation is failed.
Copyright © 2004-2010 Trustin Lee. All Rights Reserved.