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

[jsr339-experts] Filters, Interceptors and Priorities

From: Jan Algermissen <jan.algermissen_at_nordsc.com>
Date: Wed, 24 Oct 2012 20:03:38 +0200

Hi,

another thing that has been on my mind is the binding priorities.

Suppose I have filters

Fa with AUTHENTICATION
Fb with AUTHORIZATION
Fc with USER

and reader interceptors

Ia with AUTHENTICATION
Ib with USER

the order in which these will be invoked is

Fa,Fb,Fc,Ia,Ib

correct?

Is it really desired that interceptors with an earlier binding priority (e.g. AUTHENTICATION) are called after the filters with later binding priorities?

Obviously the reader interceptors have to be called after the filters, but to me the ordering feels strange.

Should the container issue a warning if something like this is detected?

Is the developer responsible? Can he be, e.g. if interceptos and filters are provided by a 3rd party lib?


Again, my goal here is to be able to provide compelling answers to similar questions.


Jan