[cdi-dev] [JBoss JIRA] (CDI-20) @Observes(propagate = false) - stop event propagation after being handled by an observer

Jens Schumann (JIRA) jira-events at lists.jboss.org
Sun Sep 2 16:22:32 EDT 2012


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

Jens Schumann commented on CDI-20:
----------------------------------

I personally would love to see more something like Provider<X> or Instance<X>, which is way more consistent to the current CDI/@Inject behavior. Due to the catch/solder merge I was unable to find "catch".

So I would go for something like

public void onEvent(@Observes @QualifierA @QualifierB EventTarget<X> event) {
 
}

where the (name TBD) "EventTarget" interface allows me to stop event propagation and access the event payload. EventTarget is obviously not right name though.
                
> @Observes(propagate = false) - stop event propagation after being handled by an observer
> ----------------------------------------------------------------------------------------
>
>                 Key: CDI-20
>                 URL: https://issues.jboss.org/browse/CDI-20
>             Project: CDI Specification Issues
>          Issue Type: Feature Request
>          Components: Events
>    Affects Versions: 1.0
>         Environment: any
>            Reporter: Walter White
>             Fix For: TBD
>
>
> I would like to have the ability to stop event propagation after it is handled by any observer only for certain situations.  Is it possible to add a property to the annotation indicating whether the propagation should continue after being handled by the observer?  Alternatively, would it be more concise to add a qualifier annotation which specifies the propagation.

--
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