-
Notifications
You must be signed in to change notification settings - Fork 1
Home
Eventcast was motivated by my experiences using Guava EventBus to implement various systems.
Go straight to the Eventcast usage page, or read more about how it differs from Guava EventBus.
You can download Eventcast from maven central.
Tightly integrated with Google Guice Eventcast provides support for publish-subscribe messaging between objects create by a guice injector.
Support for IDE refactoring and code navigation tools. In particular the method call used to send the message is the same as the method implemented to receive the message. This means that "find implementations" and "find callers" functionality in your IDE will continue to work as expected.
The only place that Eventcast needs to appear in your code is in the definition of your guice module. No custom annotations are needed or references to Eventcast types are needed to use most of the functionality.
If Guice can create your objects then you have probably got Eventcast set up right. Eventcast has no annotations to accidentally miss off your listener methods.
Messages are send using your own custom interfaces which you can mock freely. No need to mock any of the Eventcast classes.
The EventCaster can be used safely from any thread. If you want a message instance or listener to be used by multiple threads then you must make sure your implementation classes are thread safe too. Making your messages immutable by using the final
keyword can help with this.