[cdi-dev] [JBoss JIRA] (CDI-277) Clarify inheritance behavior of observer methods

Arne Limburg (JIRA) jira-events at lists.jboss.org
Sat Oct 13 15:03:01 EDT 2012


    [ https://issues.jboss.org/browse/CDI-277?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12726223#comment-12726223 ] 

Arne Limburg commented on CDI-277:
----------------------------------

OK, learned something ;-)
>From the wording of the 1.0 spec, especially the last paragraph of 4.3: "When an enabled bean [...] specializes a second bean, we can be
certain that the second bean is never instantiated or called by the container. Even if the second bean defines a producer or
observer method, the method will never be called."

So in fact in the scenario I described a method of BeanA would never be called because it is specialized by BeanC. I think this is pretty clear from the spec, but the sentence should be moved to some location earlier in that chapter, because auf it's importance. Anyway the specialization rules are quite clear with that sentence and @Mark: With this you get the possibility to disable a private observer by specialization.


                
> Clarify inheritance behavior of observer methods
> ------------------------------------------------
>
>                 Key: CDI-277
>                 URL: https://issues.jboss.org/browse/CDI-277
>             Project: CDI Specification Issues
>          Issue Type: Clarification
>            Reporter: Arne Limburg
>
> Chapter 4.2 of the (1.0) spec misses a bullet point about inheritance of observer methods.
> Either
> - If X declares a non-static observer method x() then Y does inherit this method.
> or
> - If X declares a non-static observer method x() then Y does not inherit this method.
> (This behavior is different to what is defined in the Common Annotations for the Java Platform specification.)
> should be added.
> Don't know, what's right through...

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


More information about the cdi-dev mailing list