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.| Modifier and Type | Class and Description |
|---|---|
static interface |
EventAdminImpl.EventHandlerMBean |
| Constructor and Description |
|---|
EventAdminImpl(org.osgi.framework.BundleContext bundleContext,
DefaultThreadPool syncPool,
DefaultThreadPool asyncPool,
int timeout,
String[] ignoreTimeout,
boolean requireTopic,
String[] ignoreTopics)
The constructor of the
EventAdmin implementation. |
| Modifier and Type | Method and Description |
|---|---|
Object |
getHandlerInfoMBean() |
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)
Update the event admin with new configuration.
|
public EventAdminImpl(org.osgi.framework.BundleContext bundleContext,
DefaultThreadPool syncPool,
DefaultThreadPool asyncPool,
int timeout,
String[] ignoreTimeout,
boolean requireTopic,
String[] ignoreTopics)
EventAdmin implementation.bundleContext - The event admin bundle contextsyncPool - The synchronous thread poolasyncPool - The asynchronous thread pooltimeout - The timeoutignoreTimeout - The configuration for ignoring timeoutsrequireTopic - Are topics required?ignoreTopics - The configuration to ignore topicspublic void postEvent(org.osgi.service.event.Event event)
postEvent in interface org.osgi.service.event.EventAdminevent - The event to be posted by this serviceIllegalStateException - - In case we are stoppedEventAdmin.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 serviceIllegalStateException - - In case we are stoppedEventAdmin.sendEvent(org.osgi.service.event.Event)public void stop()
public void update(int timeout,
String[] ignoreTimeout,
boolean requireTopic,
String[] ignoreTopics)
timeout - The timeoutignoreTimeout - The configuration for ignoring timeoutsrequireTopic - Are topics required?ignoreTopics - The configuration to ignore topicspublic Object getHandlerInfoMBean()
Copyright © 2006–2021 The Apache Software Foundation. All rights reserved.