| Constructor and Description |
|---|
ConcurrentCacheAtom(Callable<V> loader,
long ttlInMs,
CacheStats stats) |
| Modifier and Type | Method and Description |
|---|---|
V |
call() |
V |
get()
Returns the cached value, recalculating/reloading it if expired.
|
AtomicLong |
getErrors() |
AtomicLong |
getHits() |
V |
getIfExists()
Retrieves the cached value if it exists, or
null otherwise. |
AtomicLong |
getMisses() |
void |
invalidate()
Invalidates the cached value.
|
void |
set(V value)
Sets a new cached value.
|
String |
toString() |
public ConcurrentCacheAtom(Callable<V> loader, long ttlInMs, CacheStats stats)
public V get()
public V getIfExists()
null otherwise.getIfExists in interface CacheAtom<V>public void invalidate()
invalidate in interface CacheAtom<V>public AtomicLong getHits()
public AtomicLong getMisses()
public AtomicLong getErrors()
Copyright © 2014–2017 Nikolche Mihajlovski and contributors. All rights reserved.