1
1
/*
2
- * Copyright 2002-2022 the original author or authors.
2
+ * Copyright 2002-2024 the original author or authors.
3
3
*
4
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
5
* you may not use this file except in compliance with the License.
@@ -92,9 +92,13 @@ public interface ListableBeanFactory extends BeanFactory {
92
92
* Return a provider for the specified bean, allowing for lazy on-demand retrieval
93
93
* of instances, including availability and uniqueness options.
94
94
* @param requiredType type the bean must match; can be an interface or superclass
95
- * @param allowEagerInit whether stream-based access may initialize <i>lazy-init
96
- * singletons</i> and <i>objects created by FactoryBeans</i> (or by factory methods
97
- * with a "factory-bean" reference) for the type check
95
+ * @param allowEagerInit whether stream access may introspect <i>lazy-init singletons</i>
96
+ * and <i>objects created by FactoryBeans</i> - or by factory methods with a
97
+ * "factory-bean" reference - for the type check. Note that FactoryBeans need to be
98
+ * eagerly initialized to determine their type: So be aware that passing in "true"
99
+ * for this flag will initialize FactoryBeans and "factory-bean" references. Only
100
+ * actually necessary initialization for type checking purposes will be performed;
101
+ * constructor and method invocations will still be avoided as far as possible.
98
102
* @return a corresponding provider handle
99
103
* @since 5.3
100
104
* @see #getBeanProvider(ResolvableType, boolean)
@@ -112,9 +116,13 @@ public interface ListableBeanFactory extends BeanFactory {
112
116
* injection points. For programmatically retrieving a list of beans matching a
113
117
* specific type, specify the actual bean type as an argument here and subsequently
114
118
* use {@link ObjectProvider#orderedStream()} or its lazy streaming/iteration options.
115
- * @param allowEagerInit whether stream-based access may initialize <i>lazy-init
116
- * singletons</i> and <i>objects created by FactoryBeans</i> (or by factory methods
117
- * with a "factory-bean" reference) for the type check
119
+ * @param allowEagerInit whether stream access may introspect <i>lazy-init singletons</i>
120
+ * and <i>objects created by FactoryBeans</i> - or by factory methods with a
121
+ * "factory-bean" reference - for the type check. Note that FactoryBeans need to be
122
+ * eagerly initialized to determine their type: So be aware that passing in "true"
123
+ * for this flag will initialize FactoryBeans and "factory-bean" references. Only
124
+ * actually necessary initialization for type checking purposes will be performed;
125
+ * constructor and method invocations will still be avoided as far as possible.
118
126
* @return a corresponding provider handle
119
127
* @since 5.3
120
128
* @see #getBeanProvider(ResolvableType)
@@ -175,11 +183,13 @@ public interface ListableBeanFactory extends BeanFactory {
175
183
* @param type the generically typed class or interface to match
176
184
* @param includeNonSingletons whether to include prototype or scoped beans too
177
185
* or just singletons (also applies to FactoryBeans)
178
- * @param allowEagerInit whether to initialize <i>lazy-init singletons</i> and
179
- * <i>objects created by FactoryBeans</i> ( or by factory methods with a
180
- * "factory-bean" reference) for the type check. Note that FactoryBeans need to be
186
+ * @param allowEagerInit whether to introspect <i>lazy-init singletons</i>
187
+ * and <i>objects created by FactoryBeans</i> - or by factory methods with a
188
+ * "factory-bean" reference - for the type check. Note that FactoryBeans need to be
181
189
* eagerly initialized to determine their type: So be aware that passing in "true"
182
- * for this flag will initialize FactoryBeans and "factory-bean" references.
190
+ * for this flag will initialize FactoryBeans and "factory-bean" references. Only
191
+ * actually necessary initialization for type checking purposes will be performed;
192
+ * constructor and method invocations will still be avoided as far as possible.
183
193
* @return the names of beans (or objects created by FactoryBeans) matching
184
194
* the given object type (including subclasses), or an empty array if none
185
195
* @since 5.2
@@ -236,11 +246,13 @@ public interface ListableBeanFactory extends BeanFactory {
236
246
* @param type the class or interface to match, or {@code null} for all bean names
237
247
* @param includeNonSingletons whether to include prototype or scoped beans too
238
248
* or just singletons (also applies to FactoryBeans)
239
- * @param allowEagerInit whether to initialize <i>lazy-init singletons</i> and
240
- * <i>objects created by FactoryBeans</i> ( or by factory methods with a
241
- * "factory-bean" reference) for the type check. Note that FactoryBeans need to be
249
+ * @param allowEagerInit whether to introspect <i>lazy-init singletons</i>
250
+ * and <i>objects created by FactoryBeans</i> - or by factory methods with a
251
+ * "factory-bean" reference - for the type check. Note that FactoryBeans need to be
242
252
* eagerly initialized to determine their type: So be aware that passing in "true"
243
- * for this flag will initialize FactoryBeans and "factory-bean" references.
253
+ * for this flag will initialize FactoryBeans and "factory-bean" references. Only
254
+ * actually necessary initialization for type checking purposes will be performed;
255
+ * constructor and method invocations will still be avoided as far as possible.
244
256
* @return the names of beans (or objects created by FactoryBeans) matching
245
257
* the given object type (including subclasses), or an empty array if none
246
258
* @see FactoryBean#getObjectType
@@ -300,11 +312,13 @@ public interface ListableBeanFactory extends BeanFactory {
300
312
* @param type the class or interface to match, or {@code null} for all concrete beans
301
313
* @param includeNonSingletons whether to include prototype or scoped beans too
302
314
* or just singletons (also applies to FactoryBeans)
303
- * @param allowEagerInit whether to initialize <i>lazy-init singletons</i> and
304
- * <i>objects created by FactoryBeans</i> ( or by factory methods with a
305
- * "factory-bean" reference) for the type check. Note that FactoryBeans need to be
315
+ * @param allowEagerInit whether to introspect <i>lazy-init singletons</i>
316
+ * and <i>objects created by FactoryBeans</i> - or by factory methods with a
317
+ * "factory-bean" reference - for the type check. Note that FactoryBeans need to be
306
318
* eagerly initialized to determine their type: So be aware that passing in "true"
307
- * for this flag will initialize FactoryBeans and "factory-bean" references.
319
+ * for this flag will initialize FactoryBeans and "factory-bean" references. Only
320
+ * actually necessary initialization for type checking purposes will be performed;
321
+ * constructor and method invocations will still be avoided as far as possible.
308
322
* @return a Map with the matching beans, containing the bean names as
309
323
* keys and the corresponding bean instances as values
310
324
* @throws BeansException if a bean could not be created
0 commit comments