/** * Specify the maximum number of entries for the MetadataReader cache. * <p>Default is 256 for a local cache, whereas a shared cache is * typically unbounded. This method enforces a local resource cache, * even if the {@link ResourceLoader} supports a shared resource cache. */ public void setCacheLimit(int cacheLimit) { if (cacheLimit <= 0) { this.metadataReaderCache = null; } else if (this.metadataReaderCache instanceof LocalResourceCache) { ((LocalResourceCache) this.metadataReaderCache).setCacheLimit(cacheLimit); } else { this.metadataReaderCache = new LocalResourceCache(cacheLimit); } }
/** * Return the maximum number of entries for the MetadataReader cache. */ public int getCacheLimit() { if (this.metadataReaderCache instanceof LocalResourceCache) { return ((LocalResourceCache) this.metadataReaderCache).getCacheLimit(); } else { return (this.metadataReaderCache != null ? Integer.MAX_VALUE : 0); } }
@Override protected boolean removeEldestEntry(Map.Entry<Resource, MetadataReader> eldest) { return size() > this.cacheLimit; } }
/** * Specify the maximum number of entries for the MetadataReader cache. * <p>Default is 256 for a local cache, whereas a shared cache is * typically unbounded. This method enforces a local resource cache, * even if the {@link ResourceLoader} supports a shared resource cache. */ public void setCacheLimit(int cacheLimit) { if (cacheLimit <= 0) { this.metadataReaderCache = null; } else if (this.metadataReaderCache instanceof LocalResourceCache) { ((LocalResourceCache) this.metadataReaderCache).setCacheLimit(cacheLimit); } else { this.metadataReaderCache = new LocalResourceCache(cacheLimit); } }
/** * Return the maximum number of entries for the MetadataReader cache. */ public int getCacheLimit() { if (this.metadataReaderCache instanceof LocalResourceCache) { return ((LocalResourceCache) this.metadataReaderCache).getCacheLimit(); } else { return (this.metadataReaderCache != null ? Integer.MAX_VALUE : 0); } }
@Override protected boolean removeEldestEntry(Map.Entry<Resource, MetadataReader> eldest) { return size() > this.cacheLimit; } }
/** * Specify the maximum number of entries for the MetadataReader cache. * <p>Default is 256 for a local cache, whereas a shared cache is * typically unbounded. This method enforces a local resource cache, * even if the {@link ResourceLoader} supports a shared resource cache. */ public void setCacheLimit(int cacheLimit) { if (cacheLimit <= 0) { this.metadataReaderCache = null; } else if (this.metadataReaderCache instanceof LocalResourceCache) { ((LocalResourceCache) this.metadataReaderCache).setCacheLimit(cacheLimit); } else { this.metadataReaderCache = new LocalResourceCache(cacheLimit); } }
@Override protected boolean removeEldestEntry(Map.Entry<Resource, MetadataReader> eldest) { return size() > this.cacheLimit; } }
/** * Return the maximum number of entries for the MetadataReader cache. */ public int getCacheLimit() { if (this.metadataReaderCache instanceof LocalResourceCache) { return ((LocalResourceCache) this.metadataReaderCache).getCacheLimit(); } else { return (this.metadataReaderCache != null ? Integer.MAX_VALUE : 0); } }