users@jax-rs-spec.java.net

[jax-rs-spec users] [jsr339-experts] Name Binding Alignment with CDI

From: Santiago Pericas-Geertsen <Santiago.PericasGeertsen_at_oracle.com>
Date: Wed, 23 Jan 2013 10:38:53 -0500

Hello Experts,

 We recently had a discussion with Pete Muir related to name binding in JAX-RS and CDI (interceptor binding). As a result, I propose making a small change to our spec in order to align our semantics with CDI's.

 The proposed change relates to the use of multiple binding annotations. There are two sub-cases: (i) multiple binding annotations on a resource method or class and (ii) multiple binding annotations on the filter or interceptor.

 (i)

@A class MyFilter1 ...
@B class MyFilter2 ...

// Binds both MyFilter1 and MyFilter2
@A @B public Foo myMethod1() ...

 (ii)

@A @B class MyFilter ...

// Binds MyFilter
@A @B public Foo myMethod2() ...

 There are no changes w.r.t. (i), our semantics agreed with CDI's. Before this change, we could bind MyFilter to myMethod2() using either '_at_A or @B'. In order to align with CDI, we will now require both '_at_A and @B' as shown above.

 Overall, this is a rather minor change given that (i) is much more common than (ii), and aligning with exiting EE specifications is very important for the platform. Section 6.5.2 in the spec has been updated accordingly.

-- Santiago