users@jax-rs-spec.java.net

[jax-rs-spec users] [jsr339-experts] Re: Re: Latest async API changes

From: Santiago Pericas-Geertsen <Santiago.PericasGeertsen_at_oracle.com>
Date: Thu, 9 Aug 2012 13:44:00 -0400

On Aug 9, 2012, at 12:06 PM, Marek Potociar wrote:

>> Also, I do not think these methods belong on @Suspended
>>
>> Class<? extends TimeoutHandler> timeoutHandler() default DefaultTimeoutHandler.class;
>> Class<?>[] callbacks() default {};
>
> They have to be there so that a user has a chance of making sure the handler or callbacks get invoked in scenarios when the time-out interval is relatively small.
>>
>> DefaultTimeoutHandler should be removed as well.
>
> Not possible unless we remove the stuff from annotation, which I'm against. That's the only reasonable way how to provide a default value for the timeoutHandler annotation property.
>
>> IMO, having this kind of stuff in an annotation doesn't really provide any value or save any typing or generally make things easier on the developer. I would even make the case of removing timeout() or even the entire annotation. It's just a matter of what looks nicer?
>
> I prefer we keep it in the annotation so that we can start experimenting with deployment descriptors that would be able to override the annotation-set defaults in our implementations. But if more people feel we should remove all attributes from @Suspended for now, I would reconsider this.

 The default timeout is no timeout, so there's no need for a handler unless a timeout is specified. What if we find a way to specify the TimeoutHandler and the timeout as a unit? E.g., having the handler returned the timeout information or something like that.

-- Santiago