users@grizzly.java.net

Re: handling read exceptions

From: John Franey <jjfraney_at_gmail.com>
Date: Thu, 2 Apr 2009 12:40:25 -0400

On Thu, Apr 2, 2009 at 12:02 PM, Oleksiy Stashok <Oleksiy.Stashok_at_sun.com>wrote:

> Hi,
>
>
> Say the business level has some rules to apply when particular exceptions
> occur. What api/component in grizzly should I hook into to obtain and
> handle the exception?
>
>
> In receive case, the exception is detected by ReadFilter. Should I handle
> it in ConnectorHandler.onRead()? or should I have a filter in front of
> ReadFilter that handles the exception?
>
> Usually we don't propagate the exception from ReadFilter (at least
> IOException).
> Can you pls. give an example here what exception you want to handle and how
> you want to process it?
>

I'm not certain, but I think exceptions shutdown the receiver. If so, then
I'd like to know when this occurs. I'm not necessarily interested in the
exception, but I'd like to know that data is no longer being read, so that
when the business level expects more data, I can give an explanation why it
won't get any. Information in the exception would help.



> In async send case, I don't yet have a clue. How will I hook in to get the
> exception?
>
> Pass AsyncWriteCallbackHandler together with ByteBuffer.
>

Thank you.

Regards,
John

>
> WBR,
> Alexey.
>
>
>
> In sync send case, I understand this case.
>
>
> Regards,
> John
>
>
>
>
>