Class EventBusImpl

    • Constructor Detail

      • EventBusImpl

        public EventBusImpl()
    • Method Detail

      • publish

        public void publish​(Object event)
        Description copied from interface: EventBus
        Send the event to all interested subscribers.
        Specified by:
        publish in interface EventBus
        Parameters:
        event - the event to publish
      • reactTo

        public <T> SubscriptionId reactTo​(Class<T> tClass,
                                          Consumer<T> consumer)
        Description copied from interface: EventBus
        Adds the Consumer as Subscriber for the given event class.
        Specified by:
        reactTo in interface EventBus
        Type Parameters:
        T - the type of the event
        Parameters:
        tClass - the class of the event
        consumer - the Consumer to be called
        Returns:
        the Subscriber's SubscriptionId
      • unsubscribe

        public void unsubscribe​(SubscriptionId subscriptionId)
        Description copied from interface: EventBus
        Removes all Subscribers matching the given SubscriptionId.
        Specified by:
        unsubscribe in interface EventBus
        Parameters:
        subscriptionId - the SubscriptionId to be removed