-
Notifications
You must be signed in to change notification settings - Fork 147
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Generic messages are delivered to all handlers of the class #83
Comments
I would imagine this is because of Java Type Erasure. Since mbassador uses reflection, the generic types are lost when the handlers are looked up. |
Hi Paul,
Check out this post to see how to get generic type parameters of methods. But MBassador DOES NOT YET SUPPORT the inspection of generic types at all, so you have to use subclasses or the Java EL filtering mechanism. |
Ah, very interesting! I stand corrected. |
Hi bennidi, first of all, thanks for all your hard work on the project.
I'm using MBassador 1.2 and I have a question regarding passing generic messages.
Suppose I have a class that supports generics
When I publish a GenericEvent, I notice that all handlers for GenericEvent gets called. For example, the following code:
produces the following output:
Is this expected?
I hope that only handlers with classes that are compatible with the message are called.
Thank you.
The text was updated successfully, but these errors were encountered: