mirror of
https://github.com/spring-projects/spring-boot.git
synced 2024-08-29 03:06:45 +08:00
Merge pull request #39321 from vjh0107
* pr/39321: Change ConcurrentReferenceCachingMetadataReaderFactory to use application's resource loader Closes gh-39321
This commit is contained in:
commit
3a31941071
@ -21,7 +21,6 @@ import java.util.function.Supplier;
|
||||
import org.springframework.aot.AotDetector;
|
||||
import org.springframework.beans.BeansException;
|
||||
import org.springframework.beans.MutablePropertyValues;
|
||||
import org.springframework.beans.factory.BeanClassLoaderAware;
|
||||
import org.springframework.beans.factory.FactoryBean;
|
||||
import org.springframework.beans.factory.NoSuchBeanDefinitionException;
|
||||
import org.springframework.beans.factory.aot.BeanRegistrationExcludeFilter;
|
||||
@ -38,11 +37,13 @@ import org.springframework.boot.type.classreading.ConcurrentReferenceCachingMeta
|
||||
import org.springframework.context.ApplicationContextInitializer;
|
||||
import org.springframework.context.ApplicationListener;
|
||||
import org.springframework.context.ConfigurableApplicationContext;
|
||||
import org.springframework.context.ResourceLoaderAware;
|
||||
import org.springframework.context.annotation.AnnotationConfigUtils;
|
||||
import org.springframework.context.annotation.ConfigurationClassPostProcessor;
|
||||
import org.springframework.context.event.ContextRefreshedEvent;
|
||||
import org.springframework.core.Ordered;
|
||||
import org.springframework.core.PriorityOrdered;
|
||||
import org.springframework.core.io.ResourceLoader;
|
||||
import org.springframework.core.type.classreading.CachingMetadataReaderFactory;
|
||||
import org.springframework.core.type.classreading.MetadataReaderFactory;
|
||||
|
||||
@ -187,14 +188,14 @@ class SharedMetadataReaderFactoryContextInitializer implements
|
||||
* {@link FactoryBean} to create the shared {@link MetadataReaderFactory}.
|
||||
*/
|
||||
static class SharedMetadataReaderFactoryBean
|
||||
implements FactoryBean<ConcurrentReferenceCachingMetadataReaderFactory>, BeanClassLoaderAware,
|
||||
implements FactoryBean<ConcurrentReferenceCachingMetadataReaderFactory>, ResourceLoaderAware,
|
||||
ApplicationListener<ContextRefreshedEvent> {
|
||||
|
||||
private ConcurrentReferenceCachingMetadataReaderFactory metadataReaderFactory;
|
||||
|
||||
@Override
|
||||
public void setBeanClassLoader(ClassLoader classLoader) {
|
||||
this.metadataReaderFactory = new ConcurrentReferenceCachingMetadataReaderFactory(classLoader);
|
||||
public void setResourceLoader(ResourceLoader resourceLoader) {
|
||||
this.metadataReaderFactory = new ConcurrentReferenceCachingMetadataReaderFactory(resourceLoader);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
Loading…
Reference in New Issue
Block a user