users@jax-rs-spec.java.net

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

From: Jan Algermissen <jan.algermissen_at_nordsc.com>
Date: Wed, 24 Oct 2012 18:45:25 +0200

Santiago,

[sorry, more questions, but I like to make sure I understand]
>>
>> However, I still fail to see what interceptors can do that filers can't. Why do we need them?
>
> Here are some of the differences:
>
> (i) Clearly they are in different extension points in the pipeline

Yes, however the respective extension points are adjacent and there is really nothing I can do in an interceptor I could not do at the filter extension point directly before the interceptor extension point.

> (ii) Interceptors are wrapping and can access the entity in marshalled and unmarshalled forms

Filters can do that, too.

> (iii) ReaderInterceptors, just like MBRs, are called only if needed (based on application logic, for example, when Response.getEntity() is called on the client)

This I do not understand. Can you explain further.

>
> In a nutshell, they are there to extend/modify the functionality of MBRs and MBWs.

Well, but only if they are invoked in a request answering context ... in which the filters will be invoked, too.


I am also not trying to be difficult, but if someone asked me what they are good for I frankly could not tell.

And I'd really like to be able to do that in a compeling way. IOW, a use case driven way.


There must be a reason these where added to the API and most likely that has been use cases.

Can anyone remember these use case(s)?


And again, sorry. But I am actually completely lost with this.

Jan



>
> -- Santiago
>
>
>