users@jax-rs-spec.java.net

[jax-rs-spec users] [jsr339-experts] Re: Re: resume(Throwable) question

From: Marek Potociar <marek.potociar_at_oracle.com>
Date: Tue, 5 Feb 2013 17:47:16 +0100

As for closing connections in case of an unmapped response, it should be IMO left up to the underlying container impl. Typically the container would map the exception to a HTTP 500 response, send the response back to the client and close the connection. If that's not possible due to an error while sending the response, the event should be properly logged IMO. But I would not want to put anything like that in the spec. We do not specify this case for sync processing and async is no different in this context.

Marek

On Feb 5, 2013, at 2:48 PM, Bill Burke <bburke_at_redhat.com> wrote:

>
>
> On 2/5/2013 8:37 AM, Bill Burke wrote:
>> Javadoc says for AsyncResponse.resume(Throwable)
>>
>> * For the provided throwable same rules apply as for an exception
>> thrown
>> * by a {_at_link javax.ws.rs.HttpMethod JAX-RS resource method}.
>> * The processing of the throwable by JAX-RS framework follows the
>> same path
>> * as it would for any exception thrown by a JAX-RS resource method.
>>
>>
>> So, if the Throwable is a WebApplicationException, or there is a mapper,
>> then resume can send a response. If neither of those conditions are
>> met, then return false?
>>
>
> ANother question is, shouldn't the connection be closed if there is an error while resuming or cancelling?
> --
> Bill Burke
> JBoss, a division of Red Hat
> http://bill.burkecentral.com