public class LocatedDeviceTracker extends Object implements LocatedDeviceTrackerCustomizer
| Modifier and Type | Field and Description |
|---|---|
protected org.apache.felix.ipojo.util.Tracker |
contextMgrTracker
Tracker of technical service used to listen device events.
|
protected static org.slf4j.Logger |
logger |
protected org.osgi.framework.BundleContext |
m_context
The bundle context against which this LocatedDeviceTracker object is tracking.
|
protected LocatedDeviceTrackerCustomizer |
m_customizer
The LocatedDeviceTrackerCustomizer object for this tracker.
|
protected LocatedDeviceFilter |
m_propFilter
the filter specifying prop matching criteria for the devices to track.
|
protected LocatedDeviceFilter |
m_typeFilter
the filter specifying type criteria for the devices to track.
|
| Constructor and Description |
|---|
LocatedDeviceTracker(org.osgi.framework.BundleContext context,
Class<? extends GenericDevice> clazz,
LocatedDeviceTrackerCustomizer customizer,
String... mandatoryProperties)
Creates a LocatedDeviceTracker object on the specified class name.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addedDevice(LocatedDevice device)
Default implementation of the LocatedDeviceTrackerCustomizer.addedDevice method.
|
boolean |
addingDevice(LocatedDevice device)
Default implementation of the LocatedDeviceTrackerCustomizer.addingDevice method.
|
void |
close()
Closes this LocatedDeviceTracker object.
|
List<LocatedDevice> |
getDevices()
Gets the list of stored devices.
|
void |
modifiedDevice(LocatedDevice device,
String propertyName,
Object oldValue,
Object newValue)
Default implementation of the LocatedDeviceTrackerCustomizer.modifiedDevice method.
|
void |
movedDevice(LocatedDevice device,
Position oldPosition,
Position newPosition) |
void |
open()
Opens this LocatedDeviceTracker object and begin tracking services.
|
void |
removedDevice(LocatedDevice device)
Default implementation of the LocatedDeviceTrackerCustomizer.removedDevice method.
|
int |
size()
Returns the number of devices being tracked by this LocatedDeviceTracker object.
|
protected static org.slf4j.Logger logger
protected org.osgi.framework.BundleContext m_context
protected org.apache.felix.ipojo.util.Tracker contextMgrTracker
protected LocatedDeviceFilter m_typeFilter
protected LocatedDeviceFilter m_propFilter
protected LocatedDeviceTrackerCustomizer m_customizer
public LocatedDeviceTracker(org.osgi.framework.BundleContext context,
Class<? extends GenericDevice> clazz,
LocatedDeviceTrackerCustomizer customizer,
String... mandatoryProperties)
context - the BundleContext object against which the tracking is done.clazz - the Class name of the services to be tracked.customizer - the customizer object to call when services are added, modified, or removed in this LocatedDeviceTracker object. If customizer is null, then this LocatedDeviceTracker object will be used as
the TrackerCustomizer object and the LocatedDeviceTracker object will call the TrackerCustomizer methods on itself.public void open()
Services which match the search criteria specified when this LocatedDeviceTracker object was created are now tracked by this LocatedDeviceTracker object.
public void close()
This method should be called when this LocatedDeviceTracker object should end the tracking of services.
public boolean addingDevice(LocatedDevice device)
addingDevice in interface LocatedDeviceTrackerCustomizerdevice - the device being added to the Tracker object.public void addedDevice(LocatedDevice device)
addedDevice in interface LocatedDeviceTrackerCustomizerdevice - the added devicepublic void modifiedDevice(LocatedDevice device, String propertyName, Object oldValue, Object newValue)
modifiedDevice in interface LocatedDeviceTrackerCustomizerdevice - the changed devicepropertyName - name of the property that has changedoldValue - previous value of the propertynewValue - new value of the propertypublic void movedDevice(LocatedDevice device, Position oldPosition, Position newPosition)
movedDevice in interface LocatedDeviceTrackerCustomizerpublic void removedDevice(LocatedDevice device)
removedDevice in interface LocatedDeviceTrackerCustomizerdevice - the removed device.public List<LocatedDevice> getDevices()
public int size()
Copyright © 2012-2013 ADELE Research Group. All Rights Reserved.