Class EventRouter

java.lang.Object
io.jmix.core.common.event.EventRouter

public class EventRouter extends Object
Generic Event router with lazily initialized event map.

This class is not thread-safe and should not be accessed concurrently from multiple threads without proper synchronization.

  • Constructor Details

    • EventRouter

      public EventRouter()
  • Method Details

    • fireEvent

      public <L, E> void fireEvent(Class<L> listenerClass, BiConsumer<L,E> invoker, E event)
    • addListener

      public <L> void addListener(Class<L> listenerClass, L listener)
    • addListener

      public <L> void addListener(Class<L> listenerClass, L listener, Runnable runIfFirstListenerWasAdded)
    • removeListener

      public <L> void removeListener(Class<L> listenerClass, L listener)
    • removeListener

      public <L> void removeListener(Class<L> listenerClass, L listener, Runnable runIfLastListenerWasRemoved)
    • removeListeners

      public <L> void removeListeners(Class<L> listenerClass)
    • hasListeners

      public <L> boolean hasListeners(Class<L> listenerClass)