synchronized List<BundleCapability> findProvidersInternal(
ResolverHookRecord record, BundleRequirement req, boolean obeyMandatory)
{
List<BundleCapability> result = new ArrayList<BundleCapability>();
CapabilitySet capSet = m_capSets.get(req.getNamespace());
if (capSet != null)
{
// Get the requirement's filter; if this is our own impl we
// have a shortcut to get the already parsed filter, otherwise
// we must parse it from the directive.
SimpleFilter sf;
if (req instanceof BundleRequirementImpl)
{
sf = ((BundleRequirementImpl) req).getFilter();
}
else
{
String filter = req.getDirectives().get(Constants.FILTER_DIRECTIVE);
if (filter == null)
{
sf = new SimpleFilter(null, null, SimpleFilter.MATCH_ALL);
}
else
{
sf = SimpleFilter.parse(filter);
}
}
// Find the matching candidates.
Set<BundleCapability> matches = capSet.match(sf, obeyMandatory);
// Filter matching candidates.
for (BundleCapability cap : matches)
{
// Filter according to security.
if (filteredBySecurity(req, cap))