static interface LocalCache.ValueReference<K,V>
Modifier and Type | Method and Description |
---|---|
LocalCache.ValueReference<K,V> |
copyFor(java.lang.ref.ReferenceQueue<V> queue,
V value,
ReferenceEntry<K,V> entry)
Creates a copy of this reference for the given entry.
|
V |
get()
Returns the value.
|
ReferenceEntry<K,V> |
getEntry()
Returns the entry associated with this value reference, or
null if this value
reference is independent of any entry. |
int |
getWeight()
Returns the weight of this entry.
|
boolean |
isActive()
Returns true if this reference contains an active value, meaning one that is still considered
present in the cache.
|
boolean |
isLoading()
Returns true if a new value is currently loading, regardless of whether or not there is an
existing value.
|
void |
notifyNewValue(V newValue)
Notify pending loads that a new value was set.
|
V |
waitForValue()
Waits for a value that may still be loading.
|
V get()
V waitForValue() throws java.util.concurrent.ExecutionException
java.util.concurrent.ExecutionException
- if the loading thread throws an exceptionExecutionError
- if the loading thread throws an errorint getWeight()
ReferenceEntry<K,V> getEntry()
null
if this value
reference is independent of any entry.LocalCache.ValueReference<K,V> copyFor(java.lang.ref.ReferenceQueue<V> queue, V value, ReferenceEntry<K,V> entry)
value
may be null only for a loading reference.
void notifyNewValue(V newValue)
boolean isLoading()
boolean isActive()