use of ddf.catalog.util.impl.ServiceComparator in project ddf by codice.
the class MigrateCommand method getCatalogProviders.
private List<CatalogProvider> getCatalogProviders() {
ServiceTracker st = new ServiceTracker(bundleContext, CatalogProvider.class.getName(), null);
st.open();
ServiceReference<CatalogProvider>[] serviceRefs = st.getServiceReferences();
Map<ServiceReference<CatalogProvider>, CatalogProvider> map = new TreeMap<>(new ServiceComparator());
if (null != serviceRefs) {
for (ServiceReference<CatalogProvider> serviceReference : serviceRefs) {
map.put(serviceReference, (CatalogProvider) st.getService(serviceReference));
}
}
return new ArrayList<>(map.values());
}
Aggregations