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 org.cache2k.event.CacheEntryCreatedListener<K,V>[] |
entryCreatedListeners()
Provide the registered listeners for entry creation.
|
protected org.cache2k.event.CacheEntryExpiredListener<K,V>[] |
entryExpiredListeners() |
protected org.cache2k.event.CacheEntryRemovedListener<K,V>[] |
entryRemovedListeners()
Provide the registered listeners for entry removal.
|
void |
entryResult(ExaminationEntry e)
Returns a cache entry as result.
|
protected org.cache2k.event.CacheEntryUpdatedListener<K,V>[] |
entryUpdatedListeners()
Provide the registered listeners for entry update.
|
void |
examinationAbort(org.cache2k.CustomizationException t) |
void |
examine() |
void |
expire(long expiryTime)
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() |
long |
getCurrentTime()
The current time in millis or the value when it was first called.
|
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 org.cache2k.integration.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,
org.cache2k.integration.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 expiryTime,
long refreshTime)
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() |
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 org.cache2k.integration.CacheWriter<K,V> |
writer()
Provide the writer, default null.
|
protected org.cache2k.integration.AdvancedCacheLoader<K,V> loader()
protected CommonMetrics.Updater metrics()
protected org.cache2k.integration.CacheWriter<K,V> writer()
protected boolean mightHaveListeners()
protected org.cache2k.event.CacheEntryCreatedListener<K,V>[] entryCreatedListeners()
protected org.cache2k.event.CacheEntryUpdatedListener<K,V>[] entryUpdatedListeners()
protected org.cache2k.event.CacheEntryRemovedListener<K,V>[] entryRemovedListeners()
protected org.cache2k.event.CacheEntryExpiredListener<K,V>[] entryExpiredListeners()
protected abstract TimingHandler<K,V> timing()
public long getCurrentTime()
ProgressgetCurrentTime in interface Progress<K,V,R>public boolean isPresent()
Progresspublic boolean isPresentOrInRefreshProbation()
ProgressProgress.isPresent() but also true if the entry is in refresh probation.isPresentOrInRefreshProbation in interface Progress<K,V,R>public boolean isPresentOrMiss()
ProgressisPresentOrMiss in interface Progress<K,V,R>public void wantData()
ProgressSemantic.examine(Progress, ExaminationEntry)public void retrieveDataFromHeap()
public void heapMiss()
public void examine()
public void wantMutation()
ProgressSemantic.update(Progress, ExaminationEntry)wantMutation in interface Progress<K,V,R>public void finish()
public void loadAndMutation()
ProgressloadAndMutation in interface Progress<K,V,R>public void refresh()
Progresspublic void load()
ProgressSemantic.Basepublic 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)
Progresspublic void entryResult(ExaminationEntry e)
ProgressentryResult in interface Progress<K,V,R>public RuntimeException propagateException(K key, org.cache2k.integration.ExceptionInformation inf)
ProgresspropagateException in interface Progress<K,V,R>public void put(V value)
Progresspublic void remove()
Progresspublic void expire(long expiryTime)
Progresspublic void putAndSetExpiry(V value, long expiryTime, long refreshTime)
ProgressputAndSetExpiry 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.Callbackpublic void onWriteFailure(Throwable t)
onWriteFailure in interface AsyncCacheWriter.Callbackpublic 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(org.cache2k.CustomizationException t)
public void mutationAbort(RuntimeException t)
public void mutationDone()
public void noMutationRequested()
public void ready()
cache2k API documentation. Copyright © 2000–2019 headissue GmbH, Munich.