Code example for Cache

Methods: cleanUpsizestats

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()} 
     */ 
    public final void setLoadIterval(long loadIterval) {
        this.loadIterval = loadIterval;
    } 
     
    public void cleanUp() { 
        getCachedCacheStats(); 
        cache.cleanUp();
    } 
 
    public final long getSize() { 
        getCachedCacheStats(); 
        return size;
Connect your IDE to all the code out there  Get Codota for Java