Differences

This shows you the differences between two versions of the page.

Link to this comparison view

e4_event_broker [2014/04/21 12:06]
e4_event_broker [2021/04/05 11:23] (current)
Line 1: Line 1:
 +====== 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''.
  
 +<sxh java>
 +Map<String, Object> map = new HashMap<String, Object>();
 +map.put(IEventBroker.DATA, element);
 +eventBroker.post(topic, map);
 +</sxh>
 +
 +Additional data can be passed to the event receiver by adding them to the map.
 +<sxh java>
 +Map<String, Object> map = new HashMap<String, Object>();
 +map.put(IEventBroker.DATA, element);
 +map.put(another_property, property);
 +eventBroker.post(topic, map);
 +</sxh>
 +
 +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''.
 +
 +<sxh java>
 +eventBroker.post(topic, data);
 +</sxh>
 +
 +{{tag>e4 java}}