Introduced getBeanNamesForAnnotation method on ListableBeanFactory

Issue: SPR-11069
This commit is contained in:
Juergen Hoeller
2013-11-15 16:04:11 +01:00
parent b43901ed86
commit 54571bf038
6 changed files with 78 additions and 9 deletions

View File

@@ -1071,6 +1071,12 @@ public abstract class AbstractApplicationContext extends DefaultResourceLoader
return getBeanFactory().getBeansOfType(type, includeNonSingletons, allowEagerInit);
}
@Override
public String[] getBeanNamesForAnnotation(Class<? extends Annotation> annotationType) {
assertBeanFactoryActive();
return getBeanFactory().getBeanNamesForAnnotation(annotationType);
}
@Override
public Map<String, Object> getBeansWithAnnotation(Class<? extends Annotation> annotationType)
throws BeansException {
@@ -1080,7 +1086,9 @@ public abstract class AbstractApplicationContext extends DefaultResourceLoader
}
@Override
public <A extends Annotation> A findAnnotationOnBean(String beanName, Class<A> annotationType) {
public <A extends Annotation> A findAnnotationOnBean(String beanName, Class<A> annotationType)
throws NoSuchBeanDefinitionException{
assertBeanFactoryActive();
return getBeanFactory().findAnnotationOnBean(beanName, annotationType);
}