/** * Sets the maximum objects to be held in local heap memory (0 = no limit). * <p> * This property can be modified dynamically while the cache is operating. * * @param maxEntriesLocalHeap The maximum number of elements in memory, before they are evicted (0 == no limit) */ public final void setMaxEntriesLocalHeap(long maxEntriesLocalHeap) { verifyGreaterThanOrEqualToZero(maxEntriesLocalHeap, "maxEntriesLocalHeap"); if (maxEntriesLocalHeap > Integer.MAX_VALUE) { throw new IllegalArgumentException("Values larger than Integer.MAX_VALUE are not currently supported."); } checkDynamicChange(); if (onHeapPoolUsage != null && onHeapPoolUsage != PoolUsage.None) { throw new InvalidConfigurationException("MaxEntriesLocalHeap is not compatible with " + "MaxBytesLocalHeap set on cache"); } int oldCapacity = this.maxEntriesLocalHeap == null ? 0 : this.maxEntriesLocalHeap; int newCapacity = (int) maxEntriesLocalHeap; this.maxEntriesLocalHeap = (int) maxEntriesLocalHeap; fireMemoryCapacityChanged(oldCapacity, newCapacity); }
/** * Sets the maximum objects to be held in local heap memory (0 = no limit). * <p> * This property can be modified dynamically while the cache is operating. * * @param maxEntriesLocalHeap The maximum number of elements in memory, before they are evicted (0 == no limit) */ public final void setMaxEntriesLocalHeap(long maxEntriesLocalHeap) { verifyGreaterThanOrEqualToZero(maxEntriesLocalHeap, "maxEntriesLocalHeap"); if (maxEntriesLocalHeap > Integer.MAX_VALUE) { throw new IllegalArgumentException("Values larger than Integer.MAX_VALUE are not currently supported."); } checkDynamicChange(); if (onHeapPoolUsage != null && onHeapPoolUsage != PoolUsage.None) { throw new InvalidConfigurationException("MaxEntriesLocalHeap is not compatible with " + "MaxBytesLocalHeap set on cache"); } int oldCapacity = this.maxEntriesLocalHeap == null ? 0 : this.maxEntriesLocalHeap; int newCapacity = (int) maxEntriesLocalHeap; this.maxEntriesLocalHeap = (int) maxEntriesLocalHeap; fireMemoryCapacityChanged(oldCapacity, newCapacity); }
/** * Sets the maximum objects to be held in local heap memory (0 = no limit). * <p/> * This property can be modified dynamically while the cache is operating. * * @param maxEntriesLocalHeap The maximum number of elements in memory, before they are evicted (0 == no limit) */ public final void setMaxEntriesLocalHeap(long maxEntriesLocalHeap) { verifyGreaterThanOrEqualToZero(maxEntriesLocalHeap, "maxEntriesLocalHeap"); if (maxEntriesLocalHeap > Integer.MAX_VALUE) { throw new IllegalArgumentException("Values larger than Integer.MAX_VALUE are not currently supported."); } checkDynamicChange(); if (onHeapPoolUsage != null && onHeapPoolUsage != PoolUsage.None) { throw new InvalidConfigurationException("MaxEntriesLocalHeap is not compatible with " + "MaxBytesLocalHeap set on cache"); } int oldCapacity = this.maxEntriesLocalHeap == null ? 0 : this.maxEntriesLocalHeap; int newCapacity = (int) maxEntriesLocalHeap; this.maxEntriesLocalHeap = (int) maxEntriesLocalHeap; fireMemoryCapacityChanged(oldCapacity, newCapacity); }
/** * Sets the maximum objects to be held in local heap memory (0 = no limit). * <p/> * This property can be modified dynamically while the cache is operating. * * @param maxEntriesInMemory The maximum number of elements in memory, before they are evicted (0 == no limit) */ public final void setMaxEntriesLocalHeap(long maxEntriesInMemory) { if (maxEntriesInMemory < 0) { throw new InvalidConfigurationException("Number of entries on local heap cannot be negative"); } if (maxEntriesInMemory > Integer.MAX_VALUE) { throw new IllegalArgumentException("Values larger than Integer.MAX_VALUE are not currently supported."); } checkDynamicChange(); if (onHeapPoolUsage != null && onHeapPoolUsage != PoolUsage.None) { throw new InvalidConfigurationException("MaxEntriesLocalHeap is not compatible with " + "MaxBytesLocalHeap set on cache"); } int oldCapacity = maxEntriesLocalHeap == null ? 0 : maxEntriesLocalHeap; int newCapacity = (int) maxEntriesInMemory; this.maxEntriesLocalHeap = (int) maxEntriesInMemory; fireMemoryCapacityChanged(oldCapacity, newCapacity); }