BeanFactoryPostProcessor implementation that registers
custom Scope(s) 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.
ConfigurableBeanFactory#registerScope
| Modifier and Type | Field and Description |
|---|---|
| private ClassLoader | |
| private int | |
| private Map |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public void | |
| public int | |
| public void | postProcessBeanFactory(ConfigurableListableBeanFactory
the bean factory used by the application context beanFactory)Implements org. Modify the application context's internal bean factory after its standard initialization. |
| public void | setBeanClassLoader(ClassLoader
the owning class loader beanClassLoader)Implements org. Callback that supplies the bean |
| public void | |
| public void |
| beanClassLoader | back to summary |
|---|---|
| private ClassLoader beanClassLoader
| |
| order | back to summary |
|---|---|
| private int order | |
| scopes | back to summary |
|---|---|
| private Map<String, Object> scopes
| |
| CustomScopeConfigurer | back to summary |
|---|---|
| public CustomScopeConfigurer() | |
| addScope | back to summary |
|---|---|
| public void addScope(String scopeName, Scope scope) Add the given scope to this configurer's map of scopes. | |
| getOrder | back to summary |
|---|---|
| public int getOrder() Implements org. Doc from org. Get the order value of this object. Higher values are interpreted as lower priority. As a consequence,
the object with the lowest value has the highest priority (somewhat
analogous to Servlet Same order values will result in arbitrary sort positions for the affected objects.
| |
| postProcessBeanFactory | back to summary |
|---|---|
| public void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory) throws BeansException Implements org. Doc from org. Modify the application context's internal bean factory after its standard initialization. All bean definitions will have been loaded, but no beans will have been instantiated yet. This allows for overriding or adding properties even to eager-initializing beans.
| |
| setBeanClassLoader | back to summary |
|---|---|
| public void setBeanClassLoader(ClassLoader beanClassLoader) Implements org. Doc from org. Callback that supplies the bean Invoked after the population of normal bean properties but
before an initialization callback such as
| |
| setOrder | back to summary |
|---|---|
| public void setOrder(int order) | |
| setScopes | back to summary |
|---|---|
| public void setScopes(Map<String, Object> scopes) 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 | |