Hello,
I'm using Mina 2.0 M4.
I'm doing some processing on HTTP messages. I've implemented a protocol decoder
that extends CumulativeProtocolDecoder. I also have some MessageDecoders that
are called from my protocol decoder (very similar to DemuxingProtocolDecoder).
I'm trying to handle the case where the HTTP session is closed in order to
terminate the message. I believe the finishDecode() method was designed for
this purpose. It even mentions it in the javadoc.
When this method is invoked, how do I get the buffer holding the rest of my
data from the CumulativeProtocolDecoder? I understand that it's an attribute in
the session, but the BUFFER AttributeKey is a private field inside
CumulativeProtocolDecoder. It seems like bad programming practice to duplicate
the key in my code, especially if it ever gets changed in
CumulativeProtocolDecoder. Do I need to write my own CumulativeProtocolDecoder
so I can access the buffer? It seems like the finishDecode() method in
CumulativeProtocolDecoder needs to pass the buffer, similar to some of the
abstract finishDecode() methods in the DecodingState classes.
I expect that whatever method I use to get the buffer into my protocol decoder
can also be used to get the buffer into my MessageDecoder since it has the same
finishDecode() method.
Thanks.
Andy