File tree Expand file tree Collapse file tree 1 file changed +16
-0
lines changed
framework-docs/modules/ROOT/pages/core/beans/dependencies Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -124,5 +124,21 @@ These techniques are useful for beans that you never want to be injected into ot
124
124
by autowiring. It does not mean that an excluded bean cannot itself be configured by
125
125
using autowiring. Rather, the bean itself is not a candidate for autowiring other beans.
126
126
127
+ [NOTE]
128
+ ====
129
+ As of 6.2, `@Bean` methods support two variants of the autowire candidate flag:
130
+ `autowireCandidate` and `defaultCandidate`.
131
+
132
+ When using xref:core/beans/annotation-config/autowired-qualifiers.adoc[qualifiers],
133
+ a bean marked with `defaultCandidate=false` is only available for injection points
134
+ where an additional qualifier indication is present. This is useful for restricted
135
+ delegates that are supposed to be injectable in certain areas but are not meant to
136
+ get in the way of beans of the same type in other places. Such a bean will never
137
+ get injected by plain declared type only, rather by type plus specific qualifier.
138
+
139
+ In contrast, `autowireCandidate=false` behaves exactly like the `autowire-candidate`
140
+ attribute as explained above: Such a bean will never get injected by type at all.
141
+ ====
142
+
127
143
128
144
You can’t perform that action at this time.
0 commit comments