users@jax-rs-spec.java.net

[jax-rs-spec users] Re: evaluate Preconditions in an independent class

From: Santiago Pericas-Geertsen <Santiago.PericasGeertsen_at_oracle.com>
Date: Mon, 19 Mar 2012 11:27:24 -0400

Hi Thomas,

 Thanks for the feedback. Inlined …

> a) It isn't save against concurrent updates:
>
> @PUT
> ResponseBuilder rb = request.evaluatePreconditions(etag);
> // right now another concurrent request updates the resource
> if (rb == null)
> return doUpdate(foo);

 Not sure I follow. The default lifecycle in JAX-RS is per request. Each request will get it's own instance of the resource class.

>
> b) It does not return boolean but an instance of ResponseBuilder
>
> c) It can return null. Ugly.

 See Javadoc. This is done to provider the appropriate status and maybe the Vary header.

-- Santiago