e4 EventBroker
The e4 EventBroker is a service bus component which is not an OSGi component but an Eclipse e4 component which can be injected via @Inject
.
Map<String, Object> map = new HashMap<String, Object>(); map.put(IEventBroker.DATA, element); eventBroker.post(topic, map);
Additional data can be passed to the event receiver by adding them to the map.
Map<String, Object> map = new HashMap<String, Object>(); map.put(IEventBroker.DATA, element); map.put(another_property, property); eventBroker.post(topic, map);
It can also be much simple: Just pass object to the event broker. The event broker will wrap it into a map and return that to the receiver, key IEventBroker.DATA
.
eventBroker.post(topic, data);