try {
Resource[] resources = this.applicationContext.getResources(packagePattern);
for (Resource resource : resources) {
Class<?> clazz = loadClass(configurableListableBeanFactory.getBeanClassLoader(), packagePattern, resource);
if (log.isDebugEnabled()) log.debug("Scanned " + clazz.getName());
Bean bean = clazz.getAnnotation(Bean.class);
if (bean != null) {
if (log.isInfoEnabled()) log.info("Detected @Bean annotation in " + resource.getFilename());
createAndRegisterBean(registry, clazz, bean);
}
}