@Override public void setBeanClassLoader(ClassLoader beanClassLoader) { this.beanClassLoader = beanClassLoader; if (!this.setMetadataReaderFactoryCalled) { this.metadataReaderFactory = new CachingMetadataReaderFactory(beanClassLoader); } }
/** * Clear the local metadata cache, if any, removing all cached class metadata. */ public void clearCache() { if (this.metadataReaderFactory instanceof CachingMetadataReaderFactory) { // Clear cache in externally provided MetadataReaderFactory; this is a no-op // for a shared cache since it'll be cleared by the ApplicationContext. ((CachingMetadataReaderFactory) this.metadataReaderFactory).clearCache(); } }
/** * Create a new CachingMetadataReaderFactory for the default class loader, * using a local resource cache. */ public CachingMetadataReaderFactory() { super(); setCacheLimit(DEFAULT_CACHE_LIMIT); }
MetadataReader metadataReader = new CachingMetadataReaderFactory(new PathMatchingResourcePatternResolver()).getMetadataReader(resource); Class<?> clazz = Class.forName(metadataReader.getClassMetadata().getClassName()); modelClasses.add(clazz);
MetadataReader metadataReader = new CachingMetadataReaderFactory(new PathMatchingResourcePatternResolver()).getMetadataReader(resource); Class<?> clazz = Class.forName(metadataReader.getClassMetadata().getClassName()); processRestControllerClass(clazz);
/** * Return the MetadataReaderFactory used by this component provider. */ public final MetadataReaderFactory getMetadataReaderFactory() { if (this.metadataReaderFactory == null) { this.metadataReaderFactory = new CachingMetadataReaderFactory(); } return this.metadataReaderFactory; }
/** * Clear the local metadata cache, if any, removing all cached class metadata. */ public void clearCache() { if (this.metadataReaderFactory instanceof CachingMetadataReaderFactory) { // Clear cache in externally provided MetadataReaderFactory; this is a no-op // for a shared cache since it'll be cleared by the ApplicationContext. ((CachingMetadataReaderFactory) this.metadataReaderFactory).clearCache(); } }
/** * Create a new CachingMetadataReaderFactory for the given {@link ClassLoader}, * using a local resource cache. * @param classLoader the ClassLoader to use */ public CachingMetadataReaderFactory(@Nullable ClassLoader classLoader) { super(classLoader); setCacheLimit(DEFAULT_CACHE_LIMIT); }
@Override public void setResourceLoader(ResourceLoader resourceLoader) { Assert.notNull(resourceLoader, "ResourceLoader must not be null"); this.resourceLoader = resourceLoader; if (!this.setMetadataReaderFactoryCalled) { this.metadataReaderFactory = new CachingMetadataReaderFactory(resourceLoader); } }
((CachingMetadataReaderFactory) this.metadataReaderFactory).clearCache();
/** * Clear the local MetadataReader cache, if any, removing all cached class metadata. */ public void clearCache() { if (this.metadataReaderCache instanceof LocalResourceCache) { synchronized (this.metadataReaderCache) { this.metadataReaderCache.clear(); } } else if (this.metadataReaderCache != null) { // Shared resource cache -> reset to local cache. setCacheLimit(DEFAULT_CACHE_LIMIT); } }
@Override public void setBeanClassLoader(ClassLoader beanClassLoader) { this.beanClassLoader = beanClassLoader; if (!this.setMetadataReaderFactoryCalled) { this.metadataReaderFactory = new CachingMetadataReaderFactory(beanClassLoader); } }
((CachingMetadataReaderFactory) this.metadataReaderFactory).clearCache();
/** * Create a new CachingMetadataReaderFactory for the default class loader, * using a local resource cache. */ public CachingMetadataReaderFactory() { super(); setCacheLimit(DEFAULT_CACHE_LIMIT); }
/** * Return the MetadataReaderFactory used by this component provider. */ public final MetadataReaderFactory getMetadataReaderFactory() { if (this.metadataReaderFactory == null) { this.metadataReaderFactory = new CachingMetadataReaderFactory(); } return this.metadataReaderFactory; }
public void clearCache() { if ( metadataReaderFactory instanceof CachingMetadataReaderFactory ) { ( (CachingMetadataReaderFactory) metadataReaderFactory ).clearCache(); } } }
/** * Create a new CachingMetadataReaderFactory for the given {@link ClassLoader}, * using a local resource cache. * @param classLoader the ClassLoader to use */ public CachingMetadataReaderFactory(@Nullable ClassLoader classLoader) { super(classLoader); setCacheLimit(DEFAULT_CACHE_LIMIT); }
@Override public void setResourceLoader(ResourceLoader resourceLoader) { Assert.notNull(resourceLoader, "ResourceLoader must not be null"); this.resourceLoader = resourceLoader; if (!this.setMetadataReaderFactoryCalled) { this.metadataReaderFactory = new CachingMetadataReaderFactory(resourceLoader); } }
/** * Clear the local metadata cache, if any, removing all cached class metadata. */ public void clearCache() { if (this.metadataReaderFactory instanceof CachingMetadataReaderFactory) { // Clear cache in externally provided MetadataReaderFactory; this is a no-op // for a shared cache since it'll be cleared by the ApplicationContext. ((CachingMetadataReaderFactory) this.metadataReaderFactory).clearCache(); } }
/** * Clear the local MetadataReader cache, if any, removing all cached class metadata. */ public void clearCache() { if (this.metadataReaderCache instanceof LocalResourceCache) { synchronized (this.metadataReaderCache) { this.metadataReaderCache.clear(); } } else if (this.metadataReaderCache != null) { // Shared resource cache -> reset to local cache. setCacheLimit(DEFAULT_CACHE_LIMIT); } }