[jax-rs-spec users] [jsr339-experts] Re: Re: callbacks continued...

From: Bill Burke <>
Date: Wed, 22 Aug 2012 17:56:27 -0400

On 8/22/2012 4:32 PM, Marek Potociar wrote:
> FYI - the change is in:
> I have decided to leave out onError() from CompletionCallback in the end
> as it didn't make sense when I was trying to document the method.
> Perhaps if someone could explain me better when the method would be
> called and why we need it, I can add it.

Its a must, IMO. Basically it would get called when the server is
unable to stream the Response back to the client (socket closed or

Use Case(for the 3rd time I'll repeat myself):

You ahve a transaction that if the response is *successfully* sent back
to the client (over the wire) commit the transaction. If the response
failed to be streamed back to the client (socket closed or some other
IOException), the rollback the transaction.

"transaction" doesn't necessarily have to be a JTA transaction, but
rather a service that needs to know whether or not the response was
streamed back to the client so that it can perform accordingly.

FYI, this callback exists in Servlet 3 async listener too.

Bill Burke
JBoss, a division of Red Hat