Hi Ashish,
Ashish wrote:
The documentation says
**
Invoked when any exception is thrown by user [EMAIL PROTECTED] IoHandler}
implementation or by MINA. If <code>cause</code> is an instance of
[EMAIL PROTECTED] IOException}, MINA will close the connection automatically
**
The fact that I am trying to understand here is about Exception
handling strategy in MINA while decoding protocol specific bytes
and there are violations in packet structure.
Will exceptionCaught() be called if Protocol Decoder throws an
exception or it shall handle only. IoHandler's are typically meant to
handle business logic.
So if there is an error while decoding an error,
1. Is it okay to throw an error from the decoder and process it in
exceptionCaught().
Are there other scenarios where this function can be used
I must say that this is an area where the semantic of the
ExceptionCaught message is everything but clear. It needs to be
clarified in 3.0, for sure.
Obviously, an error while decoding a message could lead to the session
closing, but this should be optional (ie, it's up to the application to
decide what to do).
In any case, the exceptionCaught message is just generate to allow all
the filters (and the handler) to clean what need to be cleaned, as the
exception will not be caaught by the filters (unless someone want to
modify the existing filters ...), so this is the only way to propagate
the exception correctly.
--
--
cordialement, regards,
Emmanuel Lécharny
www.iktek.com
directory.apache.org