Package tigase.eventbus.impl

## Class EventBusImplementation

- java.lang.Object
- - tigase.eventbus.impl.EventBusImplementation

- All Implemented Interfaces:
    `EventBus`

      public class EventBusImplementation
      extends java.lang.Object
      implements EventBus

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class | Description
    --- | --- | ---
    `static interface` | `EventBusImplementation.InternalEventbusEvent` |
    `static class` | `EventBusImplementation.ListenerAddedEvent` |
    `static class` | `EventBusImplementation.ListenerRemovedEvent` |

  - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `EventBusImplementation()` |

  - ### Method Summary

    All Methods Instance Methods Concrete Methods Deprecated Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `void` | `addHandler​(AbstractHandler listenerHandler)` |
    `<T> void` | `addListener​(java.lang.Class<T> eventClass, EventListener<T> listener)` | Adds listener of event to EventBus.
    `<T> void` | `addListener​(java.lang.Class<T> eventClass, EventSourceListener<T> listener)` |
    `void` | `addListener​(java.lang.String packageName, java.lang.String eventName, EventListener<Element> listener)` | Deprecated.
    `void` | `addListener​(java.lang.String packageName, java.lang.String eventName, EventSourceListener<Element> listener)` | Deprecated.
    `protected void` | `doFireThreadPerHandler​(java.lang.Object event, java.lang.Object source, boolean remotelyGeneratedEvent, java.util.HashSet<AbstractHandler> handlers)` |
    `void` | `fire​(java.lang.Object event)` | Deprecated.
    `void` | `fire​(java.lang.Object event, java.lang.Object source)` |
    `void` | `fire​(java.lang.Object event, java.lang.Object source, boolean remotelyGeneratedEvent)` |
    `void` | `fire​(EventBusEvent event)` | Fires event.
    `java.util.Collection<AbstractHandler>` | `getAllHandlers()` |
    `java.util.Set<EventName>` | `getAllListenedEvents()` |
    `java.util.Collection<EventRoutedTransientFiller>` | `getEventRoutedTransientFillers​(java.lang.Class<?> eventClass)` |
    `EventRoutingSelector` | `getEventRoutingSelector​(java.lang.Class<?> eventClass)` |
    `java.util.concurrent.Executor` | `getExecutor()` |
    `EventsRegistrar` | `getRegistrar()` |
    `Serializer` | `getSerializer()` |
    `boolean` | `isAcceptOnlyRegisteredEvents()` |
    `boolean` | `isListened​(java.lang.String eventPackage, java.lang.String eventName)` |
    `void` | `registerAll​(java.lang.Object consumer)` | 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)` |
    `void` | `removeHandler​(AbstractHandler listenerHandler)` |
    `<T> void` | `removeListener​(EventListener<T> listener)` | Removes listener from Eventbus.
    `<T> void` | `removeListener​(EventSourceListener<T> listener)` |
    `void` | `setAcceptOnlyRegisteredEvents​(boolean acceptOnlyRegisteredEvents)` |
    `void` | `setExecutor​(java.util.concurrent.Executor executor)` |
    `void` | `unregisterAll​(java.lang.Object consumer)` | Unregister all methods annotated with `@HandleEvent` as events handlers from EventBus.

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

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

- - ### Constructor Detail

    - #### EventBusImplementation

          public EventBusImplementation()

  - ### Method Detail

    - #### addHandler

          public void addHandler​(AbstractHandler listenerHandler)

    - #### addListener

          public <T> void addListener​(java.lang.Class<T> eventClass,
                                      EventListener<T> listener)

      Description copied from interface: `EventBus`
      Adds listener of event to EventBus.
      Specified by:
        `addListener` in interface `EventBus`
      Type Parameters:
        `T` - class of event.
      Parameters:
        `eventClass` - class of expected event.
        `listener` - listener.

    - #### addListener

          public <T> void addListener​(java.lang.Class<T> eventClass,
                                      EventSourceListener<T> listener)

    - #### addListener

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

      Deprecated.
      Description copied from interface: `EventBus`
      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.
      Specified by:
        `addListener` in interface `EventBus`
      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.

    - #### addListener

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

      Deprecated.

    - #### fire

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

      Deprecated.
      Description copied from interface: `EventBus`
      Fires event.
      Specified by:
        `fire` in interface `EventBus`
      Parameters:
        `event` - event to fire.

    - #### fire

          public void fire​(EventBusEvent event)

      Description copied from interface: `EventBus`
      Fires event.
      Specified by:
        `fire` in interface `EventBus`
      Parameters:
        `event` - event to fire.

    - #### fire

          public void fire​(java.lang.Object event,
                           java.lang.Object source)

    - #### fire

          public void fire​(java.lang.Object event,
                           java.lang.Object source,
                           boolean remotelyGeneratedEvent)

    - #### getAllHandlers

          public java.util.Collection<AbstractHandler> getAllHandlers()

    - #### getAllListenedEvents

          public java.util.Set<EventName> getAllListenedEvents()

    - #### getEventRoutedTransientFillers

          public java.util.Collection<EventRoutedTransientFiller> getEventRoutedTransientFillers​(java.lang.Class<?> eventClass)

    - #### getEventRoutingSelector

          public EventRoutingSelector getEventRoutingSelector​(java.lang.Class<?> eventClass)

    - #### getExecutor

          public java.util.concurrent.Executor getExecutor()

    - #### setExecutor

          public void setExecutor​(java.util.concurrent.Executor executor)

    - #### getRegistrar

          public EventsRegistrar getRegistrar()

    - #### getSerializer

          public Serializer getSerializer()

    - #### isAcceptOnlyRegisteredEvents

          public boolean isAcceptOnlyRegisteredEvents()

    - #### setAcceptOnlyRegisteredEvents

          public void setAcceptOnlyRegisteredEvents​(boolean acceptOnlyRegisteredEvents)

    - #### isListened

          public boolean isListened​(java.lang.String eventPackage,
                                    java.lang.String eventName)

    - #### registerAll

          public void registerAll​(java.lang.Object consumer)

      Description copied from interface: `EventBus`
      Register all methods annotated with `@HandleEvent` as events handlers to EventBus.
      Specified by:
        `registerAll` in interface `EventBus`
      Parameters:
        `consumer` - events consumer object.

    - #### registerEvent

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

      Specified by:
        `registerEvent` in interface `EventBus`

    - #### registerEvent

          public void registerEvent​(java.lang.Class<?> event,
                                    java.lang.String description,
                                    boolean privateEvent)

      Specified by:
        `registerEvent` in interface `EventBus`

    - #### removeHandler

          public void removeHandler​(AbstractHandler listenerHandler)

    - #### removeListener

          public <T> void removeListener​(EventSourceListener<T> listener)

    - #### removeListener

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

      Description copied from interface: `EventBus`
      Removes listener from Eventbus.
      Specified by:
        `removeListener` in interface `EventBus`
      Parameters:
        `listener` - listener to remove.

    - #### unregisterAll

          public void unregisterAll​(java.lang.Object consumer)

      Description copied from interface: `EventBus`
      Unregister all methods annotated with `@HandleEvent` as events handlers from EventBus.
      Specified by:
        `unregisterAll` in interface `EventBus`
      Parameters:
        `consumer` - events consumer object.

    - #### doFireThreadPerHandler

          protected void doFireThreadPerHandler​(java.lang.Object event,
                                                java.lang.Object source,
                                                boolean remotelyGeneratedEvent,
                                                java.util.HashSet<AbstractHandler> handlers)