Original issue created by eiden84 on 2011-11-07 at 12:30 PM
When I register an object calling EventBus#register, I have no way of knowing if the object was registered in the eventbus.
One possible solution is to have the register-method returns somthing else than void, like boolean or int, or provide some way of inspecting the event handlers that are registered in the eventbus.
Not knowing if an object was registered in the eventbus, causes some problems down the road.
EventBus#register accepts any object, while EventBus#unregister throws IllegalArgumentException if I pass an object that have handler methods, but was not previously registered in the eventbus.
If I wish to unregister a collection of objects, where some might have event handlers, I would have try-catch every call to unregister, or duplicate the logic in 'AnnotatedHandlerFinder' prior to calling unregister.
Related discussion:
http://groups.google.com/group/guava-discuss/browse_thread/thread/80e04c168b18a3d3
Original issue created by eiden84 on 2011-11-07 at 12:30 PM
When I register an object calling EventBus#register, I have no way of knowing if the object was registered in the eventbus.
One possible solution is to have the register-method returns somthing else than void, like boolean or int, or provide some way of inspecting the event handlers that are registered in the eventbus.
Not knowing if an object was registered in the eventbus, causes some problems down the road.
EventBus#register accepts any object, while EventBus#unregister throws IllegalArgumentException if I pass an object that have handler methods, but was not previously registered in the eventbus.
If I wish to unregister a collection of objects, where some might have event handlers, I would have try-catch every call to unregister, or duplicate the logic in 'AnnotatedHandlerFinder' prior to calling unregister.
Related discussion:
http://groups.google.com/group/guava-discuss/browse_thread/thread/80e04c168b18a3d3