users@jax-rs-spec.java.net

[jax-rs-spec users] Re: Returning filters/interceptors from getClasses or getSingletons

From: Santiago Pericas-Geertsen <Santiago.PericasGeertsen_at_oracle.com>
Date: Wed, 2 Jan 2013 09:28:05 -0500

On Dec 28, 2012, at 4:35 PM, Arun Gupta <arun.p.gupta_at_oracle.com> wrote:

> 6.5.2 says
>
> -- cut here --
> Note that returning filters or interceptors from the methods getClasses or getSingletons in an application subclass will bind them globally only if they are not decorated with a name binding annotation.
> -- cut here --
>
>
> If filter or interceptor does not have any @NameBinding annotation then they are globally bound anyway. What is the use case of returning such a filter from getClasses or getSingletons ?

 They are bound globally only if they are automatically discovered. For that to happen, they must be annotated by @Provider. If they are not, then using the Application sub-class is the way to register them.

-- Santiago