Map serviceNameIndex = new HashMap(beanNames.length);
for (int i = 0; i < beanNames.length; i++) {
String beanName = beanNames[i];
BeanDefinition def = registry.getBeanDefinition(beanName);
if (!def.isAbstract()) {
ServiceName serviceName = new StringServiceName(beanName);
serviceNameIndex.put(beanName, serviceName);
}
}
return serviceNameIndex;
} else {
String[] beanNames = applicationContext.getBeanDefinitionNames();
Map serviceNameIndex = new HashMap(beanNames.length);
for (int i = 0; i < beanNames.length; i++) {
String beanName = beanNames[i];
ServiceName serviceName = new StringServiceName(beanName);
serviceNameIndex.put(beanName, serviceName);
}
return serviceNameIndex;
}
}