org.apache.felix.eventadmin.impl.adapter
Class ServiceEventAdapter

java.lang.Object
  extended by org.apache.felix.eventadmin.impl.adapter.ServiceEventAdapter
All Implemented Interfaces:
java.util.EventListener, org.osgi.framework.ServiceListener

public class ServiceEventAdapter
extends java.lang.Object
implements org.osgi.framework.ServiceListener

This class registers itself as a listener for service events and posts them via the EventAdmin as specified in 113.6.5 OSGi R4 compendium.

Author:
Felix Project Team

Constructor Summary
ServiceEventAdapter(org.osgi.framework.BundleContext context, org.osgi.service.event.EventAdmin admin)
          The constructor of the adapter.
 
Method Summary
 void serviceChanged(org.osgi.framework.ServiceEvent event)
          Once a Service event is received this method assembles and posts an event via the EventAdmin as specified in 113.6.5 OSGi R4 compendium.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ServiceEventAdapter

public ServiceEventAdapter(org.osgi.framework.BundleContext context,
                           org.osgi.service.event.EventAdmin admin)
The constructor of the adapter. This will register the adapter with the given context as a ServiceListener and subsequently, will post received events via the given EventAdmin.

Parameters:
context - The bundle context with which to register as a listener.
admin - The EventAdmin to use for posting events.
Method Detail

serviceChanged

public void serviceChanged(org.osgi.framework.ServiceEvent event)
Once a Service event is received this method assembles and posts an event via the EventAdmin as specified in 113.6.5 OSGi R4 compendium.

Specified by:
serviceChanged in interface org.osgi.framework.ServiceListener
Parameters:
event - The event to adapt.