org.apache.mina.example.sumup.codec
Class AbstractMessageDecoder

java.lang.Object
  extended by org.apache.mina.example.sumup.codec.AbstractMessageDecoder
All Implemented Interfaces:
MessageDecoder
Direct Known Subclasses:
AddMessageDecoder, ResultMessageDecoder

public abstract class AbstractMessageDecoder
extends java.lang.Object
implements MessageDecoder

A MessageDecoder that decodes message header and forwards the decoding of body to a subclass.

Author:
Apache MINA Project

Field Summary
 
Fields inherited from interface org.apache.mina.filter.codec.demux.MessageDecoder
NEED_DATA, NOT_OK, OK
 
Constructor Summary
protected AbstractMessageDecoder(int type)
           
 
Method Summary
 MessageDecoderResult decodable(IoSession session, IoBuffer in)
           
 MessageDecoderResult decode(IoSession session, IoBuffer in, ProtocolDecoderOutput out)
           
protected abstract  AbstractMessage decodeBody(IoSession session, IoBuffer in)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.apache.mina.filter.codec.demux.MessageDecoder
finishDecode
 

Constructor Detail

AbstractMessageDecoder

protected AbstractMessageDecoder(int type)
Method Detail

decodable

public MessageDecoderResult decodable(IoSession session,
                                      IoBuffer in)
Specified by:
decodable in interface MessageDecoder

decode

public MessageDecoderResult decode(IoSession session,
                                   IoBuffer in,
                                   ProtocolDecoderOutput out)
                            throws java.lang.Exception
Specified by:
decode in interface MessageDecoder
Throws:
java.lang.Exception

decodeBody

protected abstract AbstractMessage decodeBody(IoSession session,
                                              IoBuffer in)
Returns:
null if the whole body is not read yet


Copyright © 2004-2012 Apache MINA Project. All Rights Reserved.