org.riotfamily.common.beans.config
Class SpringConfigurer
java.lang.Object
org.riotfamily.common.beans.config.SpringConfigurer
- All Implemented Interfaces:
- Configurer, BeanFactoryPostProcessor
public class SpringConfigurer
- extends Object
- implements Configurer, BeanFactoryPostProcessor
Configurer implementation that uses Spring prototype beans to
inject dependencies.
Looks for prototype bean definitions who's class is a sub-class of
ConfigurableBean
. If at least one such prototype is found,
ConfigurableBean.configurer
is set to this
.
In order to configure a ConfigurableBean instance,
AutowireCapableBeanFactory.configureBean(Object, String)
is
invoked, passing the bean and the beanName of the matching prototype.
- Since:
- 8.0
- Author:
- Felix Gnass [fgnass at neteye dot de]
- See Also:
AutowireCapableBeanFactory.configureBean(Object, String)
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
SpringConfigurer
public SpringConfigurer()
postProcessBeanFactory
public void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory)
throws BeansException
- Looks for prototype beans who's class extends ConfigurableBean.
- Specified by:
postProcessBeanFactory
in interface BeanFactoryPostProcessor
- Throws:
BeansException
configure
public void configure(ConfigurableBean bean)
- Invokes
AutowireCapableBeanFactory.configureBean(Object, String)
if a matching prototype definition exists.
- Specified by:
configure
in interface Configurer
getPrototype
protected String getPrototype(ConfigurableBean bean)