public class EventBroker extends Object implements IEventBroker
DATA
Constructor and Description |
---|
EventBroker() |
Modifier and Type | Method and Description |
---|---|
protected void |
activate(org.osgi.service.component.ComponentContext context) |
protected void |
bindEventAdmin(org.osgi.service.event.EventAdmin eventAdmin) |
protected void |
deactivate(org.osgi.service.component.ComponentContext context) |
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.
|
protected void |
unbindEventAdmin(org.osgi.service.event.EventAdmin eventAdmin) |
boolean |
unsubscribe(org.osgi.service.event.EventHandler eventHandler)
Unsubscribe handler previously registered using
IEventBroker.subscribe(String, EventHandler) . |
public EventBroker()
protected void activate(org.osgi.service.component.ComponentContext context)
protected void deactivate(org.osgi.service.component.ComponentContext context)
protected void bindEventAdmin(org.osgi.service.event.EventAdmin eventAdmin)
protected void unbindEventAdmin(org.osgi.service.event.EventAdmin eventAdmin)
public boolean send(String topic, Object data)
IEventBroker
If data is a Map
or a Dictionary
, it is passed as is. Otherwise, a new Map is
constructed and its IEventBroker.DATA
attribute is populated with this value.
send
in interface IEventBroker
topic
- topic of the event to be publisheddata
- data to be published with the eventtrue
if this operation was performed successfully; false
otherwisepublic boolean post(String topic, Object data)
IEventBroker
If data is a Map
or a Dictionary
, it is passed as is. Otherwise, a new Map is
constructed and its IEventBroker.DATA
attribute is populated with this value.
post
in interface IEventBroker
topic
- topic of the event to be publisheddata
- data to be published with the eventtrue
if this operation was performed successfully; false
otherwisepublic boolean subscribe(String topic, org.osgi.service.event.EventHandler eventHandler)
IEventBroker
The handler will be called on the UI thread.
subscribe
in interface IEventBroker
topic
- topic of interesteventHandler
- object to call when an event of interest arrivestrue
if this operation was performed successfully; false
otherwisepublic boolean subscribe(String topic, String filter, org.osgi.service.event.EventHandler eventHandler, boolean headless)
IEventBroker
The handler will be called on the UI thread if "headless" is set to true
.
subscribe
in interface IEventBroker
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
otherwisepublic boolean unsubscribe(org.osgi.service.event.EventHandler eventHandler)
IEventBroker
IEventBroker.subscribe(String, EventHandler)
.unsubscribe
in interface IEventBroker
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