org.apache.felix.http.base.internal.listener
Class AbstractListenerManager<ListenerType>

java.lang.Object
  extended by org.osgi.util.tracker.ServiceTracker
      extended by org.apache.felix.http.base.internal.listener.AbstractListenerManager<ListenerType>
All Implemented Interfaces:
ServiceTrackerCustomizer
Direct Known Subclasses:
HttpSessionAttributeListenerManager, HttpSessionListenerManager, ServletContextAttributeListenerManager, ServletRequestAttributeListenerManager, ServletRequestListenerManager

public class AbstractListenerManager<ListenerType>
extends ServiceTracker


Field Summary
 
Fields inherited from class org.osgi.util.tracker.ServiceTracker
context, filter
 
Constructor Summary
protected AbstractListenerManager(BundleContext context,  clazz)
           
 
Method Summary
 Object addingService(ServiceReference reference)
          Default implementation of the ServiceTrackerCustomizer.addingService method.
protected   getContextListeners()
           
 void modifiedService(ServiceReference reference, Object service)
          Default implementation of the ServiceTrackerCustomizer.modifiedService method.
 void removedService(ServiceReference reference, Object service)
          Default implementation of the ServiceTrackerCustomizer.removedService method.
 
Methods inherited from class org.osgi.util.tracker.ServiceTracker
close, getService, getService, getServiceReference, getServiceReferences, getServices, getTrackingCount, open, open, remove, size, waitForService
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractListenerManager

protected AbstractListenerManager(BundleContext context,
                                   clazz)
Method Detail

getContextListeners

protected final  getContextListeners()

addingService

public Object addingService(ServiceReference reference)
Description copied from class: ServiceTracker
Default implementation of the ServiceTrackerCustomizer.addingService method.

This method is only called when this ServiceTracker has been constructed with a null ServiceTrackerCustomizer argument.

This implementation returns the result of calling getService on the BundleContext with which this ServiceTracker was created passing the specified ServiceReference.

This method can be overridden in a subclass to customize the service object to be tracked for the service being added. In that case, take care not to rely on the default implementation of removedService to unget the service.

Specified by:
addingService in interface ServiceTrackerCustomizer
Overrides:
addingService in class ServiceTracker
Parameters:
reference - The reference to the service being added to this ServiceTracker.
Returns:
The service object to be tracked for the service added to this ServiceTracker.
See Also:
ServiceTrackerCustomizer.addingService(ServiceReference)

modifiedService

public void modifiedService(ServiceReference reference,
                            Object service)
Description copied from class: ServiceTracker
Default implementation of the ServiceTrackerCustomizer.modifiedService method.

This method is only called when this ServiceTracker has been constructed with a null ServiceTrackerCustomizer argument.

This implementation does nothing.

Specified by:
modifiedService in interface ServiceTrackerCustomizer
Overrides:
modifiedService in class ServiceTracker
Parameters:
reference - The reference to modified service.
service - The service object for the modified service.
See Also:
ServiceTrackerCustomizer.modifiedService(ServiceReference, Object)

removedService

public void removedService(ServiceReference reference,
                           Object service)
Description copied from class: ServiceTracker
Default implementation of the ServiceTrackerCustomizer.removedService method.

This method is only called when this ServiceTracker has been constructed with a null ServiceTrackerCustomizer argument.

This implementation calls ungetService, on the BundleContext with which this ServiceTracker was created, passing the specified ServiceReference.

This method can be overridden in a subclass. If the default implementation of addingService method was used, this method must unget the service.

Specified by:
removedService in interface ServiceTrackerCustomizer
Overrides:
removedService in class ServiceTracker
Parameters:
reference - The reference to removed service.
service - The service object for the removed service.
See Also:
ServiceTrackerCustomizer.removedService(ServiceReference, Object)


Copyright © 2013 The Apache Software Foundation. All Rights Reserved.