public class LazyInitOverrideBeanFactoryPostProcessor extends Object
This is useful especially for some configuration beans like ListMergeDirective which would never be loaded in
lazy mode because there is nothing that requires them explicitly, but without them system will misbehave.
| Constructor and Description |
|---|
LazyInitOverrideBeanFactoryPostProcessor() |
| Modifier and Type | Method and Description |
|---|---|
protected Class<?> |
forName(String name)
Helper method for getting class for name without throwing exception.
|
protected List<Class<?>> |
getEagerlyLoadedClasses() |
protected boolean |
getLazyInit() |
protected Optional<BeanDefinition> |
getMergedBeanDefinition(String beanName,
ConfigurableListableBeanFactory beanFactory)
Helper method for getting MergedBeanDefintion and ignoring potential errors by returning Optional.empty
|
protected boolean |
isSupportedClass(Class<?> clazz)
Predicate finding if given class exists in set of supported classes (is assignable to any of them)
|
protected void |
overrideLazyInit(String beanName,
ConfigurableListableBeanFactory beanFactory)
Overrides lazyInit property for given bean definition.
|
void |
postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory)
Searches for bean definitions that are not abstract and are of particular class.
|
void |
setEagerlyLoadedClasses(List<Class<?>> eagerlyLoadedClasses) |
void |
setLazyInit(boolean lazyInit) |
public LazyInitOverrideBeanFactoryPostProcessor()
public void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory)
throws BeansException
BeansExceptionprotected Optional<BeanDefinition> getMergedBeanDefinition(String beanName, ConfigurableListableBeanFactory beanFactory)
protected Class<?> forName(String name)
protected boolean isSupportedClass(Class<?> clazz)
protected void overrideLazyInit(String beanName, ConfigurableListableBeanFactory beanFactory)
public void setLazyInit(boolean lazyInit)
protected boolean getLazyInit()
Copyright © 2017 SAP SE. All Rights Reserved.