Interface ReadOnlyCacheEntryProcessor<K,V,R>
- Type Parameters:
K- the type of the keyV- the type of the valueR- the type of the result returned by the processor
- All Superinterfaces:
CacheEntryProcessor<K,V, R>
Cache entry processor that signals read-only intent.
ReadOnlyCacheEntryProcessor implementations do not modify the entry they process. The EntryProcessorExecutor optimizes for read-only processors by skipping expensive lock acquisition and providing a read-only view of the entry.
Attempting to call setValue or remove on the read-only entry will throw UnsupportedOperationException.
Usage:
ReadOnlyCacheEntryProcessorinvalid input: '<'String, Integer, Integer> reader = entry -> {
return entry.value();
};
Integer result = map.processEntry("key", reader);
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfaceReadonly marker interface for entries processed by read-only processors.Nested classes/interfaces inherited from interface CacheEntryProcessor
CacheEntryProcessor.Entry<K,V> -
Method Summary
Modifier and TypeMethodDescriptionprocess(CacheEntryProcessor.Entry<K, V> entry) Process the given read-only entry.
-
Method Details
-
process
Process the given read-only entry.Implementations must not attempt to call setValue or remove on the entry.
- Specified by:
processin interfaceCacheEntryProcessor<K,V, R> - Parameters:
entry- the read-only entry to process (must not be null)- Returns:
- the result of processing
- Throws:
UnsupportedOperationException- if setValue or remove is called
-