Uploaded image for project: 'Hippo CMS'
  1. Hippo CMS
  2. CMS-5876

Improve the javadocs for the newly added HippoEventBus and add a default HippoEventListener interface such that developers only need to implement that interface

    XMLWordPrintable

Details

    • Improvement
    • Status: Closed
    • Normal
    • Resolution: Fixed
    • None
    • 2.23.01-alpha
    • None
    • None

    Description

      Currently, a developer has to do something like:

      HippoEventBus eventBus = HippoServiceRegistry.getService(HippoEventBus.class);
      eventBus.register(new Object() {

      @Subscribe
      void onEvent(HippoEvent event)

      { // do stuff }

      });

      I think it would be nice, since the current usage is really geared for HippoEvent, that a developer can also do:

      HippoEventBus eventBus = HippoServiceRegistry.getService(HippoEventBus.class);
      eventBus.register(new HippoEventListener() {
      @Override
      void onEvent(HippoEvent event) {

      }
      });

      Thus, the HippoEventListener interface already contains the 'subscribe' annotation, and also the correct type, namely HippoEvent

      Also, the HippoEventBus can refer to this available listener interface : This will make its usage easier for developers, while keeping the same flexibility

      Attachments

        Issue Links

          Activity

            People

              jsheriff Junaidh Kadhar Sheriff
              aschrijvers Ard Schrijvers
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: