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

Martin Kouba (JIRA) issues at jboss.org
Wed Oct 19 08:13:00 EDT 2016


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

Martin Kouba reassigned CDI-592:
--------------------------------

    Assignee: Martin Kouba


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