Uploaded image for project: 'CDI Specification Issues'
  1. CDI Specification Issues
  2. CDI-36

ObserverMethod.notify() does not forward qualifiers for Event

    Details

    • Type: Feature Request
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Done
    • Affects Version/s: 1.0
    • Fix Version/s: 1.1.FD
    • Component/s: Events
    • Labels:
      None

      Description

      There's currently no way to get the qualifiers for a fired event. ObserverMethod.notify() only passes the event object itself. Without the qualifiers it is difficult to bridge the gap between CDI events and some other event infrastructure (e.g. JMS).

        Gliffy Diagrams

          Issue Links

            Activity

            Hide
            jharting Jozef Hartinger added a comment -

            ObserverMethod.notify(T event, Set<Annotation> qualifiers) was removed and no other version of the notify() method was introduced because that would break backwards compatibility with existing ObserverMethod implementations.

            See https://github.com/jboss/cdi/blob/master/api/src/main/java/javax/enterprise/inject/spi/ObserverMethod.java

            Show
            jharting Jozef Hartinger added a comment - ObserverMethod.notify(T event, Set<Annotation> qualifiers) was removed and no other version of the notify() method was introduced because that would break backwards compatibility with existing ObserverMethod implementations. See https://github.com/jboss/cdi/blob/master/api/src/main/java/javax/enterprise/inject/spi/ObserverMethod.java
            Hide
            arnelim Arne Limburg added a comment -

            OK, so we have no chance to add a method to the existing SPI interfaces?

            And that means we are not able to receive the EventMetadate from a custom implementation of ObserverMethod? That's not good, but anyway, then this can wait for the next version of CDI.

            Show
            arnelim Arne Limburg added a comment - OK, so we have no chance to add a method to the existing SPI interfaces? And that means we are not able to receive the EventMetadate from a custom implementation of ObserverMethod? That's not good, but anyway, then this can wait for the next version of CDI.
            Hide
            jharting Jozef Hartinger added a comment -

            You can lookup and inject EventMetadata in the ObserverMethod implementation.

            Show
            jharting Jozef Hartinger added a comment - You can lookup and inject EventMetadata in the ObserverMethod implementation.
            Hide
            arnelim Arne Limburg added a comment -

            Yes, for sure. But that's not convenient

            Show
            arnelim Arne Limburg added a comment - Yes, for sure. But that's not convenient
            Hide
            arnelim Arne Limburg added a comment -

            Since the method in question was not added, this can be closed again.

            Show
            arnelim Arne Limburg added a comment - Since the method in question was not added, this can be closed again.

              People

              • Assignee:
                pmuir Pete Muir
                Reporter:
                jganoff Jordan Ganoff
              • Votes:
                0 Vote for this issue
                Watchers:
                5 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Development