use of aQute.bnd.deployer.repository.MapToDictionaryAdapter in project bnd by bndtools.
the class AbstractResolveContext method matches.
private boolean matches(Requirement requirement, Capability selfCap) {
boolean match = false;
if (isCorrectEffectiveness(requirement, selfCap)) {
try {
String filterStr = requirement.getDirectives().get(Namespace.REQUIREMENT_FILTER_DIRECTIVE);
org.osgi.framework.Filter filter = filterStr != null ? org.osgi.framework.FrameworkUtil.createFilter(filterStr) : null;
if (filter == null)
match = true;
else
match = filter.match(new MapToDictionaryAdapter(selfCap.getAttributes()));
} catch (InvalidSyntaxException e) {
log.log(LogService.LOG_ERROR, "Invalid filter directive on requirement: " + requirement, e);
}
}
return match;
}
Aggregations