|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
SPI interface to be implemented by most if not all bean factories. Provides means to configure a bean factory in addition to the bean factory client methods in the BeanFactory interface.
Allows for framework-internal plug'n'play even when needing access to bean factory configuration methods.
ConfigurableListableBeanFactory
Method Summary | |
void |
addBeanPostProcessor(BeanPostProcessor beanPostProcessor)
Add a new BeanPostPrcoessor that will get applied to beans created with this factory. |
void |
destroySingletons()
Destroy all cached singletons in this factory. |
BeanDefinition |
getBeanDefinition(java.lang.String beanName)
Return the registered BeanDefinition for the given bean. |
void |
ignoreDependencyType(java.lang.Class type)
Ignore the given dependency type for autowiring. |
void |
registerAlias(java.lang.String beanName,
java.lang.String alias)
Given a bean name, create an alias. |
void |
registerCustomEditor(java.lang.Class requiredType,
java.beans.PropertyEditor propertyEditor)
Register the given custom property editor for all properties of the given type. |
void |
registerSingleton(java.lang.String beanName,
java.lang.Object singletonObject)
Register the given existing object as singleton in the bean factory, under the given bean name. |
void |
setParentBeanFactory(BeanFactory parentBeanFactory)
Set the parent of this bean factory. |
Methods inherited from interface org.springframework.beans.factory.HierarchicalBeanFactory |
getParentBeanFactory |
Methods inherited from interface org.springframework.beans.factory.BeanFactory |
containsBean, getAliases, getBean, getBean, isSingleton |
Method Detail |
public void setParentBeanFactory(BeanFactory parentBeanFactory)
Note that the parent shouldn't be changed: It should only be set outside a constructor if it isn't available when an object of this class is created.
parentBeanFactory
- the parent bean factorypublic void registerCustomEditor(java.lang.Class requiredType, java.beans.PropertyEditor propertyEditor)
requiredType
- type of the propertypropertyEditor
- editor to registerpublic void addBeanPostProcessor(BeanPostProcessor beanPostProcessor)
public void ignoreDependencyType(java.lang.Class type)
This will typically be used for dependencies that are resolved in other ways, like BeanFactory through BeanFactoryAware or ApplicationContext through ApplicationContextAware.
BeanFactoryAware
,
ApplicationContextAware
public BeanDefinition getBeanDefinition(java.lang.String beanName) throws BeansException
beanName
- name of the bean
NoSuchBeanDefinitionException
- if there is no bean with the given name
BeansException
- in case of errorspublic void registerAlias(java.lang.String beanName, java.lang.String alias) throws BeansException
Typically invoked during factory configuration, but can also be used for runtime registration of aliases. Therefore, a factory implementation should synchronize alias access.
beanName
- name of the beanalias
- alias that will behave the same as the bean name
NoSuchBeanDefinitionException
- if there is no bean with the given name
BeansException
- if the alias is already in usepublic void registerSingleton(java.lang.String beanName, java.lang.Object singletonObject) throws BeansException
Typically invoked during factory configuration, but can also be used for runtime registration of singletons. Therefore, a factory implementation should synchronize singleton access; it will have to do this anyway if it supports lazy initialization of singletons.
beanName
- name of the beansingletonObject
- the existing object
BeansException
- if the singleton could not be registeredpublic void destroySingletons()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |