Commit Graph

14 Commits

Author SHA1 Message Date
Kai S. K. Engelbart 205a183db7
Allow nested dispatches by keeping track of nesting count 2021-07-12 10:24:48 +02:00
Kai S. K. Engelbart 6eebd3c121
Pass errors caused during system event dispatch to caller
When an error is caused during the dispatch of a system event, a warning
has been logged instead instead of rethrowing the error. This has been
fixed.

This enables failing a JUnit test when an exception event handler is
invoked.
2021-07-07 22:06:07 +02:00
Kai S. K. Engelbart 51f10c4144
Merge pull request 'Listener-Level Properties' (#13) from f/listener-level-properties into develop
Reviewed-on: https://git.kske.dev/kske/event-bus/pulls/13
Reviewed-by: delvh <leon@kske.dev>
2021-03-17 07:56:22 +01:00
Kai S. K. Engelbart f74b953db8
Replace hardcoded priority value by constant 2021-03-16 10:17:24 +01:00
Kai S. K. Engelbart 122106bf39
Transparently propagate event handler errors
When an exception occurs during the execution of an event handler, it is
caught, wrapped inside an exception event and dispatched on the event
bus.

This applies to any throwable, but is not very useful for errors, as
these are not normally caught. Assertion errors in particular, which are
used in unit tests, should not be caught, as this would cause the test
runner to miss a failed test.

Therefore, errors are now transparently passed through to the caller of
the dispatch method.
2021-03-15 08:29:15 +01:00
Kai S. K. Engelbart 2ec0a82a96
Respect listener-level properties 2021-03-14 11:18:11 +01:00
Kai S. K. Engelbart 7c3cd017de
Add system events section to README 2021-02-21 13:50:12 +01:00
Kai S. K. Engelbart 6a2cad4ae5
Add ExceptionEvent
An exception event wraps an event that caused an exception inside of an
event handler while being dispatched and is then dispatched to dedicated
handlers.
2021-02-21 10:36:06 +01:00
Kai S. K. Engelbart b2fe3a9d6c
Log unhandled dead events 2021-02-20 22:10:48 +01:00
Kai S. K. Engelbart 0036dc4829
Add DeadEvent
A dead events wraps an event that was dispatched but not delivered to
any handler. The dead event is than dispatched to dedicated handlers.
2021-02-19 16:05:11 +01:00
Kai S. K. Engelbart 002180ed3b
Remove EventListener and IEvent marker interfaces
This allows Event Bus to interface with existing classes without
modification.
2021-02-15 20:36:09 +01:00
Kai S. K. Engelbart 3a6ebe9a19
Replace includeSubtypes with @Polymorphic
The new @Polymorphic annotation serves the exact same purpose as
@Event(includeSubtypes = true), but should be easier to read in complex
handler declarations. It has to be used in conjunction with the @Event
annotation, not instead of it.
2021-02-15 10:55:30 +01:00
Kai S. K. Engelbart e040f6ab1b
Simplify binding access calls in EventBus 2021-02-15 09:25:16 +01:00
Kai S. K. Engelbart fd255d65cc
Rename event-bus module to event-bus-core, add event-bus-ap module
event-bus is now a parent project containing the two modules
event-bus-core (the previous event-bus) and event-bus-ap (annotation
processor).

The version of the parent project (and thus that of the modules) has
been bumped to 1.0.0, as this change breaks compatibility with previous
versions due to the different artifact, module and package names.
2021-02-09 09:52:26 +01:00