public interface Scope
Scopes are instantiated once on their first usage and stored within one container.
Modifier and Type | Method and Description |
---|---|
boolean |
accept(Scope referenceScope)
Returns
true if a bean of referenced scope can be
injected into target bean of this scope. |
java.lang.Object |
lookup(java.lang.String name)
Lookups for bean name.
|
void |
register(BeanDefinition beanDefinition,
java.lang.Object bean)
Registers the bean within the current scope.
|
void |
remove(java.lang.String name)
Removes the bean from the scope entirely.
|
void |
shutdown()
Shutdowns the scope by removing all beans and calling
destroy methods.
|
java.lang.Object lookup(java.lang.String name)
null
if bean is not
found or yet registered.void register(BeanDefinition beanDefinition, java.lang.Object bean)
BeanDefinition
.
Also it may register destroy methods of a bean within this scope.void remove(java.lang.String name)
boolean accept(Scope referenceScope)
true
if a bean of referenced scope can be
injected into target bean of this scope. Otherwise, returns
false
, which may be a sign for scoped proxy to be
injected.
In general, injection of 'shorter' reference scopes
into the 'longer' target scopes should not be accepted.
In other words, if reference scope is 'longer' or equal (same),
this method should return true
.
Helpful is to ask the following question: "May the reference scope bean be injected into bean of this scope?".
void shutdown()
Copyright © 2003-present Jodd Team