Package org.osgi.service.device
Interface DriverSelector
-
public interface DriverSelector
When the device manager detects a new Device service, it calls all registered Driver services to determine if anyone matches the Device service. If at least one Driver service matches, the device manager must choose one. If there is a Driver Selector service registered with the Framework, the device manager will ask it to make the selection. If there is no Driver Selector service, or if it returns an invalid result, or throws anException
, the device manager uses the default selection strategy.- Since:
- 1.1
-
-
Field Summary
Fields Modifier and Type Field Description static int
SELECT_NONE
Return value fromDriverSelector.select
, if no Driver service should be attached to the Device service.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description int
select(org.osgi.framework.ServiceReference<?> reference, Match[] matches)
Select one of the matching Driver services.
-
-
-
Field Detail
-
SELECT_NONE
static final int SELECT_NONE
Return value fromDriverSelector.select
, if no Driver service should be attached to the Device service. The value is -1.- See Also:
- Constant Field Values
-
-
Method Detail
-
select
int select(org.osgi.framework.ServiceReference<?> reference, Match[] matches)
Select one of the matching Driver services. The device manager calls this method if there is at least one driver bidding for a device. Only Driver services that have responded with nonzero (notDevice.MATCH_NONE
) match values will be included in the list.- Parameters:
reference
- theServiceReference
object of the Device service.matches
- the array of all non-zero matches.- Returns:
- index into the array of
Match
objects, orSELECT_NONE
if no Driver service should be attached
-
-