tigase.eventbus.impl

## Class EventBusImplementation

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

- All Implemented Interfaces:
    EventBus

      public class EventBusImplementation
      extends Object
      implements EventBus

- - ### Nested Class Summary

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

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `EventBusImplementation()`

  - ### Method Summary

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

    - #### addListener

          public void addListener(String packageName,
                                  String eventName,
                                  EventListener<Element> listener)

      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

          public void addListener(String packageName,
                                  String eventName,
                                  EventSourceListener<Element> listener)

    - #### fire

          public void fire(Object event)

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

    - #### fire

          public void fire(Object event,
                           Object source)

    - #### fire

          public void fire(Object event,
                           Object source,
                           boolean remotelyGeneratedEvent)

    - #### getAllHandlers

          public Collection<AbstractHandler> getAllHandlers()

    - #### getAllListenedEvents

          public Set<EventName> getAllListenedEvents()

    - #### getEventRoutedTransientFillers

          public Collection<EventRoutedTransientFiller> getEventRoutedTransientFillers(Class<?> eventClass)

    - #### getEventRoutingSelector

          public EventRoutingSelector getEventRoutingSelector(Class<?> eventClass)

    - #### getExecutor

          public Executor getExecutor()

    - #### setExecutor

          public void setExecutor(Executor executor)

    - #### getRegistrar

          public EventsRegistrar getRegistrar()

    - #### getSerializer

          public Serializer getSerializer()

    - #### isAcceptOnlyRegisteredEvents

          public boolean isAcceptOnlyRegisteredEvents()

    - #### setAcceptOnlyRegisteredEvents

          public void setAcceptOnlyRegisteredEvents(boolean acceptOnlyRegisteredEvents)

    - #### isListened

          public boolean isListened(String eventPackage,
                                    String eventName)

    - #### registerAll

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

      Specified by:
        `registerEvent` in interface `EventBus`

    - #### registerEvent

          public void registerEvent(Class<?> event,
                                    String description,
                                    boolean privateEvent)

    - #### 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(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(Object event,
                                                Object source,
                                                boolean remotelyGeneratedEvent,
                                                HashSet<AbstractHandler> handlers)

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