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

[jsr339-experts] Re: [jax-rs-spec users] Ordering of global and name-bound filters

From: Sergey Beryozkin <sberyozkin_at_talend.com>
Date: Thu, 13 Sep 2012 15:38:54 +0100

On 13/09/12 15:35, Sergey Beryozkin wrote:
> On 13/09/12 14:53, Santiago Pericas-Geertsen wrote:
>>
>> On Sep 13, 2012, at 7:17 AM, Sergey Beryozkin wrote:
>>
>>> When selecting the filters to be run, before a given selected
>>> resource method is invoked, what priority should be given to global
>>> filters as opposed to name-bound ones ?
>>>
>>> I know BindingPriority is there, but should name-bound filters be run
>>> first, and global filters afterwards, no matter of what their
>>> individual priorities are ?
>>
>> No, they are part of the same "post-matching chain". Therefore, should
>> be sorted by binding priority regardless of their kind.
>
> I still think it should be used at least as a secondary key, which will
> do well in cases where no BindingPriority is used on filters.
>
> If I have 2 global and 3 name-bound filters, I'm not keen and adding 1,
> 2, 3, 4, 5 priority annotations, but I'd like to make sure global
> filters are executed say before name-bound filters
>

Especially when we have different methods having their own name-bound
filters, with some of the name-bound filters mixed up between different
methods. It can be awkward to ensure say all name-bound ones have
priority number set up right for an expectation that say global filters
will run before or after name bound ones

Sergey