Commit Graph

114 Commits

Author SHA1 Message Date
36ed55fd71
Use void.class to determine how the event handler type is defined
Some checks failed
zdm/event-bus/pipeline/head There was a failure building this commit
The dummy class USE_PARAMETER was necessary when the IEvent interface
still existed, as void.class could not be used as a Class<? extends
IEvent>. As no explicit reference to USE_PARAMETER should be present
anywhere, a proper deprecation would've made little sense.
2022-01-12 19:41:53 +01:00
999a172e72
Merge pull request 'Inherit Event Handlers' (#34) from f/handler-inheritance into develop
All checks were successful
zdm/event-bus/pipeline/head This commit looks good
Reviewed-on: https://git.kske.dev/zdm/event-bus/pulls/34
Reviewed-by: delvh <leon@kske.dev>
2022-01-12 17:19:57 +01:00
722bf2b999
Test priorities for inheritance
All checks were successful
zdm/event-bus/pipeline/head This commit looks good
2022-01-12 15:59:45 +01:00
7fb633d69f
Inherit event handlers
All checks were successful
zdm/event-bus/pipeline/head This commit looks good
When registering an event listener, Event Bus recursively walks the
entire inheritance tree and looks for event handlers.
2022-01-09 14:16:30 +01:00
c5607d12ae
Fix SonarQube scan
All checks were successful
zdm/event-bus/pipeline/head This commit looks good
2022-01-09 11:49:10 +01:00
a8810c497f
Merge pull request 'Jenkinsfile with SonarQube Analysis' (#33) from f/jenkinsfile into develop
Some checks failed
zdm/event-bus/pipeline/head There was a failure building this commit
Reviewed-on: https://git.kske.dev/zdm/event-bus/pulls/33
Reviewed-by: delvh <leon@kske.dev>
2022-01-09 11:32:25 +01:00
ebb2191f4a
Make unit tests package-private
All checks were successful
zdm/event-bus/pipeline/head This commit looks good
2022-01-09 09:37:27 +01:00
09d251a02a
Add Jenkinsfile
All checks were successful
zdm/event-bus/pipeline/head This commit looks good
The Jenkinsfile performs packaging and testing on the project. When on
the develop branch, a SonarQube analysis is conducted.
2022-01-09 09:27:44 +01:00
27d14a844d
Merge pull request 'Exception Wrapper' (#32) from f/exception-wrapper into develop
Reviewed-on: https://git.kske.dev/kske/event-bus/pulls/32
Reviewed-by: delvh <leon@kske.dev>
Reviewed-by: DieGurke <maxi@kske.dev>
2022-01-08 16:54:05 +01:00
adbcc64e94
Add ExceptionWrapper documentation 2022-01-08 16:44:49 +01:00
84ae42b44f
Remove unnecessary new line 2022-01-08 15:02:35 +01:00
e53f356c54
Add exception wrapper with transparent delivery to the caller 2022-01-08 14:32:24 +01:00
d649f377b7
Merge pull request 'Shorten Module Names' (#30) from f/improve-project-structure into develop
Reviewed-on: https://git.kske.dev/kske/event-bus/pulls/30
Reviewed-by: delvh <leon@kske.dev>
2021-12-24 13:57:16 +01:00
897f1a20f3
Shorten module names 2021-12-24 11:09:14 +02:00
856a2e8cbf
Bump version to 1.2.0 2021-11-26 15:54:37 +01:00
11860d1469
Merge pull request 'Document Latest Features in README' (#27) from f/improved-readme into develop
Reviewed-on: https://git.kske.dev/kske/event-bus/pulls/27
Reviewed-by: delvh <leon@kske.dev>
2021-11-26 13:54:58 +01:00
f620f06208
Merge branch 'develop' into f/improved-readme
Conflicts:
	event-bus-core/src/test/java/dev/kske/eventbus/core/DispatchTest.java
2021-11-25 14:36:07 +01:00
5a6d8bcf35
Rename EventBus#printExecutionOrder(Class) to debugExecutionOrder
The method doesn't print anything, but rather returns a string
containing the debug information.
2021-11-25 14:34:13 +01:00
39ffb5c82a
Fix module-info instructions in README
Reflective access has to be allowed from the Event Bus core package to a
package in the user's project, not the entire module. Thank you @delvh
for noticing this!
2021-11-25 14:29:06 +01:00
5ddef71c26
Merge pull request 'Support JDK-style Javadoc Tags' (#28) from b/javadoc-tags into develop
Reviewed-on: https://git.kske.dev/kske/event-bus/pulls/28
Reviewed-by: delvh <leon@kske.dev>
2021-11-25 12:05:32 +01:00
85b2da391a
Merge pull request 'Make Unit Tests Executable by Maven' (#29) from b/unit-test-execution into develop
Reviewed-on: https://git.kske.dev/kske/event-bus/pulls/29
Reviewed-by: delvh <leon@kske.dev>
2021-11-25 12:04:26 +01:00
46a358da97
Make unit tests executable by Maven 2021-11-24 12:52:59 +01:00
6bf9e1097a
Support JDK-style Javadoc tags 2021-11-24 11:30:36 +01:00
3fccb809c8
Move installation section up in README 2021-11-24 10:49:30 +01:00
d1c4bcc7eb
Add callback listener section to README 2021-11-24 10:45:58 +01:00
ad29a93ccb
Add debugging section to README 2021-11-24 10:37:21 +01:00
e67b64678b
Merge pull request 'Add Callback Event Handling' (#26) from f/callback-handler into develop
Reviewed-on: https://git.kske.dev/kske/event-bus/pulls/26
Reviewed-by: delvh <leon@kske.dev>
2021-11-05 08:49:07 +01:00
c614beb063
Make CallbackEventHandler final 2021-11-04 15:55:24 +01:00
d3abb0aca3
Improve parameter naming for listener registration 2021-11-04 15:54:36 +01:00
ee688929fd
Add callback event handling
The EventHandler class has been converted to an interface, with the
reflection specific part being moved to the new ReflectiveEventHandler
class. Callback event handlers implement the same interface through the
CallbackEventHandler class.

The event handlers are defined in the new handler package, which is not
exported by the eventbus.core module.
2021-11-02 19:33:18 +01:00
897d794b86
Merge pull request 'Handler Execution Order Debugging' (#25) from f/handler-introspection into develop
Reviewed-on: https://git.kske.dev/kske/event-bus/pulls/25
Reviewed-by: delvh <leon@kske.dev>
2021-11-02 09:03:10 +01:00
40d48cb959
Merge pull request 'Improve Documentation in Code' (#24) from f/improved-documentation into develop
Reviewed-on: https://git.kske.dev/kske/event-bus/pulls/24
Reviewed-by: DieGurke <maxi@kske.dev>
2021-11-01 21:48:51 +01:00
b760c58298
Add a handler execution order debugging method 2021-11-01 21:36:24 +01:00
872b395374
Rephrase some Javadoc
As suggested by @delvh.
2021-11-01 20:52:14 +01:00
82c66c45ec
Improve EventBus Javadoc, make EventBusException final 2021-11-01 09:42:12 +01:00
866a547114
Merge pull request 'Initialize the Default Event Bus Statically' (#23) from f/static-singleton-initialization into develop
Reviewed-on: https://git.kske.dev/kske/event-bus/pulls/23
Reviewed-by: delvh <leon@kske.dev>
2021-10-16 08:33:08 +02:00
33ebf0302b
Initialize the default event bus statically
The previous method that used double checked synchronization offers
little performance benefits over a plain static initialization.

Reported-by @harkle-the-cake
2021-10-16 08:32:28 +02:00
b915a5c490
Merge pull request 'Properly Handle Nested Dispatches' (#19) from b/nested-dispatch into develop
Reviewed-on: https://git.kske.dev/kske/event-bus/pulls/19
Reviewed-by: delvh <leon@kske.dev>
2021-07-12 11:25:04 +02:00
205a183db7
Allow nested dispatches by keeping track of nesting count 2021-07-12 10:24:48 +02:00
74447dea59
Add nested dispatch test
The test performs a nested event dispatch then cancels the dispatch. If
Both operations are successful, the test is successful.

Currently, the test fails, but should be successful once the nested
dispatch bug is fixed.
2021-07-12 10:17:46 +02:00
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
b758f4cef1
Remove obsolete paragraph from README 2021-04-04 10:09:12 +02:00
0dcad7d178
Bump version to 1.1.0 2021-03-28 10:37:41 +02:00
c0cda7341b
Merge pull request 'Add @delvh as Contributor' (#15) from add-delvh-as-contributor into develop
Reviewed-on: https://git.kske.dev/kske/event-bus/pulls/15
Reviewed-by: delvh <leon@kske.dev>
2021-03-17 17:25:30 +01:00
b804243f4e
Add @delvh as contributor 2021-03-17 13:10:20 +01:00
0aef1c299b
Change license to Apache-2.0
This should allow for more compatibility with other Java applications,
including proprietary ones.
2021-03-17 12:57:43 +01:00
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
f74b953db8
Replace hardcoded priority value by constant 2021-03-16 10:17:24 +01:00
52719d22d4
Merge pull request 'Transparently Propagate Event Handler Errors' (#14) from b/error-passthrough into develop
Reviewed-on: https://git.kske.dev/kske/event-bus/pulls/14
Reviewed-by: delvh <leon@kske.dev>
Reviewed-by: DieGurke <maxi@kske.dev>
2021-03-16 08:17:41 +01:00
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