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
-
Method Summary
Modifier and TypeMethodDescriptionboolean
Publish event asynchronously (this method returns immediately).boolean
Publish event synchronously (the method does not return until the event is processed).boolean
subscribe
(String topic, String filter, EventHandler eventHandler, boolean headless) Subscribe for events on the given topic.boolean
subscribe
(String topic, EventHandler eventHandler) Subscribe for events on the given topic.boolean
unsubscribe
(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
Map
or aDictionary
, it is passed as is. Otherwise, a new Map is constructed and itsDATA
attribute is populated with this value.- Parameters:
topic
- topic of the event to be publisheddata
- data to be published with the event- Returns:
true
if this operation was performed successfully;false
otherwise
-
post
Publish event asynchronously (this method returns immediately).If data is a
Map
or aDictionary
, it is passed as is. Otherwise, a new Map is constructed and itsDATA
attribute is populated with this value.- Parameters:
topic
- topic of the event to be publisheddata
- data to be published with the event- Returns:
true
if this operation was performed successfully;false
otherwise
-
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:
true
if this operation was performed successfully;false
otherwise
-
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
-true
if handing of the events does not require UI;false
otherwise- Returns:
true
if this operation was performed successfully;false
otherwise
-
unsubscribe
Unsubscribe handler previously registered usingsubscribe(String, EventHandler)
.- Parameters:
eventHandler
- previously registered event handler- Returns:
true
if this operation was performed successfully;false
otherwise
-