On 10/29/2012 11:27 AM, Jan Algermissen wrote:
>
> On Oct 29, 2012, at 4:20 PM, Jan Algermissen <jan.algermissen_at_nordsc.com> wrote:
>
>> Not trying to be difficult, but I feel as if I cannot see the forest for the trees.
>
> Do you mean that I can buffer the stream and then work on the buffered, marshalled form?
>
> IOW, do you mean that the writer interceptor is the only way to access the marshalled form from a JAX-RS managed class (that is: not from some hooked-in, non-JAX-RS managed stream filter object)?
>
A ContainerRequestFilter and ClientResponseFilter could get access to
the marshalled form by buffering into a ByteArrayInputStream. But, a
ClientResponseFilter does not know the Java type the application wants
to unmarshal into.
As for writing, an example of getting at the marshalled form is a
signature header, where you marshal into a buffer, calculate the has of
the message body, then signature then populate the resposne (or request)
header.
--
Bill Burke
JBoss, a division of Red Hat
http://bill.burkecentral.com