This repository has been archived by the owner on Apr 30, 2019. It is now read-only.
Explicit EventHandler creation avoiding reflection #121
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The motivation behind this changes is to be able to create and register new event listeners in run-time, instead of depending on annotation reflection.
The original API for Bus instances is intact and all tests are passing.
This changes have been testes in the sample project and in a sandbox project loading Otto as a Maven dependency.
Commit message:
New register & unregister methods in Bus for explicit (not by reflection) EventHandler definition
Added a generic Callback interface to be extended (implemented) by third parties
Added a specific implementation of MethodCallingCallback with the original implementation of an EventHandler created by reflection of @subscribe annotations in objects
Added tests to cover added features
Added example of explicit registration&un-registration of Callbacks in sample project