Java Code Examples for net.sf.ehcache.Cache#getTimeToIdleSeconds()

The following examples show how to use net.sf.ehcache.Cache#getTimeToIdleSeconds() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: EhcacheNonceVerifier.java    From openid4java with Apache License 2.0 5 votes vote down vote up
public void setCache(Cache cache)
{
    if (cache.getTimeToLiveSeconds() != _maxAgeSeconds)
    {
        throw new IllegalArgumentException("Max Age: " + _maxAgeSeconds + ", same expected for cache, but found: " + cache.getTimeToLiveSeconds());
    }

    if (cache.getTimeToLiveSeconds() != cache.getTimeToIdleSeconds())
    {
        throw new IllegalArgumentException("Cache must have same timeToLive (" + cache.getTimeToLiveSeconds() + ") as timeToIdle (" + cache.getTimeToIdleSeconds() + ")");
    }

    _cache = cache;
}
 
Example 2
Source File: AllCachesController.java    From olat with Apache License 2.0 5 votes vote down vote up
@Override
public Object getValueAt(final int row, final int col) {
    final String cname = cnames[row];
    final Cache c = cacheManager.getCache(cname);
    // todo: use Statistics stat = c.getStatistics();
    switch (col) {
    case 0:
        return cname;
    case 1:
        return c.isDiskPersistent() ? Boolean.TRUE : Boolean.FALSE;
    case 2:
        return new Long(c.getHitCount());
    case 3:
        return new Long(c.getMissCountExpired());
    case 4:
        return new Long(c.getMissCountNotFound());
    case 5:
        return new Long(c.getKeysNoDuplicateCheck().size());
    case 6:
        return new Long(c.getTimeToIdleSeconds());
    case 7:
        return new Long(c.getTimeToLiveSeconds());
    case 8:
        return new Long(c.getMaxElementsInMemory());
    default:
        throw new AssertException("nonexisting column:" + col);
    }
}
 
Example 3
Source File: AllCachesController.java    From olat with Apache License 2.0 5 votes vote down vote up
@Override
public Object getValueAt(final int row, final int col) {
    final String cname = cnames[row];
    final Cache c = cacheManager.getCache(cname);
    // todo: use Statistics stat = c.getStatistics();
    switch (col) {
    case 0:
        return cname;
    case 1:
        return c.isDiskPersistent() ? Boolean.TRUE : Boolean.FALSE;
    case 2:
        return new Long(c.getHitCount());
    case 3:
        return new Long(c.getMissCountExpired());
    case 4:
        return new Long(c.getMissCountNotFound());
    case 5:
        return new Long(c.getKeysNoDuplicateCheck().size());
    case 6:
        return new Long(c.getTimeToIdleSeconds());
    case 7:
        return new Long(c.getTimeToLiveSeconds());
    case 8:
        return new Long(c.getMaxElementsInMemory());
    default:
        throw new AssertException("nonexisting column:" + col);
    }
}