@Test public void testSimpleCaseXMLNullEvicts() { CacheManager manager = new CacheManager(); manager.removalAll(); manager.shutdown(); CacheManager cacheManager = new CacheManager(getClass().getResourceAsStream ("/ehcache-refresh-ahead-simple.xml")); Ehcache decorator=cacheManager.getEhcache("testRefreshAhead2"); decorator.put(new Element(new Integer(1), new String("1"))); decorator.put(new Element(new Integer(2), new String("2"))); decorator.put(new Element(new Integer(3), new String("3"))); decorator.put(new Element(new Integer(4), new String("4"))); Element got = decorator.get(new Integer(1)); long creationTime = got.getCreationTime(); Assert.assertNotNull(got); sleepySeconds(1); got = decorator.get(new Integer(1)); Assert.assertNotNull(got); Assert.assertEquals(got.getCreationTime(), creationTime); sleepySeconds(7); got = decorator.get(new Integer(1)); Assert.assertNotNull(got); sleepySeconds(1); got = decorator.get(new Integer(1)); Assert.assertNull(got); cacheManager.shutdown(); }
@Override public Element get(Object key) throws IllegalStateException, CacheException { Element elem = super.get(key); possiblyTriggerRefresh(elem, refreshAheadConfig.getTimeToRefreshMillis()); return elem; }
RefreshAheadCache extends EhcacheDecoratorAdapter { @Override public Element get(Object key) throws IllegalStateException, CacheException { Element elem = super.get(key); possiblyTriggerRefresh(elem, refreshAheadConfig.getTimeToRefreshMillis()); return elem; } }
RefreshAheadCache extends EhcacheDecoratorAdapter { @Override public Element get(Object key) throws IllegalStateException, CacheException { Element elem = super.get(key); possiblyTriggerRefresh(elem, refreshAheadConfig.getTimeToRefreshMillis()); return elem; } RefreshAheadCache(Ehcache adaptedCache, RefreshAheadCacheConfiguration refreshConfig); }
RefreshAheadCache extends EhcacheDecoratorAdapter { @Override public Element get(Object key) throws IllegalStateException, CacheException { Element elem = super.get(key); possiblyTriggerRefresh(elem, refreshAheadConfig.getTimeToRefreshMillis()); return elem; } RefreshAheadCache(Ehcache adaptedCache, RefreshAheadCacheConfiguration refreshConfig); @Override Element get(Object key); @Override Element get(Serializable key); AtomicInteger getRefreshSuccessCount(); @Override String getName(); }
RefreshAheadCache extends EhcacheDecoratorAdapter { @Override public Element get(Object key) throws IllegalStateException, CacheException { Element elem = super.get(key); possiblyTriggerRefresh(elem, refreshAheadConfig.getTimeToRefreshMillis()); return elem; } RefreshAheadCache(Ehcache adaptedCache, RefreshAheadCacheConfiguration refreshConfig); @Override Element get(Object key); @Override Element get(Serializable key); AtomicInteger getRefreshSuccessCount(); @Override String getName();  }