Class EventBusImplementation

  • All Implemented Interfaces:
    EventBus

    public class EventBusImplementation
    extends java.lang.Object
    implements EventBus
    • Constructor Detail

      • EventBusImplementation

        public EventBusImplementation()
    • Method Detail

      • 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

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

        public void fire​(java.lang.Object 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)
      • 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)
      • removeHandler

        public void removeHandler​(AbstractHandler listenerHandler)
      • 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)