When used as a type-level annotation in conjunction with
indicates the name of a scope to use for instances of
the annotated type.
When used as a method-level annotation in conjunction with
@Scope indicates the name of a scope to use
for the instance returned from the method.
@Scope annotations are only introspected on the
concrete bean class (for annotated components) or the factory method
@Bean methods). In contrast to XML bean definitions,
there is no notion of bean definition inheritance, and inheritance
hierarchies at the class level are irrelevant for metadata purposes.
In this context, scope means the lifecycle of an instance,
prototype, and so forth. Scopes
provided out of the box in Spring may be referred to using the
SCOPE_* constants available in the
To register additional custom scopes, see