The EventBus is a simple but powerful publish/subscribe API with annotations that allows POJOs to communicate with each other anywhere in a JVM without having to refer to each other. EventBus subscriptions are based on class semantics and/or string (topic) matching. The EventBus is fit for general purpose usage and has extensions for UI development.
The publish/subscribe pattern is commonly used to decouple components, make testing easier, and program by contract. It replaces the tight coupling introduced by explicit listeners with a flexible loosely coupled design. The EventBus is production ready and used in many applications, including financial UIs, scientific simulations, and the most popular Java desktop application, Limewire. The EventBus is well tested and has very good documentation.
The EventBus is not a JMS competitor. The EventBus is for pub/sub communication within a VM. The EventBus is often used by JMS listeners to route events internally once they are pulled off the JMS queue or topic.
EventBus 1.x is stable, well tested, well documented and suitable for general purpose Java applications and UIs, including Swing, SWT, and Apache Pivot.
EventBus 2.x is a work in progress. It will use the newly acquired org.eventbus package and will be extended to other UI toolkits and RIAs such as Javascript, GWT, and Flex. Update 3/2013: The EventBus has gone stale and is unlikely to be extended to other platforms. Suitable, though more primitive, replacements can be found for GWT (GWT EventBus), Javascript (TIBCO PageBus - an OpenAjax Hub implementation) and Flex (Parsley's Messaging)
The article demonstrates common UI pub/sub patterns using Apache Pivot. No matter what UI technology you use, this article will show you what the EventBus can do for your UIs, and you'll learn about Apache Pivot along the way.