CDI introduced a convenient implementation of the observer pattern into the JavaEE world. Using the CDI API, components can emit events, or receive events created by other components (using the @Observes annotation). This allows developers to reduce the coupling between the emitters and the receivers of events.
However, the current API does not allow to handle what we call “global” events. Global events are propagated among all active sessions, i.e., current users and are not restricted to the current session.
This blog post briefly explores the CDI observer pattern and explains how it can be extended to support global events.