public synchronized List getServiceReferences(String className, SimpleFilter filter)
{
if ((className == null) && (filter == null))
{
// Return all services.
filter = new SimpleFilter(Constants.OBJECTCLASS, "*", SimpleFilter.PRESENT);
}
else if ((className != null) && (filter == null))
{
// Return services matching the class name.
filter = new SimpleFilter(Constants.OBJECTCLASS, className, SimpleFilter.EQ);
}
else if ((className != null) && (filter != null))
{
// Return services matching the class name and filter.
List<SimpleFilter> filters = new ArrayList<SimpleFilter>(2);
filters.add(new SimpleFilter(Constants.OBJECTCLASS, className, SimpleFilter.EQ));
filters.add(filter);
filter = new SimpleFilter(null, filters, SimpleFilter.AND);
}
// else just use the specified filter.
Set<BundleCapability> matches = m_regCapSet.match(filter, false);