public interface IEventBroker
(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,
org.osgi.service.event.EventHandler eventHandler)
Subscribe for events on the given topic.
|
boolean |
subscribe(String topic,
String filter,
org.osgi.service.event.EventHandler eventHandler,
boolean headless)
Subscribe for events on the given topic.
|
boolean |
unsubscribe(org.osgi.service.event.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, org.osgi.service.event.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, org.osgi.service.event.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(org.osgi.service.event.EventHandler eventHandler)
subscribe(String, EventHandler)
.eventHandler
- previously registered event handlertrue
if this operation was performed successfully; false
otherwiseCopyright © 2013-2016 Loetz GmbH&Co.KG - Heidelberg - Germany, Eclipse OSBP Project, OS.bee