/** * Create a new CachingMetadataReaderFactory for the default class loader, * using a local resource cache. */ public CachingMetadataReaderFactory() { super(); setCacheLimit(DEFAULT_CACHE_LIMIT); }
/** * 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); }
/** * 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); } }
/** * Create a new CachingMetadataReaderFactory for the default class loader, * using a local resource cache. */ public CachingMetadataReaderFactory() { super(); setCacheLimit(DEFAULT_CACHE_LIMIT); }
/** * 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); }
/** * 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); } }
/** * Create a new CachingMetadataReaderFactory for the given {@link ResourceLoader}, * using a shared resource cache if supported or a local resource cache otherwise. * @param resourceLoader the Spring ResourceLoader to use * (also determines the ClassLoader to use) * @see DefaultResourceLoader#getResourceCache */ public CachingMetadataReaderFactory(@Nullable ResourceLoader resourceLoader) { super(resourceLoader); if (resourceLoader instanceof DefaultResourceLoader) { this.metadataReaderCache = ((DefaultResourceLoader) resourceLoader).getResourceCache(MetadataReader.class); } else { setCacheLimit(DEFAULT_CACHE_LIMIT); } }
/** * Create a new CachingMetadataReaderFactory for the given {@link ResourceLoader}, * using a shared resource cache if supported or a local resource cache otherwise. * @param resourceLoader the Spring ResourceLoader to use * (also determines the ClassLoader to use) * @see DefaultResourceLoader#getResourceCache */ public CachingMetadataReaderFactory(@Nullable ResourceLoader resourceLoader) { super(resourceLoader); if (resourceLoader instanceof DefaultResourceLoader) { this.metadataReaderCache = ((DefaultResourceLoader) resourceLoader).getResourceCache(MetadataReader.class); } else { setCacheLimit(DEFAULT_CACHE_LIMIT); } }
/** * Create a new CachingMetadataReaderFactory for the default class loader, * using a local resource cache. */ public CachingMetadataReaderFactory() { super(); setCacheLimit(DEFAULT_CACHE_LIMIT); }
/** * 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); }
/** * 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); } }
/** * Create a new CachingMetadataReaderFactory for the given {@link ResourceLoader}, * using a shared resource cache if supported or a local resource cache otherwise. * @param resourceLoader the Spring ResourceLoader to use * (also determines the ClassLoader to use) * @see DefaultResourceLoader#getResourceCache */ public CachingMetadataReaderFactory(@Nullable ResourceLoader resourceLoader) { super(resourceLoader); if (resourceLoader instanceof DefaultResourceLoader) { this.metadataReaderCache = ((DefaultResourceLoader) resourceLoader).getResourceCache(MetadataReader.class); } else { setCacheLimit(DEFAULT_CACHE_LIMIT); } }