tigase.jaxmpp.core.client.eventbus

## Class EventBus

- java.lang.Object
- - tigase.jaxmpp.core.client.eventbus.EventBus

- Direct Known Subclasses:
    DefaultEventBus

      public abstract class EventBus
      extends Object

  Dispatches events to all registered handlers and listeners.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `EventBus()`

  - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `abstract <H extends EventHandler> void` | `addHandler(Class<? extends Event<H>> type, H handler)` Adds handler to receive given type of events.
    `abstract <H extends EventHandler> void` | `addListener(Class<? extends Event<H>> type, EventListener listener)` Adds listener to receive given type of events.
    `abstract <H extends EventHandler> void` | `addListener(EventListener listener)` Adds listener to receive all types events.
    `abstract void` | `fire(Event<?> e)` Fires event.
    `abstract void` | `remove(Class<? extends Event<?>> type, EventHandler handler)` Removes listener or handler of given type.
    `abstract void` | `remove(EventHandler handler)` Removed listener or handler.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### EventBus

          public EventBus()

  - ### Method Detail

    - #### addHandler

          public abstract <H extends EventHandler> void addHandler(Class<? extends Event<H>> type,
                                                                   H handler)

      Adds handler to receive given type of events.
      Parameters:
        `type` - type of event.
        `handler` - event handler

    - #### addListener

          public abstract <H extends EventHandler> void addListener(Class<? extends Event<H>> type,
                                                                    EventListener listener)

      Adds listener to receive given type of events.
      Parameters:
        `type` - type of event.
        `listener` - event listener.

    - #### addListener

          public abstract <H extends EventHandler> void addListener(EventListener listener)

      Adds listener to receive all types events.
      Parameters:
        `listener` - event listener.

    - #### fire

          public abstract void fire(Event<?> e)

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

    - #### remove

          public abstract void remove(Class<? extends Event<?>> type,
                                      EventHandler handler)

      Removes listener or handler of given type.
      Parameters:
        `type` - type of event.
        `handler` - handler or listener to remove from EventBus.

    - #### remove

          public abstract void remove(EventHandler handler)

      Removed listener or handler.
      Parameters:
        `handler` - handler or listener to remove from EventBus.

Copyright © 2006–2023 Tigase. All rights reserved.