Interface EventBus

    • Method Detail

      • addListener

        <T> void addListener​(java.lang.Class<T> eventClass,
                             EventListener<T> listener)
        Adds listener of event to EventBus.
        Type Parameters:
        T - class of event.
        Parameters:
        eventClass - class of expected event.
        listener - listener.
      • addListener

        void addListener​(java.lang.String packageName,
                         java.lang.String eventName,
                         EventListener<Element> listener)
        Adds listener of event to EventBus. If event matching to given packageName and eventName will be fired as Object (not Element), then event will be converted to XML.
        Parameters:
        packageName - package of event to listen.
        eventName - name of event to listen. May be null, then listener is listening for all events with specific package name.
        listener - listener.
      • fire

        void fire​(java.lang.Object event)
        Fires event.
        Parameters:
        event - event to fire.
      • registerAll

        void registerAll​(java.lang.Object eventConsumer)
        Register all methods annotated with @HandleEvent as events handlers to EventBus.
        Parameters:
        eventConsumer - events consumer object.
        Throws:
        RegistrationException - if it is impossible to register all handlers method.
      • registerEvent

        void registerEvent​(java.lang.String event,
                           java.lang.String description,
                           boolean privateEvent)
      • removeListener

        <T> void removeListener​(EventListener<T> listener)
        Removes listener from Eventbus.
        Parameters:
        listener - listener to remove.
      • unregisterAll

        void unregisterAll​(java.lang.Object eventConsumer)
        Unregister all methods annotated with @HandleEvent as events handlers from EventBus.
        Parameters:
        eventConsumer - events consumer object.