nextReq: for (Requirement req : requirements) {
String f = req.getDirectives().get("filter");
if (f == null)
continue nextReq;
Filter filter = new Filter(f);
for (PersistentResource presource : persistent.values()) {
Resource resource = presource.getResource();
List<Capability> provided = resource.getCapabilities(req.getNamespace());
if (provided != null)
for (Capability cap : provided) {
if (filter.matchMap(cap.getAttributes())) {
List<Capability> l = result.get(req);
if (l == null)
result.put(req, l = new ArrayList<Capability>());
l.add(cap);
}