public abstract class EntryAction<K,V,R> extends Object implements AsyncCacheLoader.Callback<V>, AsyncCacheWriter.Callback, Progress<K,V,R>
Modifier and Type | Class and Description |
---|---|
static class |
EntryAction.ListenerException |
static class |
EntryAction.ProcessingFailureException |
static class |
EntryAction.StorageReadException |
static class |
EntryAction.StorageWriteException |
Constructor and Description |
---|
EntryAction(HeapCache<K,V> _heapCache,
InternalCache<K,V> _userCache,
Semantic<K,V,R> op,
K k,
Entry<K,V> e) |
Modifier and Type | Method and Description |
---|---|
void |
callListeners() |
void |
checkKeepOrRemove()
In case we have a expiry of 0, this means that the entry should
not be cached.
|
protected CacheEntryCreatedListener<K,V>[] |
entryCreatedListeners()
Provide the registered listeners for entry creation.
|
protected CacheEntryExpiredListener<K,V>[] |
entryExpiredListeners() |
protected CacheEntryRemovedListener<K,V>[] |
entryRemovedListeners()
Provide the registered listeners for entry removal.
|
void |
entryResult(ExaminationEntry e)
Returns a cache entry as result.
|
protected CacheEntryUpdatedListener<K,V>[] |
entryUpdatedListeners()
Provide the registered listeners for entry update.
|
void |
examinationAbort(CustomizationException t) |
void |
examine() |
void |
expire(long t)
Reset expiry to the specified value.
|
void |
expiredImmediatelyAndRemove() |
void |
expiredImmediatelyKeepData() |
void |
expiryCalculated() |
void |
expiryCalculationException(Throwable t) |
void |
failure(RuntimeException t)
Failure call on Progress from Semantic.
|
void |
finish() |
InternalClock |
getClock() |
void |
heapHit(Entry<K,V> e) |
void |
heapMiss() |
boolean |
isPresent()
Entry has valid data in the cache and is not expired.
|
boolean |
isPresentOrInRefreshProbation()
Same as
Progress.isPresent() but also true if the entry is in refresh probation. |
boolean |
isPresentOrMiss()
Entry has valid data in the cache and is not expired.
|
void |
load()
Request that the entry value gets loaded from loader.
|
void |
loadAndExpiryCalculatedMutateAgain() |
void |
loadAndMutation()
Request a load, however call update again for the final outcome.
|
void |
loadCompleted() |
protected AdvancedCacheLoader<K,V> |
loader()
Provide the cache loader, if present.
|
protected CommonMetrics.Updater |
metrics()
Provide the standard metrics for updating.
|
protected boolean |
mightHaveListeners()
True if there is any listener defined.
|
void |
mutationAbort(RuntimeException t) |
void |
mutationCalculateExpiry() |
void |
mutationDone() |
void |
mutationMayCallWriter()
Entry mutation, call writer if needed or skip to
mutationMayStore() |
void |
mutationMayStore()
Entry mutation, call storage if needed
|
void |
mutationReleaseLockAndStartTimer() |
void |
mutationUpdateHeap() |
void |
noMutationRequested() |
void |
onLoadFailure(Throwable t) |
void |
onLoadSuccess(V value) |
void |
onWriteFailure(Throwable t) |
void |
onWriteSuccess() |
RuntimeException |
propagateException(K key,
ExceptionInformation inf)
Needed for the mutable entry getValue() to throw an exception.
|
void |
put(V value)
Update the entry with the new value.
|
void |
putAndSetExpiry(V value,
long t)
Set new value, skip expiry calculation and set expiry time directly.
|
void |
ready() |
void |
refresh()
Same as load but counting statistics as refresh.
|
void |
remove()
The entry will be removed.
|
void |
result(R r)
Sets the operation result.
|
void |
retrieveDataFromHeap() |
void |
reviveRefreshedEntry(long nrt) |
void |
skipStore() |
void |
skipWritingForException() |
void |
skipWritingNoWriter() |
void |
storageReadHit(StorageEntry se) |
protected abstract TimingHandler<K,V> |
timing() |
void |
updateDidNotTriggerDifferentMutationStoreLoadedValue() |
void |
updateMutationStatistics() |
void |
updateOnlyReadStatistics() |
void |
wantData()
Requests that the cache content for an entry will be provided.
|
void |
wantMutation()
The entry gets locked for mutation.
|
protected CacheWriter<K,V> |
writer()
Provide the writer, default null.
|
protected AdvancedCacheLoader<K,V> loader()
protected CommonMetrics.Updater metrics()
protected CacheWriter<K,V> writer()
protected boolean mightHaveListeners()
protected CacheEntryCreatedListener<K,V>[] entryCreatedListeners()
protected CacheEntryUpdatedListener<K,V>[] entryUpdatedListeners()
protected CacheEntryRemovedListener<K,V>[] entryRemovedListeners()
protected CacheEntryExpiredListener<K,V>[] entryExpiredListeners()
protected abstract TimingHandler<K,V> timing()
public boolean isPresent()
Progress
public boolean isPresentOrInRefreshProbation()
Progress
Progress.isPresent()
but also true if the entry is in refresh probation.isPresentOrInRefreshProbation
in interface Progress<K,V,R>
public boolean isPresentOrMiss()
Progress
isPresentOrMiss
in interface Progress<K,V,R>
public void wantData()
Progress
Semantic.examine(Progress, ExaminationEntry)
public void retrieveDataFromHeap()
public void storageReadHit(StorageEntry se)
public void heapMiss()
public void examine()
public void wantMutation()
Progress
Semantic.update(Progress, ExaminationEntry)
wantMutation
in interface Progress<K,V,R>
public void finish()
public void loadAndMutation()
Progress
loadAndMutation
in interface Progress<K,V,R>
public void refresh()
Progress
public void load()
Progress
Semantic.Base
public void reviveRefreshedEntry(long nrt)
public void onLoadSuccess(V value)
onLoadSuccess
in interface AsyncCacheLoader.Callback<V>
public void onLoadFailure(Throwable t)
onLoadFailure
in interface AsyncCacheLoader.Callback<V>
public void loadCompleted()
public void result(R r)
Progress
public void entryResult(ExaminationEntry e)
Progress
entryResult
in interface Progress<K,V,R>
public RuntimeException propagateException(K key, ExceptionInformation inf)
Progress
propagateException
in interface Progress<K,V,R>
public void put(V value)
Progress
public void remove()
Progress
public void expire(long t)
Progress
public void putAndSetExpiry(V value, long t)
Progress
putAndSetExpiry
in interface Progress<K,V,R>
public void mutationCalculateExpiry()
public void expiryCalculationException(Throwable t)
public void expiryCalculated()
public void loadAndExpiryCalculatedMutateAgain()
public void updateDidNotTriggerDifferentMutationStoreLoadedValue()
public void mutationMayCallWriter()
mutationMayStore()
public void onWriteSuccess()
onWriteSuccess
in interface AsyncCacheWriter.Callback
public void onWriteFailure(Throwable t)
onWriteFailure
in interface AsyncCacheWriter.Callback
public void skipWritingForException()
public void skipWritingNoWriter()
public void checkKeepOrRemove()
public void expiredImmediatelyKeepData()
public void expiredImmediatelyAndRemove()
public void mutationUpdateHeap()
public void mutationMayStore()
public void skipStore()
public void callListeners()
public void mutationReleaseLockAndStartTimer()
public void updateMutationStatistics()
public void updateOnlyReadStatistics()
public void failure(RuntimeException t)
public void examinationAbort(CustomizationException t)
public void mutationAbort(RuntimeException t)
public void mutationDone()
public void noMutationRequested()
public void ready()
cache2k API documentation. Copyright © 2000–2018 headissue GmbH, Munich.