use of org.apache.aries.application.utils.service.ArrayServiceList in project aries by apache.
the class BundleRepositoryManagerImpl method getAllBundleRepositories.
public Collection<BundleRepository> getAllBundleRepositories() {
LOGGER.debug(LOG_ENTRY, "getAllBundleRepositories");
ServiceCollection<BundleRepository> providers = new ArrayServiceList<BundleRepository>(bc);
try {
ServiceReference[] refs = bc.getServiceReferences(BundleRepository.class.getName(), null);
if (refs != null) {
for (ServiceReference ref : refs) {
providers.addService(ref);
}
}
} catch (InvalidSyntaxException e) {
LOGGER.error(LOG_EXCEPTION, e);
}
LOGGER.debug(LOG_EXIT, "getAllBundleRepositories");
return providers;
}
use of org.apache.aries.application.utils.service.ArrayServiceList in project aries by apache.
the class BundleRepositoryManagerImpl method getBundleRepositoryCollection.
public Collection<BundleRepository> getBundleRepositoryCollection(String appName, String appVersion) {
LOGGER.debug(LOG_ENTRY, "getBundleRepositoryCollection", new Object[] { appName, appVersion });
ServiceCollection<BundleRepository> providers = new ArrayServiceList<BundleRepository>(bc);
String appScope = appName + "_" + appVersion;
String filter = "(|(" + BundleRepository.REPOSITORY_SCOPE + "=" + BundleRepository.GLOBAL_SCOPE + ")(" + BundleRepository.REPOSITORY_SCOPE + "=" + appScope + "))";
try {
ServiceReference[] refs = bc.getServiceReferences(BundleRepository.class.getName(), filter);
if (refs != null) {
for (ServiceReference ref : refs) {
providers.addService(ref);
}
}
} catch (InvalidSyntaxException e) {
LOGGER.error(LOG_EXCEPTION, e);
}
LOGGER.debug(LOG_EXIT, "getBundleRepositoryCollection");
return providers;
}
Aggregations