I'm currently digging into Apache MINA. It's a great framework with lots of capabilities. The hardest part until now was the decoder part. Checking the api documents I understand that there are the following classes that one can extend and implement his own:
- DemuxingProtocolDecoder - A composite ProtocolDecoder that demultiplexes incoming IoBuffer decoding requests into an appropriate MessageDecoder.
- ObjectSerializationDecoder - A ProtocolDecoder which deserializes Serializable Java objects using IoBuffer.getObject(ClassLoader).
- PrefixedStringDecoder - A ProtocolDecoder which decodes a String using a fixed-length length prefix.
All of the above extend the CumulativeProtocolDecoder class - A ProtocolDecoder that cumulates the content of received buffers to a cumulative buffer to help users implement decoders.
- Could you please mention with some real world examples what subclass of CumulativeProtocolDecoder you would or did use and why?
- Is there an example that doesn't need the decoder to extend the CumulativeProtocolDecoder class and just implement the ProtocolDecoder directly without worrying about fragmentation?