[cdi-dev] [JBoss JIRA] (CDI-592) Consider adding ObserverMethod.notify() method which also accepts EventMetadata

Antoine Sabot-Durand (JIRA) issues at jboss.org
Tue Oct 11 04:54:00 EDT 2016


     [ https://issues.jboss.org/browse/CDI-592?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Antoine Sabot-Durand updated CDI-592:
-------------------------------------
    Sprint: Sprint 1


> Consider adding ObserverMethod.notify() method which also accepts EventMetadata
> -------------------------------------------------------------------------------
>
>                 Key: CDI-592
>                 URL: https://issues.jboss.org/browse/CDI-592
>             Project: CDI Specification Issues
>          Issue Type: Feature Request
>          Components: Events
>            Reporter: Martin Kouba
>             Fix For: 2.0 .Final
>
>
> {code:java}
> // Make the original method also default so that new impls don't need to implement two methods
> default void notify(T event) {
>   // No-op 
> }
> // The container should always call this method...
> default void notify(T event, EventMetadata metadata) {
>   notify(event);
> }
> {code}
> This should not break existing implementations. The truth is a custom impl will not be forced to implement any {{notify()}} method. But I think the benefits are worth it.



--
This message was sent by Atlassian JIRA
(v6.4.11#64026)


More information about the cdi-dev mailing list