Package tigase.eventbus

## Interface EventBus

- All Known Implementing Classes:
    `EventBusImplementation`

      public interface EventBus

- - ### Method Summary

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

          @Deprecated
          void addListener​(java.lang.String packageName,
                           java.lang.String eventName,
                           EventListener<Element> listener)

      Deprecated.
      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

          @Deprecated
          void fire​(java.lang.Object event)

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

    - #### fire

          void fire​(EventBusEvent 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

          @Deprecated
          void registerEvent​(java.lang.String event,
                             java.lang.String description,
                             boolean privateEvent)

      Deprecated.

    - #### registerEvent

          void registerEvent​(java.lang.Class<?> 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.