tigase.eventbus

## Interface EventBus

- All Known Implementing Classes:
    EventBusImplementation

      public interface EventBus

- - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `<T> void` | `addListener(Class<T> eventClass, EventListener<T> listener)` Adds listener of event to EventBus.
    `void` | `addListener(String packageName, String eventName, EventListener<Element> listener)` Adds listener of event to EventBus.
    `void` | `fire(Object event)` Fires event.
    `void` | `registerAll(Object eventConsumer)` Register all methods annotated with `@HandleEvent` as events handlers to EventBus.
    `void` | `registerEvent(String event, String description, boolean privateEvent)`
    `<T> void` | `removeListener(EventListener<T> listener)` Removes listener from Eventbus.
    `void` | `unregisterAll(Object eventConsumer)` Unregister all methods annotated with `@HandleEvent` as events handlers from EventBus.

- - ### Method Detail

    - #### addListener

          <T> void addListener(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(String packageName,
                           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(Object event)

      Fires event.
      Parameters:
        `event` - event to fire.

    - #### registerAll

          void registerAll(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(String event,
                             String description,
                             boolean privateEvent)

    - #### removeListener

          <T> void removeListener(EventListener<T> listener)

      Removes listener from Eventbus.
      Parameters:
        `listener` - listener to remove.

    - #### unregisterAll

          void unregisterAll(Object eventConsumer)

      Unregister all methods annotated with `@HandleEvent` as events handlers from EventBus.
      Parameters:
        `eventConsumer` - events consumer object.

Copyright © 2004–2020 "Tigase, Inc.". All rights reserved.