1
1
/*
2
- * Copyright 2002-2024 the original author or authors.
2
+ * Copyright 2002-2025 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.
@@ -145,8 +145,6 @@ public interface ListableBeanFactory extends BeanFactory {
145
145
* <p>Does not consider any hierarchy this factory may participate in.
146
146
* Use BeanFactoryUtils' {@code beanNamesForTypeIncludingAncestors}
147
147
* to include beans in ancestor factories too.
148
- * <p>Note: Does <i>not</i> ignore singleton beans that have been registered
149
- * by other means than bean definitions.
150
148
* <p>This version of {@code getBeanNamesForType} matches all kinds of beans,
151
149
* be it singletons, prototypes, or FactoryBeans. In most implementations, the
152
150
* result will be the same as for {@code getBeanNamesForType(type, true, true)}.
@@ -176,8 +174,6 @@ public interface ListableBeanFactory extends BeanFactory {
176
174
* <p>Does not consider any hierarchy this factory may participate in.
177
175
* Use BeanFactoryUtils' {@code beanNamesForTypeIncludingAncestors}
178
176
* to include beans in ancestor factories too.
179
- * <p>Note: Does <i>not</i> ignore singleton beans that have been registered
180
- * by other means than bean definitions.
181
177
* <p>Bean names returned by this method should always return bean names <i>in the
182
178
* order of definition</i> in the backend configuration, as far as possible.
183
179
* @param type the generically typed class or interface to match
@@ -210,8 +206,6 @@ public interface ListableBeanFactory extends BeanFactory {
210
206
* <p>Does not consider any hierarchy this factory may participate in.
211
207
* Use BeanFactoryUtils' {@code beanNamesForTypeIncludingAncestors}
212
208
* to include beans in ancestor factories too.
213
- * <p>Note: Does <i>not</i> ignore singleton beans that have been registered
214
- * by other means than bean definitions.
215
209
* <p>This version of {@code getBeanNamesForType} matches all kinds of beans,
216
210
* be it singletons, prototypes, or FactoryBeans. In most implementations, the
217
211
* result will be the same as for {@code getBeanNamesForType(type, true, true)}.
@@ -239,8 +233,6 @@ public interface ListableBeanFactory extends BeanFactory {
239
233
* <p>Does not consider any hierarchy this factory may participate in.
240
234
* Use BeanFactoryUtils' {@code beanNamesForTypeIncludingAncestors}
241
235
* to include beans in ancestor factories too.
242
- * <p>Note: Does <i>not</i> ignore singleton beans that have been registered
243
- * by other means than bean definitions.
244
236
* <p>Bean names returned by this method should always return bean names <i>in the
245
237
* order of definition</i> in the backend configuration, as far as possible.
246
238
* @param type the class or interface to match, or {@code null} for all bean names
@@ -265,21 +257,24 @@ public interface ListableBeanFactory extends BeanFactory {
265
257
* subclasses), judging from either bean definitions or the value of
266
258
* {@code getObjectType} in the case of FactoryBeans.
267
259
* <p><b>NOTE: This method introspects top-level beans only.</b> It does <i>not</i>
268
- * check nested beans which might match the specified type as well.
260
+ * check nested beans which might match the specified type as well. Also, it
261
+ * <b>suppresses exceptions for beans that are currently in creation in a circular
262
+ * reference scenario:</b> typically, references back to the caller of this method.
269
263
* <p>Does consider objects created by FactoryBeans, which means that FactoryBeans
270
264
* will get initialized. If the object created by the FactoryBean doesn't match,
271
265
* the raw FactoryBean itself will be matched against the type.
272
266
* <p>Does not consider any hierarchy this factory may participate in.
273
267
* Use BeanFactoryUtils' {@code beansOfTypeIncludingAncestors}
274
268
* to include beans in ancestor factories too.
275
- * <p>Note: Does <i>not</i> ignore singleton beans that have been registered
276
- * by other means than bean definitions.
277
269
* <p>This version of getBeansOfType matches all kinds of beans, be it
278
270
* singletons, prototypes, or FactoryBeans. In most implementations, the
279
271
* result will be the same as for {@code getBeansOfType(type, true, true)}.
280
272
* <p>The Map returned by this method should always return bean names and
281
273
* corresponding bean instances <i>in the order of definition</i> in the
282
274
* backend configuration, as far as possible.
275
+ * <p><b>Consider {@link #getBeanNamesForType(Class)} with selective {@link #getBean}
276
+ * calls for specific bean names in preference to this Map-based retrieval method.</b>
277
+ * Aside from lazy instantiation benefits, this also avoids any exception suppression.
283
278
* @param type the class or interface to match, or {@code null} for all concrete beans
284
279
* @return a Map with the matching beans, containing the bean names as
285
280
* keys and the corresponding bean instances as values
@@ -295,7 +290,9 @@ public interface ListableBeanFactory extends BeanFactory {
295
290
* subclasses), judging from either bean definitions or the value of
296
291
* {@code getObjectType} in the case of FactoryBeans.
297
292
* <p><b>NOTE: This method introspects top-level beans only.</b> It does <i>not</i>
298
- * check nested beans which might match the specified type as well.
293
+ * check nested beans which might match the specified type as well. Also, it
294
+ * <b>suppresses exceptions for beans that are currently in creation in a circular
295
+ * reference scenario:</b> typically, references back to the caller of this method.
299
296
* <p>Does consider objects created by FactoryBeans if the "allowEagerInit" flag is set,
300
297
* which means that FactoryBeans will get initialized. If the object created by the
301
298
* FactoryBean doesn't match, the raw FactoryBean itself will be matched against the
@@ -304,11 +301,12 @@ public interface ListableBeanFactory extends BeanFactory {
304
301
* <p>Does not consider any hierarchy this factory may participate in.
305
302
* Use BeanFactoryUtils' {@code beansOfTypeIncludingAncestors}
306
303
* to include beans in ancestor factories too.
307
- * <p>Note: Does <i>not</i> ignore singleton beans that have been registered
308
- * by other means than bean definitions.
309
304
* <p>The Map returned by this method should always return bean names and
310
305
* corresponding bean instances <i>in the order of definition</i> in the
311
306
* backend configuration, as far as possible.
307
+ * <p><b>Consider {@link #getBeanNamesForType(Class)} with selective {@link #getBean}
308
+ * calls for specific bean names in preference to this Map-based retrieval method.</b>
309
+ * Aside from lazy instantiation benefits, this also avoids any exception suppression.
312
310
* @param type the class or interface to match, or {@code null} for all concrete beans
313
311
* @param includeNonSingletons whether to include prototype or scoped beans too
314
312
* or just singletons (also applies to FactoryBeans)
0 commit comments