blob: 1e7166fa0a5b20499aa85047d2e526ced9a829bf [file] [log] [blame]
Tag name:&nbsp;<b>scope</b><br>Description :&nbsp;The scope of this bean: typically &quot;singleton&quot; (one shared instance,<br>
which will be returned by all calls to getBean() with the id),<br>
or &quot;prototype&quot; (independent instance resulting from each call to<br>
getBean(). Default is &quot;singleton&quot;.<br>
<br>
Singletons are most commonly used, and are ideal for multi-threaded<br>
service objects. Further scopes, such as &quot;request&quot; or &quot;session&quot;,<br>
might be supported by extended bean factories (for example, in a<br>
web environment).<br>
<br>
Note: This attribute will not be inherited by child bean definitions.<br>
Hence, it needs to be specified per concrete bean definition.<br>
<br>
Inner bean definitions inherit the singleton status of their containing<br>
bean definition, unless explicitly specified: The inner bean will be a<br>
singleton if the containing bean is a singleton, and a prototype if<br>
the containing bean has any other scope.