* @param fact : the factory to test.
* @return true if the factory match, false otherwise.
*/
public boolean match(ServiceReference fact) {
// Check if the factory can provide the specification
ComponentTypeDescription desc = (ComponentTypeDescription) fact.getProperty("component.description");
if (desc == null) {
return false; // No component type description.
}
String[] provides = desc.getprovidedServiceSpecification();
for (int i = 0; provides != null && i < provides.length; i++) {
if (provides[i].equals(m_specification)) {
// Check that the factory needs every properties contained in
// the configuration
PropertyDescription[] props = desc.getProperties();
Properties conf = new Properties();
Enumeration keys = m_configuration.keys();
while (keys.hasMoreElements()) {
String key = (String) keys.nextElement();
if (!containsProperty(key, props)) { return false; }