Don't use BeanRegistrationExcludeFilter as an exclude signal
Closes gh-28833
This commit is contained in:
@@ -111,11 +111,14 @@ class BeanDefinitionMethodGeneratorFactory {
|
||||
|
||||
private boolean isImplicitlyExcluded(RegisteredBean registeredBean) {
|
||||
Class<?> beanClass = registeredBean.getBeanClass();
|
||||
if (BeanRegistrationExcludeFilter.class.isAssignableFrom(beanClass)) {
|
||||
return false;
|
||||
if (BeanFactoryInitializationAotProcessor.class.isAssignableFrom(beanClass)) {
|
||||
return true;
|
||||
}
|
||||
return BeanFactoryInitializationAotProcessor.class.isAssignableFrom(beanClass)
|
||||
|| BeanRegistrationAotProcessor.class.isAssignableFrom(beanClass);
|
||||
if (BeanRegistrationAotProcessor.class.isAssignableFrom(beanClass)) {
|
||||
BeanRegistrationAotProcessor processor = this.aotProcessors.findByBeanName(registeredBean.getBeanName());
|
||||
return (processor == null) || processor.isBeanExcludedFromAotProcessing();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private List<BeanRegistrationAotContribution> getAotContributions(
|
||||
|
||||
@@ -47,4 +47,16 @@ public interface BeanRegistrationAotProcessor {
|
||||
@Nullable
|
||||
BeanRegistrationAotContribution processAheadOfTime(RegisteredBean registeredBean);
|
||||
|
||||
/**
|
||||
* Return if the bean instance associated with this processor should be
|
||||
* excluded from AOT processing itself. By default this method will return
|
||||
* {@code true} to automatically exclude the bean, if the definition should
|
||||
* be written then this method may be overridden to return {@code true}.
|
||||
* @return if the bean should be excluded from AOT processing
|
||||
* @see BeanRegistrationExcludeFilter
|
||||
*/
|
||||
default boolean isBeanExcludedFromAotProcessing() {
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user