tigase.disteventbus.impl

## Class LocalEventBus

- java.lang.Object
- - tigase.disteventbus.impl.LocalEventBus

- All Implemented Interfaces:
    EventBus

      public class LocalEventBus
      extends Object
      implements EventBus

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static String` | `EVENTBUS_INTERNAL_EVENTS_XMLNS`
    `static String` | `HANDLER_ADDED_EVENT_NAME`
    `static String` | `HANDLER_REMOVED_EVENT_NAME`
    `protected Logger` | `log`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `LocalEventBus()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addHandler(String name, String xmlns, EventHandler handler)` Registers handler to receive events with given name and namespace.
    `protected EventsNameMap<EventHandler>` | `createHandlersMap()`
    `void` | `doFire(String name, String xmlns, Element event)`
    `void` | `fire(Element event)`
    `Set<EventName>` | `getAllListenedEvents()`
    `Executor` | `getExecutor()`
    `protected Collection<EventHandler>` | `getHandlersList(String name, String xmlns)`
    `boolean` | `hasHandlers(String name, String xmlns)`
    `void` | `removeHandler(String name, String xmlns, EventHandler handler)`
    `void` | `setExecutor(Executor executor)`
    `void` | `setThreadPool(int pool)`

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

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

- - ### Field Detail

    - #### EVENTBUS_INTERNAL_EVENTS_XMLNS

          public static final String EVENTBUS_INTERNAL_EVENTS_XMLNS

      See Also:
        Constant Field Values

    - #### HANDLER_ADDED_EVENT_NAME

          public static final String HANDLER_ADDED_EVENT_NAME

      See Also:
        Constant Field Values

    - #### HANDLER_REMOVED_EVENT_NAME

          public static final String HANDLER_REMOVED_EVENT_NAME

      See Also:
        Constant Field Values

    - #### log

          protected final Logger log

  - ### Constructor Detail

    - #### LocalEventBus

          public LocalEventBus()

  - ### Method Detail

    - #### getExecutor

          public Executor getExecutor()

    - #### setExecutor

          public void setExecutor(Executor executor)

    - #### addHandler

          public void addHandler(String name,
                                 String xmlns,
                                 EventHandler handler)

      Description copied from interface: `EventBus`
      Registers handler to receive events with given name and namespace.
      Specified by:
        `addHandler` in interface `EventBus`
      Parameters:
        `name` - name of events. Can be `null`, then handler will be received all events with given `xmlns`.
        `xmlns` - namespace of events.
        `handler` - event handler.

    - #### createHandlersMap

          protected EventsNameMap<EventHandler> createHandlersMap()

    - #### doFire

          public void doFire(String name,
                             String xmlns,
                             Element event)

    - #### fire

          public void fire(Element event)

      Specified by:
        `fire` in interface `EventBus`

    - #### getAllListenedEvents

          public Set<EventName> getAllListenedEvents()

    - #### getHandlersList

          protected Collection<EventHandler> getHandlersList(String name,
                                                             String xmlns)

    - #### hasHandlers

          public boolean hasHandlers(String name,
                                     String xmlns)

    - #### removeHandler

          public void removeHandler(String name,
                                    String xmlns,
                                    EventHandler handler)

      Specified by:
        `removeHandler` in interface `EventBus`

    - #### setThreadPool

          public void setThreadPool(int pool)

Copyright © 2017 "Tigase, Inc.". All rights reserved.