|
The Spring Framework | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface BeanDefinitionRegistry
Interface for registries that hold bean definitions, for example RootBeanDefinition and ChildBeanDefinition instances. Typically implemented by BeanFactories that internally work with the AbstractBeanDefinition hierarchy.
This is the only interface in Spring's bean factory packages that encapsulates registration of bean definitions. The standard BeanFactory interfaces only cover access to a fully configured factory instance.
Spring's bean definition readers expect to work on an implementation of this interface. Known implementors within the Spring core are DefaultListableBeanFactory and GenericApplicationContext.
BeanDefinition
,
AbstractBeanDefinition
,
RootBeanDefinition
,
ChildBeanDefinition
,
DefaultListableBeanFactory
,
GenericApplicationContext
,
XmlBeanDefinitionReader
,
PropertiesBeanDefinitionReader
Method Summary | |
---|---|
boolean |
containsBeanDefinition(String beanName)
Check if this registry contains a bean definition with the given name. |
String[] |
getAliases(String beanName)
Return the aliases for the given bean name, if defined. |
BeanDefinition |
getBeanDefinition(String beanName)
Return the BeanDefinition for the given bean name. |
int |
getBeanDefinitionCount()
Return the number of beans defined in the registry. |
String[] |
getBeanDefinitionNames()
Return the names of all beans defined in this registry. |
void |
registerAlias(String beanName,
String alias)
Given a bean name, create an alias. |
void |
registerBeanDefinition(String beanName,
BeanDefinition beanDefinition)
Register a new bean definition with this registry. |
Method Detail |
---|
void registerBeanDefinition(String beanName, BeanDefinition beanDefinition) throws BeanDefinitionStoreException
beanName
- the name of the bean instance to registerbeanDefinition
- definition of the bean instance to register
BeanDefinitionStoreException
- if the BeanDefinition is invalid
or if there is already a BeanDefinition for the specified bean name
(and we are not allowed to override it)RootBeanDefinition
,
ChildBeanDefinition
BeanDefinition getBeanDefinition(String beanName) throws NoSuchBeanDefinitionException
beanName
- name of the bean to find a definition for
null
)
NoSuchBeanDefinitionException
- if there is no such bean definitionboolean containsBeanDefinition(String beanName)
beanName
- the name of the bean to look for
String[] getBeanDefinitionNames()
int getBeanDefinitionCount()
void registerAlias(String beanName, String alias) throws BeanDefinitionStoreException
beanName
- the canonical name of the beanalias
- the alias to be registered for the bean
BeanDefinitionStoreException
- if the alias is already in useString[] getAliases(String beanName)
beanName
- the bean name to check for aliases
|
The Spring Framework | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |