Search in sources :

Example 1 with TestCapability

use of org.apache.aries.subsystem.core.internal.TestCapability in project aries by apache.

the class SubTestRepository method findProviders.

@Override
public Map<Requirement, Collection<Capability>> findProviders(Collection<? extends Requirement> requirements) {
    Map<Requirement, Collection<Capability>> res = new HashMap<Requirement, Collection<Capability>>();
    for (Requirement req : requirements) {
        if (req.getNamespace().equals("ns1") && req.getDirectives().equals(Collections.singletonMap("filter", "(x=y)"))) {
            TestCapability cap = new TestCapability("ns1", Collections.<String, Object>singletonMap("x", "y"));
            Collection<Capability> caps = Collections.<Capability>singleton(cap);
            res.put(req, caps);
        }
    }
    return res;
}
Also used : Requirement(org.osgi.resource.Requirement) Capability(org.osgi.resource.Capability) TestCapability(org.apache.aries.subsystem.core.internal.TestCapability) HashMap(java.util.HashMap) TestCapability(org.apache.aries.subsystem.core.internal.TestCapability) Collection(java.util.Collection)

Aggregations

Collection (java.util.Collection)1 HashMap (java.util.HashMap)1 TestCapability (org.apache.aries.subsystem.core.internal.TestCapability)1 Capability (org.osgi.resource.Capability)1 Requirement (org.osgi.resource.Requirement)1