jsr340-experts@servlet-spec.java.net

[jsr340-experts] Re: Read/WriteListener throws IOException

From: Shing Wai Chan <shing.wai.chan_at_oracle.com>
Date: Fri, 17 May 2013 00:18:45 -0700

The Read/WriteListener#onError should be called in this case.

Shing Wai Chan


On 5/16/13 9:08 PM, Greg Wilkins wrote:
>
> Sorry for the very late comment on this.
>
> I'm OK with having the IOException in the signature of these
> callbacks, but I think we need to specify what the container does with
> the caught exception?
>
> I'm concerned that if we let users not catch these IO errors then they
> will just let them be thrown and take no action to complete the async
> request handling.
>
> Does the container call onError with the exception and then complete
> the async life cycle?
>
> regards
>
>
>
>
>
>
>
> On 15 January 2013 11:59, Shing Wai Chan <shing.wai.chan_at_oracle.com
> <mailto:shing.wai.chan_at_oracle.com>> wrote:
>
> In ReadListener#onDataAvailable, #onAllDataRead and
> WriteListener#onWritePossible,
> it is common to have IO operations.
> With the current API, no exception is in the signature of the
> above methods.
> In this case, developers may need to have a try/catch block inside
> the above methods
> as IOException is probably thrown inside the above methods.
>
> In this case, I suggest to add "throws IOException" in the above
> four methods.
> And I will leave the #onError methods without "throws IOException"
> in this case.
>
> Please let me know if there is any comments.
> Shing Wai Chan
>
>
>
>
> --
> Greg Wilkins <gregw_at_intalio.com <mailto:gregw_at_intalio.com>>
> http://www.webtide.com
> Developer advice and support from the Jetty & CometD experts.
> Intalio, the modern way to build business applications.