jsr342-experts@javaee-spec.java.net

[jsr342-experts] Re: [javaee-spec users] Re: managed beans, injection, and interceptors

From: Bill Shannon <bill.shannon_at_oracle.com>
Date: Thu, 06 Dec 2012 16:03:30 -0800

Using the existing annotation for something that was not exactly the existing
interceptors would be confusing.

The same name in a different package would be more confusing.

We had a long offline conversation about a way to generalize the binding
annotation so that it could be used in more places, but in the end we couldn't
come up with something that worked. We may revisit it in the future, but we
just ran out of time and ideas for now.

For now we have to be satisfied with JAX-RS using the same design pattern as CDI
for interceptor bindings.

Antonio Goncalves wrote on 12/06/2012 10:43 AM:
> I'm forwarding an email from Marek to the list. Thanks Marek for your precisions
>
> But I'm still a bit concern about the term "NameBinding". We already have an
> InterceptorBinding in CDI. Wouldn't it be good to use CDI InterceptorBinding ?
> I know that would make JAX-RS "dependent" on CDI. If it's not possible, what
> about calling yours the same name but in a different package
> (javax.ws.rs.InterceptorBinding) ?
>
> Antonio
>
> On Thu, Dec 6, 2012 at 2:30 PM, Marek Potociar <marek.potociar_at_oracle.com
> <mailto:marek.potociar_at_oracle.com>> wrote:
>
> Hi Antonio,
>
> I wish I could reply to the Java EE experts list, but I most likely
> cannot... Feel free to forward.
>
> JAX-RS has *entity provider interceptors* (i.e. facility intercepting
> serialization and deserialization of HTTP message payloads - read: "very
> JAX-RS specific stuff").
> CDI has *method invocation interceptors* (i.e. facility intercepting Java
> method invocations on CDI beans).
>
> The only common thing for those two concepts is that they are both based
> on the "Chain of Interceptors" design pattern.
>
> As for the name, IMO both are interceptors (the name is derived from the
> design pattern). It may be confusing a bit initially, but I guess that
> thats the price we have to pay for assigning generic terms to specific
> concepts in Java EE. This is not the first time I'm hearing this feedback
> and we tried to come up with different names (e.g. handlers) but there's
> always seems to be another concept already in Java EE that took ownership
> of an otherwise generic name (e.g. with handlers it's a conflict with
> JAX-WS). At least in JAX-RS we do not call these components just
> "interceptors" we call them "entity provider interceptors" - which is what
> they are.
>
> I hope the above outlines the differences and sheds some light on the
> history behind of naming issues.
>
>
>
>
> --
> Antonio Goncalves
> Software architect and Java Champion
>
> Web site <http://www.antoniogoncalves.org> | Twitter
> <http://twitter.com/agoncal> | LinkedIn <http://www.linkedin.com/in/agoncal>
> | Paris JUG <http://www.parisjug.org> | Devoxx France <http://www.devoxx.fr>