users@jax-rs-spec.java.net

[jax-rs-spec users] [jsr339-experts] some more on AsyncResponse

From: Bill Burke <bburke_at_redhat.com>
Date: Thu, 16 Aug 2012 11:39:28 -0400

* Why have a separate setTimeoutHandler() method? Why not just create
and register a TimeoutCallback?

* register() returns a boolean in some instances and AsyncResponse in
others and the javadoc is off. IMO, you don't need a boolean return
value , instead throw an UnsupportedOperationException or something.

* If anything, ResumeCallback happens before response is sent, isn't
this what a ContainerResponseFilter already does? Also, how could
ResumeCallback modify the response? Call AsyncResponse.resume()? If
so, how can you avoid an infinite loop? I question all this behavior.

* I don't like the current behavior of ResumeCallback and think it
should be removed.

* I think we should have similar Servlet 3.0 callbacks.

CompletionCallback
OnErrorCallback
TimeoutCallback

OnComplete and OnError callbacks are very interesting. Consider the
case where you only want to commit a transaction if the response was
sent to the client and want to rollback if it wasn't. ResumeCallback
doesn't handle either of those.





-- 
Bill Burke
JBoss, a division of Red Hat
http://bill.burkecentral.com