Magnolia 5.4 reached end of life on November 15, 2018. This branch is no longer supported, see End-of-life policy.
Events play a large role in the Magnolia 5 architecture. As actions are performed, either on behalf of the user or by the system, events are fired and dispatched to interested components in the system.
There are four event buses used to dispatch events within the system.
You get access to these event buses by injecting them using an annotation qualifier called @Named
with a special name. (The names are system
, admincentral
, app
and subapp
.) The event buses are managed by the component providers managing the same scope. Therefore the app event bus is not available to objects managed by the AdminCentral component provider. However, objects in the parent are accessible to objects in child component providers. So, an object in a subapp can reach all the way up to the system event bus and register a handler.
@Inject public HelloWorldApp(AppContext appContext, @Named("app") EventBus appEventBus) { this.appContext = appContext; this.appEventBus = appEventBus; appEventBus.addHandler(ContentChangedEvent.class, this); }