Package org.infinispan.util
Class EntryWrapper<K,V>
- java.lang.Object
-
- org.infinispan.container.entries.ForwardingCacheEntry<K,V>
-
- org.infinispan.util.EntryWrapper<K,V>
-
- Type Parameters:
K
- The key typeV
- The value type
- All Implemented Interfaces:
Cloneable
,Map.Entry<K,V>
,CacheEntry<K,V>
,MetadataAware
public class EntryWrapper<K,V> extends ForwardingCacheEntry<K,V>
Wrapper for CacheEntry(s) that can be used to update the cache when it's value is set.
-
-
Constructor Summary
Constructors Constructor Description EntryWrapper(Cache<K,V> cache, CacheEntry<K,V> entry)
Creates a new entry wrapper given the cache and entry.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected CacheEntry<K,V>
delegate()
V
setValue(V value)
Sets the value of the entry, returning the previous value-
Methods inherited from class org.infinispan.container.entries.ForwardingCacheEntry
clone, commit, equals, getCreated, getKey, getLastUsed, getLifespan, getMaxIdle, getMetadata, getValue, hashCode, isChanged, isCreated, isEvicted, isNull, isRemoved, setChanged, setCreated, setEvicted, setMetadata, setRemoved, setSkipLookup, skipLookup, toString
-
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.infinispan.container.entries.CacheEntry
commit, isLoaded, isValid, rollback, setCreated, setLastUsed, setLoaded, setValid, undelete
-
-
-
-
Constructor Detail
-
EntryWrapper
public EntryWrapper(Cache<K,V> cache, CacheEntry<K,V> entry)
Creates a new entry wrapper given the cache and entry. If the entry is itself an EntryWrapper then the inner entry is instead wrapped to prevent double cache.put operations. Also we then we can use the cache given as this could have different flags etc.- Parameters:
cache
- the cache to use on setValueentry
- the actual entry
-
-
Method Detail
-
delegate
protected CacheEntry<K,V> delegate()
- Specified by:
delegate
in classForwardingCacheEntry<K,V>
-
setValue
public V setValue(V value)
Description copied from interface:CacheEntry
Sets the value of the entry, returning the previous value
-
-