Skip to content

Instantly share code, notes, and snippets.

@mblanc
mblanc / AsynchronousCache.java
Created June 7, 2011 12:14
Decorator of net.sf.ehcache.Ehcache. This class is an equivalent of an asynchronous net.sf.ehcache.constructs.blocking.SelfPopulatingCache. All cache entry of this cache will be eternal AND will have a timeToLive. When an element is "expired" (time of cr
package ...;
import java.util.HashMap;
import java.util.Map;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.Semaphore;
import java.util.concurrent.TimeUnit;
import net.sf.ehcache.CacheException;