Clarified setAutowireCandidate semantics (plus attribute reordering in BeanDefinition)

Issue: SPR-15072
(cherry picked from commit e8a082f)
This commit is contained in:
Juergen Hoeller
2016-12-30 11:30:18 +01:00
parent b6108e3b2d
commit 8fc65ab0a5
6 changed files with 186 additions and 138 deletions

View File

@@ -2002,6 +2002,14 @@ makes that specific bean definition unavailable to the autowiring infrastructure
(including annotation style configurations such as <<beans-autowired-annotation,
`@Autowired`>>).
[NOTE]
====
The `autowire-candidate` attribute is designed to only affect type-based autowiring.
It does not affect explicit references by name, which will get resolved even if the
specified bean is not marked as an autowire candidate. As a consequence, autowiring
by name will nevertheless inject a bean if the name matches.
====
You can also limit autowire candidates based on pattern-matching against bean names. The
top-level `<beans/>` element accepts one or more patterns within its
`default-autowire-candidates` attribute. For example, to limit autowire candidate status