Interface EventManager


  • public interface EventManager
    EventManager implements the event subsystem. Events are used for communication between modules or business objects. Compared to messages, events are only available on the client side but have more features than messages. Events can have a time to live and therefore can represent a state (i.e. are persistent for n frames or permanently, exclusively overwriting an existing event of the same type or accumulating) or are classic one-shot events even delivered still in the same frame (i.e. priority events). Although this manager contains methods to iterate over / peeking / draining events, the standard way is to subscribe on events from a module and getting callbacks.
    • Method Detail

      • fire

        void fire​(Event event)
        Fires an event
      • invalidate

        void invalidate()
        Invalidates all regular (non-priority) events. Use with care
      • invalidate

        void invalidate​(Event event)
        Invalidates a specific (non-priority) event
      • invalidate

        void invalidate​(Class<? extends Event> clazz)
        Invalidates all regular (non-priority) events of a specific type
      • peekPriorityEvents

        Iterator<Event> peekPriorityEvents()
        Peeks all priority events without draining them
      • iterator

        Iterator<Event> iterator()
        Returns an iterator over all regular (non-priority) events
      • iterator

        <T extends EventIterator<T> iterator​(Class<T> clazz)
        Returns an iterator over all regular (non-priority) events of a specific type
      • first

        <T extends Event> T first​(Class<T> clazz)
        Returns the first regular (non-priority) event of a specific type