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

java.lang.Object
  extended by org.apache.felix.eventadmin.impl.adapter.AbstractAdapter
      extended by org.apache.felix.eventadmin.impl.adapter.BundleEventAdapter
All Implemented Interfaces:
EventListener, org.osgi.framework.BundleListener

public class BundleEventAdapter
extends AbstractAdapter
implements org.osgi.framework.BundleListener

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

Author:
Felix Project Team

Constructor Summary
BundleEventAdapter(org.osgi.framework.BundleContext context, org.osgi.service.event.EventAdmin admin)
          The constructor of the adapter.
 
Method Summary
 void bundleChanged(org.osgi.framework.BundleEvent event)
          Once a bundle event is received this method assembles and posts an event via the EventAdmin as specified in 113.6.4 OSGi R4 compendium.
 void destroy(org.osgi.framework.BundleContext context)
           
 
Methods inherited from class org.apache.felix.eventadmin.impl.adapter.AbstractAdapter
getEventAdmin
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BundleEventAdapter

public BundleEventAdapter(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 BundleListener 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

destroy

public void destroy(org.osgi.framework.BundleContext context)
Specified by:
destroy in class AbstractAdapter

bundleChanged

public void bundleChanged(org.osgi.framework.BundleEvent event)
Once a bundle event is received this method assembles and posts an event via the EventAdmin as specified in 113.6.4 OSGi R4 compendium.

Specified by:
bundleChanged in interface org.osgi.framework.BundleListener
Parameters:
event - The event to adapt.


Copyright © 2006-2011 Apache Software Foundation. All Rights Reserved.