Code example for Cache

Methods: sizestats

0
    protected abstract Cache<?, ?> getCache();
 
    private CacheStats getCachedCacheStats() {
        if (cache == null || nextLoad <= System.currentTimeMillis()) {
            cache = getCache();
            cacheStats = cache.stats();
            size = cache.size();
            nextLoad = System.currentTimeMillis() + loadIterval;
        } 
         
        return cacheStats;
    } 
 
    public final long getLoadIterval() { 
        return loadIterval;
    } 
 
    /** 
     * Number of milliseconds between calls to {@link CharacterDataEventImpl#getEventCacheStats()} 
     */