Top Description Fields Methods
org.osgi.service.device

public Interface DriverSelector

Imports
org.osgi.framework.ServiceReference

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 an Exception, the device manager uses the default selection strategy.
Author
$Id: d054053b5c5b76fb0baf4195949092f04695255e $
Since
1.1

Field Summary

Modifier and TypeField and Description
public static final int
SELECT_NONE

Return value from DriverSelector.select, if no Driver service should be attached to the Device service.

Method Summary

Modifier and TypeMethod and Description
public int

Returns:

index into the array of Match objects, or SELECT_NONE if no Driver service should be attached
select
(ServiceReference<?>
the ServiceReference object of the Device service.
reference
,
Match[]
the array of all non-zero matches.
matches
)

Select one of the matching Driver services.

Field Detail

SELECT_NONEback to summary
public static final int SELECT_NONE

Return value from DriverSelector.select, if no Driver service should be attached to the Device service. The value is -1.

Method Detail

selectback to summary
public int select(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 (not Device#MATCH_NONE) match values will be included in the list.

Parameters
reference:ServiceReference<?>

the ServiceReference object of the Device service.

matches:Match[]

the array of all non-zero matches.

Returns:int

index into the array of Match objects, or SELECT_NONE if no Driver service should be attached