public class EventAdminImpl extends Object implements org.osgi.service.event.EventAdmin
HandlerTasks
in order to determine applicable EventHandler for a specific event and
subsequently dispatches the event to the handlers via DeliverTasks.
To do this, it uses two different DeliverTasks one for asynchronous and
one for synchronous event delivery depending on whether its post() or
its send() method is called. Note that the actual work is done in the
implementations of the DeliverTasks. Additionally, a stop method is
provided that prevents subsequent events to be delivered.| Constructor and Description |
|---|
EventAdminImpl(org.osgi.framework.BundleContext bundleContext,
org.apache.felix.eventadmin.impl.tasks.DefaultThreadPool syncPool,
org.apache.felix.eventadmin.impl.tasks.DefaultThreadPool asyncPool,
int timeout,
String[] ignoreTimeout,
boolean requireTopic,
String[] ignoreTopics,
boolean addTimestamp,
boolean addSubject)
The constructor of the
EventAdmin implementation. |
| Modifier and Type | Method and Description |
|---|---|
void |
postEvent(org.osgi.service.event.Event event)
Post an asynchronous event.
|
void |
sendEvent(org.osgi.service.event.Event event)
Send a synchronous event.
|
void |
stop()
This method can be used to stop the delivery of events.
|
void |
update(int timeout,
String[] ignoreTimeout,
boolean requireTopic,
String[] ignoreTopics,
boolean addTimestamp,
boolean addSubject)
Update the event admin with new configuration.
|
public EventAdminImpl(org.osgi.framework.BundleContext bundleContext,
org.apache.felix.eventadmin.impl.tasks.DefaultThreadPool syncPool,
org.apache.felix.eventadmin.impl.tasks.DefaultThreadPool asyncPool,
int timeout,
String[] ignoreTimeout,
boolean requireTopic,
String[] ignoreTopics,
boolean addTimestamp,
boolean addSubject)
EventAdmin implementation.bundleContext - The bundle context to use.syncPool - The synchronous thread pool.asyncPool - The asynchronous thread pool.timeout - The thread execution timeout.ignoreTimeout - The thread ignore timeout.requireTopic - True to define the topic as required, false else.ignoreTopics - The array of topics to ignore.addTimestamp - True to add timestamp to the event, false else.addSubject - True to add subject to the event, false else.public void postEvent(org.osgi.service.event.Event event)
postEvent in interface org.osgi.service.event.EventAdminevent - The event to be posted by this service.IllegalStateException - In case we are stopped.EventAdmin.postEvent(org.osgi.service.event.Event)public void sendEvent(org.osgi.service.event.Event event)
sendEvent in interface org.osgi.service.event.EventAdminevent - The event to be send by this service.IllegalStateException - In case we are stopped.EventAdmin.sendEvent(org.osgi.service.event.Event)public void stop()
public void update(int timeout,
String[] ignoreTimeout,
boolean requireTopic,
String[] ignoreTopics,
boolean addTimestamp,
boolean addSubject)
timeout - The event timeout.ignoreTimeout - The event ignore timeout.requireTopic - True if the event require a topic, false else.ignoreTopics - The array of topic to ignore.addTimestamp - True to add timestamp to the event, false else.addSubject - True to add subject to the event, false else.Copyright © 2007–2021 The Apache Software Foundation. All rights reserved.