users@jax-rs-spec.java.net

[jax-rs-spec users] [jsr339-experts] Re: Re: Is ResumeCallback needed

From: Marek Potociar <marek.potociar_at_oracle.com>
Date: Wed, 3 Oct 2012 16:13:48 -0700

Well, it is a generic extension point that lets you plug in any custom processing aspect. You may want to e.g. start measuring performace of how long it took to process filters in the response filter chain, remove the suspended response from some processing queue of yours, notify a transaction manager about a transactional context that has to be resumed, etc...

Marek

On Oct 2, 2012, at 2:00 AM, Sergey Beryozkin <sberyozkin_at_talend.com> wrote:

> So from another thread I'm getting a hint, using ResumeCallback is to do with the orthogonal (presumably to the use of AsyncResponse) use case.
>
> Would like to hear more about it please
>
> Sergey
>
> On 01/10/12 12:55, Sergey Beryozkin wrote:
>> Hi
>>
>> I wonder if
>>
>> http://jax-rs-spec.java.net/nonav/2.0-SNAPSHOT/apidocs/javax/ws/rs/container/ResumeCallback.html
>>
>>
>> is needed ?
>>
>> It does not harm, to have it, but it is really an extra check/execution
>> call as far as I can see. ResumeCallback can log the message, but what
>> else can it do, in addition to what the application code that either
>> resumes or cancels the invocation can and which has much more info about
>> why the response is resumed or cancelled ?
>>
>> It is only when a timeout occurs with no TimeoutHandler available when
>> ResumeCallback can report something that the application code does not
>> know about - in this case may be CompletionCallback can be extended with
>> 'onTimeout()',
>> so CompletionCallback will cover: the completion, the escaped exception
>> case, the timeout
>>
>> Sergey
>
>