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 Concrete 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` | `addHandler(Class<? extends Event<H>> type, Object source, H handler)` Adds handler to receive given type of events from specified source.
    `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(Class<? extends Event<H>> type, Object source, EventListener listener)` Adds listener to receive given type of events from specified source.
    `abstract <H extends EventHandler> void` | `addListener(EventListener listener)` Adds listener to receive all types events.
    `abstract void` | `fire(Event<?> e)` Fires event.
    `abstract void` | `fire(Event<?> e, Object source)` Fires event.
    `abstract void` | `remove(Class<? extends Event<?>> type, EventHandler handler)` Removes listener or handler of given type.
    `abstract void` | `remove(Class<? extends Event<?>> type, Object source, EventHandler handler)` Removes listener or handler of given type added registered to receive event from specified source.
    `abstract void` | `remove(EventHandler handler)` Removed listener or handler.
    `protected void` | `setEventSource(Event<EventHandler> event, Object source)` Puts event source to event.

    - ### 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

    - #### addHandler

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

      Adds handler to receive given type of events from specified source.
      Parameters:
        `type` - type of event.
        `source` - source 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(Class<? extends Event<H>> type,
                                                                    Object source,
                                                                    EventListener listener)

      Adds listener to receive given type of events from specified source.
      Parameters:
        `type` - type of event.
        `source` - source 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

    - #### fire

          public abstract void fire(Event<?> e,
                                    Object source)

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

    - #### 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(Class<? extends Event<?>> type,
                                      Object source,
                                      EventHandler handler)

      Removes listener or handler of given type added registered to receive event from specified source.
      Parameters:
        `type` - type of event.
        `source` - source 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.

    - #### setEventSource

          protected void setEventSource(Event<EventHandler> event,
                                        Object source)

      Puts event source to event.

Copyright © 2006–2016 Tigase. All rights reserved.