public final class EventDispatcher
extends java.lang.Object
implements org.osgi.framework.ServiceListener
ServiceListener
Modifier and Type | Method and Description |
---|---|
void |
addListener(java.lang.String itf,
org.osgi.framework.ServiceListener listener)
Adds a new service listener to the
m_listeners
map. |
static void |
create(org.osgi.framework.BundleContext bc)
Creates the internal event
dispatcher.
|
static void |
dispose()
Stops and delete the internal event dispatcher.
|
static EventDispatcher |
getDispatcher()
Gets the iPOJO event dispatcher.
|
boolean |
removeListener(org.osgi.framework.ServiceListener listener)
Removes a service listener.
|
void |
serviceChanged(org.osgi.framework.ServiceEvent event)
Method called when a
ServiceEvent is
fired by the OSGi framework. |
public static void create(org.osgi.framework.BundleContext bc)
bc
- the iPOJO bundle context to send to the
internal event dispatcher.public static void dispose()
public static EventDispatcher getDispatcher()
null
if not created.public void serviceChanged(org.osgi.framework.ServiceEvent event)
ServiceEvent
is
fired by the OSGi framework.
According to the event, this method dispatches
to interested registered listers from
the m_listeners
map.serviceChanged
in interface org.osgi.framework.ServiceListener
event
- the service eventServiceListener.serviceChanged(org.osgi.framework.ServiceEvent)
public void addListener(java.lang.String itf, org.osgi.framework.ServiceListener listener)
m_listeners
map. This method specifies the listen service interfaceitf
- the service interfacelistener
- the service listenerpublic boolean removeListener(org.osgi.framework.ServiceListener listener)
listener
- the service listener to removetrue
if the listener is
successfully removed.Copyright © 2006-2014 The Apache Software Foundation. All Rights Reserved.