@FunctionalInterface
public interface LazyInitializationExcludeFilter
lazy-init set by the
LazyInitializationBeanFactoryPostProcessor.
Primarily intended to allow downstream projects to deal with edge-cases in which it is not easy to support lazy-loading (such as in DSLs that dynamically create additional beans). Adding an instance of this filter to the application context can be used for these edge cases.
A typical example would be something like this:
@Bean
public static LazyInitializationExcludeFilter integrationLazyInitializationExcludeFilter() {
return LazyInitializationExcludeFilter.forBeanTypes(IntegrationFlow.class);
}
NOTE: Beans of this type will be instantiated very early in the spring application lifecycle so they should generally be declared static and not have any dependencies.
| Modifier and Type | Method and Description |
|---|---|
static LazyInitializationExcludeFilter |
forBeanTypes(java.lang.Class<?>... types)
Factory method that creates a filter for the given bean types.
|
boolean |
isExcluded(java.lang.String beanName,
org.springframework.beans.factory.config.BeanDefinition beanDefinition,
java.lang.Class<?> beanType)
Returns
true if the specified bean definition should be excluded from
having lazy-init automatically set. |
boolean isExcluded(java.lang.String beanName,
org.springframework.beans.factory.config.BeanDefinition beanDefinition,
java.lang.Class<?> beanType)
true if the specified bean definition should be excluded from
having lazy-init automatically set.beanName - the bean namebeanDefinition - the bean definitionbeanType - the bean typetrue if lazy-init should not be automatically setstatic LazyInitializationExcludeFilter forBeanTypes(java.lang.Class<?>... types)
types - the filtered types