public void setMaxCapacity(int maxCapacity) { if (maxCapacity < 100) { maxCapacity = 100; } this.maxCapacity = maxCapacity; init(); } }
@Override public void put(final MetadataItem metadataItem) { super.put(metadataItem); cachePuts++; }
@Override public void evictAll() { synchronized (lock) { // Clear my own cache super.evictAll(); // Clear the caches of any metadata providers which support the // interface for (final MetadataProvider p : providers) { if (p instanceof MetadataCache) { ((MetadataCache) p).evictAll(); } } } }
@Override public void evict(final String metadataIdentificationString) { synchronized (lock) { // Clear my own cache (which also verifies the argument is valid at // the same time) super.evict(metadataIdentificationString); // Finally, evict downstream dependencies (ie metadata that // previously depended on this now-evicted metadata) MetadataDependencyRegistry registry = this.registryTracker.getService(); for (final String downstream : registry.getDownstream(metadataIdentificationString)) { // We only need to evict if it is an instance, as only an // instance will ever go into the cache if (MetadataIdentificationUtils.isIdentifyingInstance(downstream)) { evict(downstream); } } } }
protected AbstractMetadataCache() { init(); }
metadataLogger.log("Caching " + metadataIdentificationString); super.put(result); cachePuts++;
public void evictAll() { init(); }