jsr339-experts@jax-rs-spec.java.net

[jsr339-experts] Re: [jax-rs-spec users] Re: Interceptor Invocation and CDI

From: Jan Algermissen <jan.algermissen_at_nordsc.com>
Date: Mon, 29 Oct 2012 16:20:37 +0100

On Oct 29, 2012, at 3:50 PM, Santiago Pericas-Geertsen <Santiago.PericasGeertsen_at_oracle.com> wrote:

>
> On Oct 28, 2012, at 3:37 PM, Jan Algermissen <jan.algermissen_at_nordsc.com> wrote:
>
>>
>> On Oct 24, 2012, at 6:30 PM, Santiago Pericas-Geertsen <Santiago.PericasGeertsen_at_oracle.com> wrote:
>>
>>> (ii) Interceptors are wrapping and can access the entity in marshalled and unmarshalled forms
>>
>> Actually, I don't understand this. What do you mean by 'has access to marshalled forms'?
>>
>> I'd say that a writer intercaptor, like a response filter, can only hook an output stream filter into the output stream.
>
> Given that interceptors are wrapping, it should in general be possible for a writer interceptor to use a byte stream to access the marshalled form of the entity during the unwrapping phase. Shouldn't it?

Sorry if I am missing something, but the interceptor never sees the stream when data is flowing through it, right? It can access the stream object before any byte is written and after. But to do anything inbetween, the interceptor -just like a filter- has to hook a 'stream filter' into the output stream.

Can you provide an example of how an interceptor can do anything with the marshalled form that a filter cannot do.

Not trying to be difficult, but I feel as if I cannot see the forest for the trees.

Jan






>
> -- Santiago
>