public final class CacheImpl<K,V> extends Object implements Cache<K,V>
| Constructor and Description |
|---|
CacheImpl(CurrentTime currentTime,
long timeoutMillis)
Construct an expire-after-write cache.
|
@Inject public CacheImpl(CurrentTime currentTime, long timeoutMillis)
currentTime - class that returns the current time for timeout purposestimeoutMillis - a cache entry timeout after writepublic V get(K key, Callable<V> valueFetcher) throws ExecutionException
Cacheget in interface Cache<K,V>key - a keyvalueFetcher - a value fetcherExecutionExceptionpublic void invalidate(K key)
Cacheinvalidate in interface Cache<K,V>key - a keyCopyright © 2017 The Apache Software Foundation. All rights reserved.