ServiceReference caveRepositoryServiceReference = bundleContext.getServiceReference(CaveRepositoryService.class.getName());
if (caveRepositoryServiceReference != null) {
CaveRepositoryService caveRepositoryService = (CaveRepositoryService) bundleContext.getService(caveRepositoryServiceReference);
if (caveRepositoryService != null) {
CaveRepository caveRepository = caveRepositoryService.getRepository(caveRepositoryName);
if (caveRepository != null) {
url = caveRepository.getRepositoryXml();
response.setContentType("text/xml");
}
}
bundleContext.ungetService(caveRepositoryServiceReference);
}