{
// load the available SPI implementations
Iterator<BeanNameResolver> iterator = ServiceLoader.load(BeanNameResolver.class).iterator();
while (iterator.hasNext()) {
BeanNameResolver resolver = iterator.next();
// check if this implementation is able to tell the name
String beanName = resolver.getBeanName(clazz);
if (log.isTraceEnabled()) {
log.trace("Service provider [{}] returned [{}] for class [{}]", new Object[] {
resolver.getClass().getSimpleName(), beanName, clazz.getName()
});
}
// the first result is accepted
if (beanName != null) {