|
31 | 31 | (or an ancestor factory). |
32 | 32 |
|
33 | 33 | As alternative to bean references, "inner bean definitions" can be used. |
34 | | - Singleton flags of such inner bean definitions are effectively ignored: |
35 | | - inner beans are typically anonymous prototypes. |
| 34 | + Such inner beans do not have an independent lifecycle; they are typically |
| 35 | + anonymous nested objects that share the scope of their containing bean. |
36 | 36 |
|
37 | 37 | There is also support for lists, sets, maps, and java.util.Properties |
38 | 38 | as bean property types or constructor argument types. |
|
113 | 113 | <xsd:annotation> |
114 | 114 | <xsd:documentation><![CDATA[ |
115 | 115 | The default 'lazy-init' value; see the documentation for the |
116 | | - 'lazy-init' attribute of the 'bean' element. |
| 116 | + 'lazy-init' attribute of the 'bean' element. The default is "default", |
| 117 | + indicating inheritance from outer 'beans' sections in case of nesting, |
| 118 | + otherwise falling back to "false". |
117 | 119 | ]]></xsd:documentation> |
118 | 120 | </xsd:annotation> |
119 | 121 | </xsd:attribute> |
120 | 122 | <xsd:attribute name="default-merge" default="default" type="defaultable-boolean"> |
121 | 123 | <xsd:annotation> |
122 | 124 | <xsd:documentation><![CDATA[ |
123 | | - The default 'merge' value; see the documentation for the |
124 | | - 'merge' attribute of the various collection elements. The default |
125 | | - is 'false'. |
| 125 | + The default 'merge' value; see the documentation for the 'merge' |
| 126 | + attribute of the various collection elements. The default is "default", |
| 127 | + indicating inheritance from outer 'beans' sections in case of nesting, |
| 128 | + otherwise falling back to "false". |
126 | 129 | ]]></xsd:documentation> |
127 | 130 | </xsd:annotation> |
128 | 131 | </xsd:attribute> |
129 | 132 | <xsd:attribute name="default-autowire" default="default"> |
130 | 133 | <xsd:annotation> |
131 | 134 | <xsd:documentation><![CDATA[ |
132 | 135 | The default 'autowire' value; see the documentation for the |
133 | | - 'autowire' attribute of the 'bean' element. The default is 'default'. |
| 136 | + 'autowire' attribute of the 'bean' element. The default is "default", |
| 137 | + indicating inheritance from outer 'beans' sections in case of nesting, |
| 138 | + otherwise falling back to "no" (i.e. no externally driven autowiring). |
134 | 139 | ]]></xsd:documentation> |
135 | 140 | </xsd:annotation> |
136 | 141 | <xsd:simpleType> |
|
305 | 310 | service objects. Further scopes, such as "request" or "session", might |
306 | 311 | be supported by extended bean factories (e.g. in a web environment). |
307 | 312 |
|
308 | | - Inner bean definitions inherit the singleton status of their containing |
309 | | - bean definition, unless explicitly specified: The inner bean will be a |
| 313 | + Inner bean definitions inherit the scope of their containing bean |
| 314 | + definition, unless explicitly specified: The inner bean will be a |
310 | 315 | singleton if the containing bean is a singleton, and a prototype if |
311 | | - the containing bean has any other scope. |
| 316 | + the containing bean is a prototype, etc. |
312 | 317 | ]]></xsd:documentation> |
313 | 318 | </xsd:annotation> |
314 | 319 | </xsd:attribute> |
|
328 | 333 | <xsd:attribute name="lazy-init" default="default" type="defaultable-boolean"> |
329 | 334 | <xsd:annotation> |
330 | 335 | <xsd:documentation><![CDATA[ |
331 | | - Indicates whether or not this bean is to be lazily initialized. |
332 | | - If false, it will be instantiated on startup by bean factories |
333 | | - that perform eager initialization of singletons. The default is |
334 | | - "false". |
| 336 | + Indicates whether this bean is to be lazily initialized. If "false", |
| 337 | + it will be instantiated on startup by bean factories that perform eager |
| 338 | + initialization of singletons. The effective default is "false". |
335 | 339 |
|
336 | 340 | Note: This attribute will not be inherited by child bean definitions. |
337 | | - Hence, it needs to be specified per concrete bean definition. |
| 341 | + Hence, it needs to be specified per concrete bean definition. It can be |
| 342 | + shared through the 'default-lazy-init' attribute at the 'beans' level |
| 343 | + and potentially inherited from outer 'beans' defaults in case of nested |
| 344 | + 'beans' sections (e.g. with different profiles). |
338 | 345 | ]]></xsd:documentation> |
339 | 346 | </xsd:annotation> |
340 | 347 | </xsd:attribute> |
|
344 | 351 | Controls whether bean properties are "autowired". |
345 | 352 | This is an automagical process in which bean references don't need |
346 | 353 | to be coded explicitly in the XML bean definition file, but rather the |
347 | | - Spring container works out dependencies. |
| 354 | + Spring container works out dependencies. The effective default is "no". |
348 | 355 |
|
349 | 356 | There are 4 modes: |
350 | 357 |
|
|
379 | 386 | elements, always override autowiring. |
380 | 387 |
|
381 | 388 | Note: This attribute will not be inherited by child bean definitions. |
382 | | - Hence, it needs to be specified per concrete bean definition. |
| 389 | + Hence, it needs to be specified per concrete bean definition. It can be |
| 390 | + shared through the 'default-autowire' attribute at the 'beans' level |
| 391 | + and potentially inherited from outer 'beans' defaults in case of nested |
| 392 | + 'beans' sections (e.g. with different profiles). |
383 | 393 | ]]></xsd:documentation> |
384 | 394 | </xsd:annotation> |
385 | 395 | <xsd:simpleType> |
|
0 commit comments