@Scope annotations not sufficient for scanning anymore

This commit is contained in:
Juergen Hoeller
2009-09-15 12:36:45 +00:00
parent e1a3e44485
commit ad1269622b
3 changed files with 6 additions and 4 deletions

View File

@@ -168,13 +168,10 @@ public class ClassPathScanningCandidateComponentProvider implements ResourceLoad
@SuppressWarnings("unchecked")
protected void registerDefaultFilters() {
this.includeFilters.add(new AnnotationTypeFilter(Component.class));
this.includeFilters.add(new AnnotationTypeFilter(Scope.class));
ClassLoader cl = ClassPathScanningCandidateComponentProvider.class.getClassLoader();
try {
this.includeFilters.add(new AnnotationTypeFilter(
((Class<? extends Annotation>) cl.loadClass("javax.inject.Named"))));
this.includeFilters.add(new AnnotationTypeFilter(
((Class<? extends Annotation>) cl.loadClass("javax.inject.Scope"))));
}
catch (ClassNotFoundException ex) {
// JSR-330 API not available - simply skip.