/** * Returns the current size of the cache in bytes */ public Long getCurrentSize() { return (Long) boundedMultiLruCache.getStatByName( Constants.STAT_BOUNDEDMULTILRUCACHE_CURRENT_SIZE); }
/** * item value has been refreshed * @param item <code>CacheItem</code> that was refreshed * @param oldSize size of the previous value that was refreshed * Cache bucket is already synchronized by the caller */ protected void itemRefreshed(CacheItem item, int oldSize) { super.itemRefreshed(item, oldSize); /** reduce the cache by the size of the size of the previous value * and increment by the value being refreshed with. */ decrementCurrentSize(oldSize); incrementCurrentSize(item.getSize()); }
/** * item value has been removed from the cache * @param item <code>CacheItem</code> that was just removed * * Cache bucket is already synchronized by the caller */ protected void itemRemoved(CacheItem item) { super.itemRemoved(item); // update the size decrementCurrentSize(item.getSize()); }
/** * item value has been refreshed * @param item <code>CacheItem</code> that was refreshed * @param oldSize size of the previous value that was refreshed * Cache bucket is already synchronized by the caller */ protected void itemRefreshed(CacheItem item, int oldSize) { super.itemRefreshed(item, oldSize); /** reduce the cache by the size of the size of the previous value * and increment by the value being refreshed with. */ decrementCurrentSize(oldSize); incrementCurrentSize(item.getSize()); }
/** * item value has been removed from the cache * @param item <code>CacheItem</code> that was just removed * * Cache bucket is already synchronized by the caller */ protected void itemRemoved(CacheItem item) { super.itemRemoved(item); // update the size decrementCurrentSize(item.getSize()); }
/** * item value has been refreshed * @param item <code>CacheItem</code> that was refreshed * @param oldSize size of the previous value that was refreshed * Cache bucket is already synchronized by the caller */ protected void itemRefreshed(CacheItem item, int oldSize) { super.itemRefreshed(item, oldSize); /** reduce the cache by the size of the size of the previous value * and increment by the value being refreshed with. */ decrementCurrentSize(oldSize); incrementCurrentSize(item.getSize()); }
/** * Returns the current size of the cache in bytes */ public Long getCurrentSize() { return (Long) boundedMultiLruCache.getStatByName( Constants.STAT_BOUNDEDMULTILRUCACHE_CURRENT_SIZE); }
/** * item value has been removed from the cache * @param item <code>CacheItem</code> that was just removed * * Cache bucket is already synchronized by the caller */ protected void itemRemoved(CacheItem item) { super.itemRemoved(item); // update the size decrementCurrentSize(item.getSize()); }
/** * item value has been refreshed * @param item <code>CacheItem</code> that was refreshed * @param oldSize size of the previous value that was refreshed * Cache bucket is already synchronized by the caller */ protected void itemRefreshed(CacheItem item, int oldSize) { super.itemRefreshed(item, oldSize); /** reduce the cache by the size of the size of the previous value * and increment by the value being refreshed with. */ decrementCurrentSize(oldSize); incrementCurrentSize(item.getSize()); }
/** * Returns the current size of the cache in bytes */ public Long getCurrentSize() { return (Long) boundedMultiLruCache.getStatByName( Constants.STAT_BOUNDEDMULTILRUCACHE_CURRENT_SIZE); }
/** * item value has been removed from the cache * @param item <code>CacheItem</code> that was just removed * * Cache bucket is already synchronized by the caller */ protected void itemRemoved(CacheItem item) { super.itemRemoved(item); // update the size decrementCurrentSize(item.getSize()); }
/** * this item is just added to the cache * @param item <code>CacheItem</code> that was created * @return a overflow item; may be null * * Cache bucket is already synchronized by the caller */ protected CacheItem itemAdded(CacheItem item) { LruCacheItem overflow = (LruCacheItem) super.itemAdded(item); // update the size if (overflow != null) { decrementCurrentSize(overflow.getSize()); } incrementCurrentSize(item.getSize()); return overflow; }
/** * Returns the current size of the cache in bytes */ public Long getCurrentSize() { return (Long) boundedMultiLruCache.getStatByName( Constants.STAT_BOUNDEDMULTILRUCACHE_CURRENT_SIZE); }
/** * this item is just added to the cache * @param item <code>CacheItem</code> that was created * @return a overflow item; may be null * * Cache bucket is already synchronized by the caller */ protected CacheItem itemAdded(CacheItem item) { LruCacheItem overflow = (LruCacheItem) super.itemAdded(item); // update the size if (overflow != null) { decrementCurrentSize(overflow.getSize()); } incrementCurrentSize(item.getSize()); return overflow; }
/** * Returns the upper bound on the cache size */ public Long getMaxSize() { Object object = boundedMultiLruCache.getStatByName( Constants.STAT_BOUNDEDMULTILRUCACHE_MAX_SIZE); /* * BoundedMultiLruCache class returns java.lang.String with a value * "default" if the maxSize == Constants.DEFAULT_MAX_CACHE_SIZE * To take care of this case, the if/else is added below */ if (object instanceof String && ((String) object).equals(Constants.STAT_DEFAULT)) { return Long.valueOf(Constants.DEFAULT_MAX_CACHE_SIZE); } else { return (Long) object; } } }
/** * this item is just added to the cache * @param item <code>CacheItem</code> that was created * @return a overflow item; may be null * * Cache bucket is already synchronized by the caller */ protected CacheItem itemAdded(CacheItem item) { LruCacheItem overflow = (LruCacheItem) super.itemAdded(item); // update the size if (overflow != null) { decrementCurrentSize(overflow.getSize()); } incrementCurrentSize(item.getSize()); return overflow; }
/** * Returns the upper bound on the cache size */ public Long getMaxSize() { Object object = boundedMultiLruCache.getStatByName( Constants.STAT_BOUNDEDMULTILRUCACHE_MAX_SIZE); /* * BoundedMultiLruCache class returns java.lang.String with a value * "default" if the maxSize == Constants.DEFAULT_MAX_CACHE_SIZE * To take care of this case, the if/else is added below */ if (object instanceof String && ((String) object).equals(Constants.STAT_DEFAULT)) { return Long.valueOf(Constants.DEFAULT_MAX_CACHE_SIZE); } else { return (Long) object; } } }
/** * this item is just added to the cache * @param item <code>CacheItem</code> that was created * @return a overflow item; may be null * * Cache bucket is already synchronized by the caller */ protected CacheItem itemAdded(CacheItem item) { LruCacheItem overflow = (LruCacheItem) super.itemAdded(item); // update the size if (overflow != null) { decrementCurrentSize(overflow.getSize()); } incrementCurrentSize(item.getSize()); return overflow; }
/** * Returns the upper bound on the cache size */ public Long getMaxSize() { Object object = boundedMultiLruCache.getStatByName( Constants.STAT_BOUNDEDMULTILRUCACHE_MAX_SIZE); /* * BoundedMultiLruCache class returns java.lang.String with a value * "default" if the maxSize == Constants.DEFAULT_MAX_CACHE_SIZE * To take care of this case, the if/else is added below */ if (object instanceof String && ((String) object).equals(Constants.STAT_DEFAULT)) { return Long.valueOf(Constants.DEFAULT_MAX_CACHE_SIZE); } else { return (Long) object; } } }
/** * Returns the upper bound on the cache size */ public Long getMaxSize() { Object object = boundedMultiLruCache.getStatByName( Constants.STAT_BOUNDEDMULTILRUCACHE_MAX_SIZE); /* * BoundedMultiLruCache class returns java.lang.String with a value * "default" if the maxSize == Constants.DEFAULT_MAX_CACHE_SIZE * To take care of this case, the if/else is added below */ if (object instanceof String && ((String) object).equals(Constants.STAT_DEFAULT)) { return Long.valueOf(Constants.DEFAULT_MAX_CACHE_SIZE); } else { return (Long) object; } } }