org.apache.mina.example.sumup.codec

## Class AddMessageDecoder

- java.lang.Object
- - org.apache.mina.example.sumup.codec.AbstractMessageDecoder
  - - org.apache.mina.example.sumup.codec.AddMessageDecoder

- All Implemented Interfaces:
    MessageDecoder

      public class AddMessageDecoder
      extends AbstractMessageDecoder

  A `MessageDecoder` that decodes `AddMessage`.
  Author:
    Apache MINA Project

- - ### Field Summary

    - ### Fields inherited from interface org.apache.mina.filter.codec.demux.MessageDecoder

      `NEED_DATA, NOT_OK, OK`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `AddMessageDecoder()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected AbstractMessage` | `decodeBody(IoSession session, IoBuffer in)`
    `void` | `finishDecode(IoSession session, ProtocolDecoderOutput out)` Invoked when the specified `session` is closed while this decoder was parsing the data.

    - ### Methods inherited from class org.apache.mina.example.sumup.codec.AbstractMessageDecoder

      `decodable, decode`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### AddMessageDecoder

          public AddMessageDecoder()

  - ### Method Detail

    - #### decodeBody

          protected AbstractMessage decodeBody(IoSession session,
                                   IoBuffer in)

      Specified by:
        `decodeBody` in class `AbstractMessageDecoder`
      Returns:
        `null` if the whole body is not read yet

    - #### finishDecode

          public void finishDecode(IoSession session,
                          ProtocolDecoderOutput out)
                            throws Exception

      Description copied from interface: `MessageDecoder`
      Invoked when the specified `session` is closed while this decoder was parsing the data. This method is useful when you deal with the protocol which doesn't specify the length of a message such as HTTP response without `content-length` header. Implement this method to process the remaining data that `MessageDecoder.decode(IoSession, IoBuffer, ProtocolDecoderOutput)` method didn't process completely.
      Throws:
        `Exception` - if the read data violated protocol specification

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