Add support for @Priority
This commit adds support for @Priority to filter multiple candidates for autowiring. When multiple candidates are available for a given bean, the bean annotated with @Primary is used. If none exists, the one with the higher value for the @Priority annotation is used. If two beans have the same priority a NoUniqueBeanDefinitionException is thrown, just as if two beans are annotated with @Primary. The underlying code for #getBean and #resolveDependency has been merged as this feature is available for both dependency injection and bean lookup by type. Issue: SPR-10548
This commit is contained in:
@@ -280,7 +280,8 @@ project("spring-beans") {
|
||||
optional("javax.inject:javax.inject:1")
|
||||
optional("javax.el:javax.el-api:2.2.4")
|
||||
testCompile("log4j:log4j:1.2.17")
|
||||
}
|
||||
testCompile("org.apache.tomcat.embed:tomcat-embed-core:8.0.0-RC10")
|
||||
}
|
||||
}
|
||||
|
||||
project("spring-beans-groovy") {
|
||||
|
||||
Reference in New Issue
Block a user