Skip to content
This repository has been archived by the owner on Jan 6, 2021. It is now read-only.

Sequential EventProviders

Simon Taddiken edited this page Apr 25, 2014 · 1 revision

An EventProvider implementation is said to be sequential, if it guarantees that for a listener class c, all listeners registered for this class are notified in the order in which they have been added to the EventProvider using .addListener(c, listener).

EventProvider implementations report this property with the getter isSequential(). Sequential EventProviders are required when extended jeve features like aborting the event delegation should be used while maintaining determinism. When setting the isHandled() property of an Event instance to true during a non-sequential event delegation process, it is unclear which listeners are actually notified and which are not.

Most implementations of EventProviders which come with jeve are sequential. Here is a full list:

Sequential EventProviders:

  • Abstract implementation in AbstractEventProvider
  • DefaultEventProvider
  • AsynchronousEventProvider
  • AWTEventProvider

Non-Sequential EventProviders (since jeve version 1.1.0 only)

  • ParallelEventProvider

Implementation Note

The getListeners(Class) method is specified to always return a list of listeners which is ordered in the way they were added. This behavior is implementad accordingly in AbstractEventProvider and covered by the provided basic test cases.

Testing Note

The provided basic tests also contain cases which test whether the order of notification is adhered by the various EventProvider implementations. Those test cases will be skipped (i.e. they always report success) for non-sequential EventProviders.

Clone this wiki locally