spring-framework / org.springframework.beans.factory.config / CustomScopeConfigurer

CustomScopeConfigurer

open class CustomScopeConfigurer : BeanFactoryPostProcessor, BeanClassLoaderAware, Ordered

Simple BeanFactoryPostProcessor implementation that registers custom Scope with the containing ConfigurableBeanFactory.

Will register all of the supplied scopes with the ConfigurableListableBeanFactory that is passed to the #postProcessBeanFactory(ConfigurableListableBeanFactory) method.

This class allows for declarative registration of custom scopes. Alternatively, consider implementing a custom BeanFactoryPostProcessor that calls ConfigurableBeanFactory#registerScope programmatically.

Author
Juergen Hoeller

Author
Rick Evans

Since
2.0

See Also
ConfigurableBeanFactory#registerScope

Constructors

<init>

CustomScopeConfigurer()

Simple BeanFactoryPostProcessor implementation that registers custom Scope with the containing ConfigurableBeanFactory.

Will register all of the supplied scopes with the ConfigurableListableBeanFactory that is passed to the #postProcessBeanFactory(ConfigurableListableBeanFactory) method.

This class allows for declarative registration of custom scopes. Alternatively, consider implementing a custom BeanFactoryPostProcessor that calls ConfigurableBeanFactory#registerScope programmatically.

Functions

addScope

open fun addScope(scopeName: String, scope: Scope): Unit

Add the given scope to this configurer's map of scopes.

getOrder

open fun getOrder(): Int

postProcessBeanFactory

open fun postProcessBeanFactory(beanFactory: ConfigurableListableBeanFactory): Unit

setBeanClassLoader

open fun setBeanClassLoader(beanClassLoader: ClassLoader): Unit

setOrder

open fun setOrder(order: Int): Unit

setScopes

open fun setScopes(scopes: MutableMap<String, Any>): Unit

Specify the custom scopes that are to be registered.

The keys indicate the scope names (of type String); each value is expected to be the corresponding custom Scope instance or class name.