org.apache.felix.example.servicebased.host
Class ShapeTracker
java.lang.Object
org.osgi.util.tracker.ServiceTracker
org.apache.felix.example.servicebased.host.ShapeTracker
- All Implemented Interfaces:
- ServiceTrackerCustomizer
public class ShapeTracker
- extends ServiceTracker
Extends the ServiceTracker to create a tracker for
SimpleShape services. The tracker is responsible for
listener for the arrival/departure of SimpleShape
services and informing the application about the availability
of shapes. This tracker forces all notifications to be processed
on the Swing event thread to avoid synchronization and redraw
issues.
Constructor Summary |
ShapeTracker(BundleContext context,
DrawingFrame frame)
Constructs a tracker that uses the specified bundle context to
track services and notifies the specified application object about
changes. |
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 |
ShapeTracker
public ShapeTracker(BundleContext context,
DrawingFrame frame)
- Constructs a tracker that uses the specified bundle context to
track services and notifies the specified application object about
changes.
- Parameters:
context
- The bundle context to be used by the tracker.frame
- The application object to notify about service changes.
addingService
public Object addingService(ServiceReference ref)
- Overrides the ServiceTracker functionality to inform
the application object about the added service.
- Specified by:
addingService
in interface ServiceTrackerCustomizer
- Overrides:
addingService
in class ServiceTracker
- Parameters:
ref
- The service reference of the added service.
- Returns:
- The service object to be used by the tracker.
modifiedService
public void modifiedService(ServiceReference ref,
Object svc)
- Overrides the ServiceTracker functionality to inform
the application object about the modified service.
- Specified by:
modifiedService
in interface ServiceTrackerCustomizer
- Overrides:
modifiedService
in class ServiceTracker
- Parameters:
ref
- The service reference of the modified service.svc
- The service object of the modified service.
removedService
public void removedService(ServiceReference ref,
Object svc)
- Overrides the ServiceTracker functionality to inform
the application object about the removed service.
- Specified by:
removedService
in interface ServiceTrackerCustomizer
- Overrides:
removedService
in class ServiceTracker
- Parameters:
ref
- The service reference of the removed service.svc
- The service object of the removed service.
Copyright © 2006-2011 Apache Software Foundation. All Rights Reserved.