Knopflerfish OSGi 1.3.3

org.osgi.util.tracker
Interface ServiceTrackerCustomizer

All Known Implementing Classes:
ServiceTracker

public interface ServiceTrackerCustomizer

Interface allowing users of ServiceTracker to modify the behavior and selection of tracked services.

Note: ServiceTracker itself implements ServiceTrackerCustomizer, and in many cases it might be easier to override the one of the xxxxxService methods directly in ServiceTracker

Note II: If you really need to monitor the lifecycle of one ore more services (not just use it) it's higly recommended to use the ServiceListener interface directly.


Method Summary
 java.lang.Object addingService(ServiceReference reference)
          A service is being added to the ServiceTracker object.
 void modifiedService(ServiceReference reference, java.lang.Object service)
          A service tracked by the ServiceTracker object has been modified.
 void removedService(ServiceReference reference, java.lang.Object service)
          A service tracked by the ServiceTracker object has been removed.
 

Method Detail

addingService

public java.lang.Object addingService(ServiceReference reference)
A service is being added to the ServiceTracker object.

This method is called before a service which matched the search parameters of the ServiceTracker object is added to it. This method should return the service object to be tracked for this ServiceReference object, typically by calling context.getServiceReference(reference)

Parameters:
reference - Reference to service being added
Returns:
The service object to be tracked for the ServiceReference or null if the ServiceReference should not be tracked.

modifiedService

public void modifiedService(ServiceReference reference,
                            java.lang.Object service)
A service tracked by the ServiceTracker object has been modified.

This method is called when a service being tracked by the ServiceTracker object has had it properties modified.

Parameters:
reference - Service that has been modified.
service - The service for the modified service.

removedService

public void removedService(ServiceReference reference,
                           java.lang.Object service)
A service tracked by the ServiceTracker object has been removed.

This method is called after a service is no longer being tracked by the ServiceTracker object. The action should be the inverse of the action in addingService, typically by calling context.ungetService(reference)

Parameters:
reference - Service that has been removed.
service - service that has been removed.

Knopflerfish OSGi 1.3.3