List of usage examples for org.springframework.context ApplicationContext getBeanNamesForAnnotation
String[] getBeanNamesForAnnotation(Class<? extends Annotation> annotationType);
From source file:com.capgemini.boot.core.factory.internal.DefaultAnnotationStrategy.java
@Override public String[] getFactoryBeanNames(ApplicationContext context) { return context.getBeanNamesForAnnotation(getFactoryClassAnnotation()); }
From source file:org.fenixedu.bennu.spring.BennuSpringConfiguration.java
private Set<String> getBaseNames(ApplicationContext context) { final Set<String> baseNames = new HashSet<>(); baseNames.add(getBundleBasename("BennuSpringResources")); final String[] beanNames = context.getBeanNamesForAnnotation(BennuSpringModule.class); for (String beanName : beanNames) { BennuSpringModule bennuSpringModuleAnnotation = context.findAnnotationOnBean(beanName, BennuSpringModule.class); if (bennuSpringModuleAnnotation != null) { baseNames.addAll(Arrays.stream(bennuSpringModuleAnnotation.bundles()).map(this::getBundleBasename) .collect(Collectors.toSet())); }//from ww w . j av a2 s . c o m } return baseNames; }