revised scope inheritance: default scope is "" (empty String) now; consistent isPrototype checks

This commit is contained in:
Juergen Hoeller
2009-11-19 18:32:10 +00:00
parent ee5330801d
commit b41e3956bc
5 changed files with 34 additions and 16 deletions

View File

@@ -260,15 +260,14 @@
The scope of this bean: typically "singleton" (one shared instance,
which will be returned by all calls to getBean with the given id), or
"prototype" (independent instance resulting from each call to getBean).
Default is "singleton".
By default, a bean will be a singleton, unless the bean has a parent
bean definition in which case it will inherit the parent's scope.
Singletons are most commonly used, and are ideal for multi-threaded
service objects. Further scopes, such as "request" or "session", might
be supported by extended bean factories (e.g. in a web environment).
Note: This attribute will not be inherited by child bean definitions.
Hence, it needs to be specified per concrete bean definition.
Inner bean definitions inherit the singleton status of their containing
bean definition, unless explicitly specified: The inner bean will be a
singleton if the containing bean is a singleton, and a prototype if