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

Martin Kouba (JIRA) issues at jboss.org
Wed Mar 23 11:06:00 EDT 2016


Martin Kouba created CDI-592:
--------------------------------

             Summary: 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 (discussion)


{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