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 Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Iterator<Event>
drainPriorityEvents()
void
fire(Event event)
Fires an event<T extends Event>
Tfirst(Class<T> clazz)
Returns the first regular (non-priority) event of a specific typevoid
invalidate()
Invalidates all regular (non-priority) events.void
invalidate(Event event)
Invalidates a specific (non-priority) eventvoid
invalidate(Class<? extends Event> clazz)
Invalidates all regular (non-priority) events of a specific typeIterator<Event>
iterator()
Returns an iterator over all regular (non-priority) events<T extends Event>
Iterator<T>iterator(Class<T> clazz)
Returns an iterator over all regular (non-priority) events of a specific typeIterator<Event>
peekPriorityEvents()
Peeks all priority events without draining them
-
-
-
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
-
drainPriorityEvents
@RestrictedMethod Iterator<Event> drainPriorityEvents()
-
iterator
<T extends Event> Iterator<T> iterator(Class<T> clazz)
Returns an iterator over all regular (non-priority) events of a specific type
-
-