Class GenericParametersAutowireCandidateResolver
- java.lang.Object
-
- jetbrains.buildServer.spring.candidates.GenericParametersAutowireCandidateResolver
-
- All Implemented Interfaces:
TeamCityAutowireCandidateResolver
public class GenericParametersAutowireCandidateResolver extends java.lang.Object implements TeamCityAutowireCandidateResolver
Created 02.10.12 18:23 This component resolves all dependency to a generic bean definition. Unfortunately Spring does not use generic type information for dependency resolution (so working with type-erasure) Due to Java limitations one need to explicitly inherit from a generic component to make true type substitution that would be visible for Java reflection. To make this component work you need to annotate your bean implementation withGenericResolvable
annotation to specify raw type and arguments of generic interface you'd like to autowire. Note, this resolver is only one spring context wide. Proper dependency resolution may not work if there are beans candidates both from parent and child(ren) contexts There is a related issue in spring framework: https://jira.springsource.org/browse/SPR-9965- Since:
- 8.0
- Author:
- Eugene Petrenko (eugene.petrenko@jetbrains.com)
- See Also:
GenericResolvable
-
-
Constructor Summary
Constructors Constructor Description GenericParametersAutowireCandidateResolver()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
isAutowireCandidate(java.lang.Class<?> dependencyType, java.lang.Class<?> beanType, java.lang.reflect.Type genericDependencyType)
Determine whether the given bean qualifies as an autowire candidate for the given dependency.
-
-
-
Method Detail
-
isAutowireCandidate
public boolean isAutowireCandidate(@NotNull java.lang.Class<?> dependencyType, @NotNull java.lang.Class<?> beanType, @Nullable java.lang.reflect.Type genericDependencyType)
Description copied from interface:TeamCityAutowireCandidateResolver
Determine whether the given bean qualifies as an autowire candidate for the given dependency.- Specified by:
isAutowireCandidate
in interfaceTeamCityAutowireCandidateResolver
- Parameters:
dependencyType
- type of the dependencybeanType
- type of the beangenericDependencyType
- generic type of the dependency- Returns:
- whether the bean qualifies as autowire candidate
-
-