class BeanRegistry : HierarchicalBeansProvider
BeansProvider that holds and provides beans which were explicitly registered before.
The BeanRegistry supports the singleton and prototype scopes by default.
BeanRegistry is also a HierarchicalBeansProvider, so it supports a parent to inherit beans from.
Author
Christopher Frieler
fun addBeanScope(scopedFactoryBeanHandler: ScopedFactoryBeanHandler): Unit
Adds a bean-scope expressed by the given ScopedFactoryBeanHandler to this BeanRegistry. |
|
fun <T : Any> lookUpLocalBeans(type: KClass<T>): List<T>
Looks up all beans of the given type solely locally, i.e. not in the parent. |
|
fun <T : Any> lookUpOptionalLocalBean(name: String, type: KClass<T>): T?
Looks up the bean with the given name and type locally, i.e. solely in this BeansProvider, not in the parent, following the same contract as BeansProvider.lookUpOptionalBean. fun <T : Any> lookUpOptionalLocalBean(type: KClass<T>): T?
Looks up the bean with the given type locally, i.e. solely in this BeansProvider, not in the parent, following the same contract as BeansProvider.lookUpOptionalBean. |
|
fun registerBean(bean: Any): String
Registers the bean with a generated name at this BeanRegistry and returns this name. fun registerBean(name: String, bean: Any): Unit
Registers the bean with the given name at this BeanRegistry. |
fun <T : Any> lookUpBeans(type: KClass<T>): List<T>
Looks up all beans of the given type locally and in the parent. |
|
fun <T : Any> lookUpOptionalBean(name: String, type: KClass<T>): T?
Looks up the bean with the given name and type. fun <T : Any> lookUpOptionalBean(type: KClass<T>): T?
Looks up the bean with the given type. |