Description
Eberhard Wolff opened SPR-6465 and commented
If I annotate a class using @Named
it is instantiated by context:component-scan . However, @Named
is just an example for an @Qualifier
annotated Annotation. The JavaDoc for @Qualifier
states that the specification only covers using such annotations on fields and methods, classes are optional. So even though this behavior does not contradict the specification it is not required either.
But if @Named
means that a class is implemented by context:component-scan the same should work for my own @Qualifier
annotated Annotation as well. That is not the case.
Also a class annotated with @Singleton
is not instantiated by context:component-scan and probably other Annotations that are marked with @Scope
work the same way. I think it would be more logical to have these annotations work with context:component-scan than the @Named
annotation as they clearly belong to implementation classes which @Named
does not. But again this is not covered by the spec.
Affects: 3.0 RC2
1 votes, 3 watchers