java.lang.Object | |
↳ | org.springframework.aop.framework.autoproxy.target.AbstractBeanFactoryBasedTargetSourceCreator |
Known Direct Subclasses |
Convenient superclass for
TargetSourceCreator
implementations that require creating multiple instances of a prototype bean.
Uses an internal BeanFactory to manage the target instances, copying the original bean definition to this internal factory. This is necessary because the original BeanFactory will just contain the proxy instance created through auto-proxying.
Requires running in an
AbstractBeanFactory
.
Fields | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
logger |
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Destroys the internal BeanFactory on shutdown of the TargetSourceCreator.
| |||||||||||
Create a special TargetSource for the given bean, if any.
| |||||||||||
Callback that supplies the owning factory to a bean instance.
|
Protected Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Build an internal BeanFactory for resolving target beans.
| |||||||||||
Subclasses must implement this method to return a new AbstractPrototypeBasedTargetSource
if they wish to create a custom TargetSource for this bean, or
null if they are
not interested it in, in which case no special target source will be created. | |||||||||||
Return the BeanFactory that this TargetSourceCreators runs in.
| |||||||||||
Return the internal BeanFactory to be used for the specified bean.
| |||||||||||
Return whether this TargetSourceCreator is prototype-based.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
| |||||||||||
From interface
org.springframework.aop.framework.autoproxy.TargetSourceCreator
| |||||||||||
From interface
org.springframework.beans.factory.BeanFactoryAware
| |||||||||||
From interface
org.springframework.beans.factory.DisposableBean
|
Destroys the internal BeanFactory on shutdown of the TargetSourceCreator.
Create a special TargetSource for the given bean, if any.
beanClass | the class of the bean to create a TargetSource for |
---|---|
beanName | the name of the bean |
null
if this TargetSourceCreator isn't
interested in the particular bean
Callback that supplies the owning factory to a bean instance.
Invoked after the population of normal bean properties
but before an initialization callback such as
afterPropertiesSet()
or a custom init-method.
beanFactory | owning BeanFactory (never null ).
The bean can immediately call methods on the factory. |
---|
Build an internal BeanFactory for resolving target beans.
containingFactory | the containing BeanFactory that originally defines the beans |
---|
Subclasses must implement this method to return a new AbstractPrototypeBasedTargetSource
if they wish to create a custom TargetSource for this bean, or null
if they are
not interested it in, in which case no special target source will be created.
Subclasses should not call setTargetBeanName
or setBeanFactory
on the AbstractPrototypeBasedTargetSource: This class' implementation of
getTargetSource()
will do that.
beanClass | the class of the bean to create a TargetSource for |
---|---|
beanName | the name of the bean |
null
if we don't match this
Return the BeanFactory that this TargetSourceCreators runs in.
Return the internal BeanFactory to be used for the specified bean.
beanName | the name of the target bean |
---|
Return whether this TargetSourceCreator is prototype-based. The scope of the target bean definition will be set accordingly.
Default is "true".