public interface IEventBroker
IEclipseContext context, use
(IEventBroker) context.get(IEventBroker.class.getName())
| Modifier and Type | Field and Description |
|---|---|
static String |
DATA
The name of the default event attribute used to pass data.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
post(String topic,
Object data)
Publish event asynchronously (this method returns immediately).
|
boolean |
send(String topic,
Object data)
Publish event synchronously (the method does not return until the event is processed).
|
boolean |
subscribe(String topic,
EventHandler eventHandler)
Subscribe for events on the given topic.
|
boolean |
subscribe(String topic,
String filter,
EventHandler eventHandler,
boolean headless)
Subscribe for events on the given topic.
|
boolean |
unsubscribe(EventHandler eventHandler)
Unsubscribe handler previously registered using
subscribe(String, EventHandler). |
static final String DATA
boolean send(String topic, Object data)
If data is a Map or a Dictionary, it is passed as is. Otherwise, a new Map is
constructed and its DATA attribute is populated with this value.
topic - topic of the event to be publisheddata - data to be published with the eventtrue if this operation was performed successfully; false
otherwiseboolean post(String topic, Object data)
If data is a Map or a Dictionary, it is passed as is. Otherwise, a new Map is
constructed and its DATA attribute is populated with this value.
topic - topic of the event to be publisheddata - data to be published with the eventtrue if this operation was performed successfully; false
otherwiseboolean subscribe(String topic, EventHandler eventHandler)
The handler will be called on the UI thread.
topic - topic of interesteventHandler - object to call when an event of interest arrivestrue if this operation was performed successfully; false
otherwiseboolean subscribe(String topic, String filter, EventHandler eventHandler, boolean headless)
The handler will be called on the UI thread if "headless" is set to true.
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
otherwisetrue if this operation was performed successfully; false
otherwiseboolean unsubscribe(EventHandler eventHandler)
subscribe(String, EventHandler).eventHandler - previously registered event handlertrue if this operation was performed successfully; false
otherwise
Copyright (c) 2000, 2014 Eclipse Contributors and others. All rights reserved.Guidelines for using Eclipse APIs.