I plan to implement a caching solution in an existing web application. Nothing complicated: basically a parallel card that supports disk overflow and automatic eviction. Clustering the cache may be required in the future, but not now.
I like the ehcache functions copyOnRead and copyOnWrite because it means I donβt have to manually clone things before changing anything that I take out of the cache. Now I started watching Infinispan , but I did not find anything equivalent there. He exists?
Ie must pass the following unit tests:
@Test public void testCopyOnWrite() { Date date = new Date(0); cache.put(0, date); date.setTime(1000); date = cache.get(0); assertEquals(0, date.getTime()); } @Test public void testCopyOnRead() { Date date = new Date(0); cache.put(0, date); assertNotSame(cache.get(0), cache.get(0)); }
source share