Package org.cache2k.core.operation
Interface Semantic<K,V,R>
-
- All Known Implementing Classes:
Operations.ExpireEvent,Semantic.Base,Semantic.InsertOrUpdate,Semantic.MightUpdate,Semantic.Read,Semantic.Update
public interface Semantic<K,V,R>Defines the semantic of a cache operation based on Java code that examines the cached entry and callsProgressfor instructing the cache what needs to be done.- Author:
- Jens Wilke
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static classSemantic.Base<K,V,R>Base class to provide a default for the load result.static classSemantic.InsertOrUpdate<K,V,R>Only update the entry.static classSemantic.MightUpdate<K,V,R>Read a cache entry and do an optional mutation.static classSemantic.Read<K,V,R>Read only operation.static classSemantic.Update<K,V,R>Read a cache entry and do an mutation maybe based on the existing values.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidexamine(K key, Progress<K,V,R> c, ExaminationEntry<K,V> e)Called with the entry containing the recent content.voidloaded(K key, Progress<K,V,R> c, ExaminationEntry<K,V> e)Load is complete.voidmutate(K key, Progress<K,V,R> c, ExaminationEntry<K,V> e)Perform the mutation.voidstart(K key, Progress<K,V,R> c)Start of the operation.
-
-
-
Method Detail
-
start
void start(K key, Progress<K,V,R> c)
Start of the operation. Either callsProgress.wantData()orProgress.wantMutation(). AProgress.wantMutation()at the start means we don't need the current data and will mutate the entry unconditionally.
-
examine
void examine(K key, Progress<K,V,R> c, ExaminationEntry<K,V> e)
Called with the entry containing the recent content. If this method finishes withProgress.wantMutation()it will be called again after the entry is locked for mutation to reevaluate the examination after concurrent operations on the same entry have completed.
-
mutate
void mutate(K key, Progress<K,V,R> c, ExaminationEntry<K,V> e)
Perform the mutation. The mutation is done by calling the methods onProgress.
-
-