EntityProvider changes

From: Marc Hadley <Marc.Hadley_at_Sun.COM>
Date: Thu, 16 Aug 2007 12:08:36 -0400

We'd like to suggest a couple of minor changes to EntityProvider:

(i) Include mediaType as an explicit argument in the writeTo method.
Currently an EntityProvider impl would have to go spelunking in the
headers to work out what its supposed to be writing if it supports
multiple media types.
(ii) Make the mediaType arguments of readFrom and writeTo be of type
MediaType rather than String.

A more substantive change might also be useful in some circumstances:
add an argument to readFrom and writeTo that supplies the current
instance of the resource class that will be used to service the
request. This would muddy the contract between a resource and entity
provider but could be useful to pass properties between the two that
are not fully realized in the entity. This would allow, e.g., a
resource class to supply its own JAXBContext to the JAXB entity

Thoughts ?

Marc Hadley <marc.hadley at>
CTO Office, Sun Microsystems.