Class EventBusImplementation

java.lang.Object
tigase.eventbus.impl.EventBusImplementation
All Implemented Interfaces:
EventBus

public class EventBusImplementation extends Object implements EventBus
  • Constructor Details

    • EventBusImplementation

      public EventBusImplementation()
  • Method Details

    • 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

      @Deprecated public void addListener(String packageName, 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(String packageName, String eventName, EventSourceListener<Element> listener)
      Deprecated.
    • fire

      @Deprecated public void fire(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(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)
      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(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)