Example usage for org.apache.commons.jcs.engine.stats.behavior ICacheStats getAuxiliaryCacheStats

List of usage examples for org.apache.commons.jcs.engine.stats.behavior ICacheStats getAuxiliaryCacheStats

Introduction

In this page you can find the example usage for org.apache.commons.jcs.engine.stats.behavior ICacheStats getAuxiliaryCacheStats.

Prototype

List<IStats> getAuxiliaryCacheStats();

Source Link

Usage

From source file:org.openstreetmap.josm.gui.preferences.imagery.CacheContentsPanel.java

private static Long getCacheSize(CacheAccess<String, BufferedImageCacheEntry> cache) {
    ICacheStats stats = cache.getStatistics();
    for (IStats cacheStats : stats.getAuxiliaryCacheStats()) {
        for (IStatElement<?> statElement : cacheStats.getStatElements()) {
            if ("Data File Length".equals(statElement.getName())) {
                Object val = statElement.getData();
                if (val instanceof Long) {
                    return (Long) val;
                }//from w w w. j av  a  2 s.com
            }
        }
    }
    return Long.valueOf(-1);
}