Interface IEventBroker
public interface IEventBroker
To obtain an instance of the event broker service from the
IEclipseContext context, use
context.get(IEventBroker.class)
- Since:
- 1.1
- Restriction:
- This interface is not intended to be implemented by clients.
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionbooleanPublish event asynchronously (this method returns immediately).booleanPublish event synchronously (the method does not return until the event is processed).booleansubscribe(String topic, String filter, EventHandler eventHandler, boolean headless) Subscribe for events on the given topic.booleansubscribe(String topic, EventHandler eventHandler) Subscribe for events on the given topic.booleanunsubscribe(EventHandler eventHandler) Unsubscribe handler previously registered usingsubscribe(String, EventHandler).
-
Field Details
-
DATA
The name of the default event attribute used to pass data.- See Also:
-
-
Method Details
-
send
Publish event synchronously (the method does not return until the event is processed).If data is a
Mapor aDictionary, it is passed as is. Otherwise, a new Map is constructed and itsDATAattribute is populated with this value.- Parameters:
topic- topic of the event to be publisheddata- data to be published with the event- Returns:
trueif this operation was performed successfully;falseotherwise
-
post
Publish event asynchronously (this method returns immediately).If data is a
Mapor aDictionary, it is passed as is. Otherwise, a new Map is constructed and itsDATAattribute is populated with this value.- Parameters:
topic- topic of the event to be publisheddata- data to be published with the event- Returns:
trueif this operation was performed successfully;falseotherwise
-
subscribe
Subscribe for events on the given topic.The handler will be called on the UI thread.
- Parameters:
topic- topic of interesteventHandler- object to call when an event of interest arrives- Returns:
trueif this operation was performed successfully;falseotherwise
-
subscribe
Subscribe for events on the given topic.The handler will be called on the UI thread if "headless" is set to
false.- Parameters:
topic- topic of interestfilter- the LDAP event filtereventHandler- object to call when an event of interest arrivesheadless-trueif handing of the events does not require UI;falseotherwise- Returns:
trueif this operation was performed successfully;falseotherwise
-
unsubscribe
Unsubscribe handler previously registered usingsubscribe(String, EventHandler).- Parameters:
eventHandler- previously registered event handler- Returns:
trueif this operation was performed successfully;falseotherwise
-