Class MetadataImmortalCacheEntry
- java.lang.Object
-
- org.infinispan.container.entries.AbstractInternalCacheEntry
-
- org.infinispan.container.entries.ImmortalCacheEntry
-
- org.infinispan.container.entries.metadata.MetadataImmortalCacheEntry
-
- All Implemented Interfaces:
Cloneable
,Map.Entry
,CacheEntry
,InternalCacheEntry
,MetadataAware
public class MetadataImmortalCacheEntry extends ImmortalCacheEntry implements MetadataAware
A form ofImmortalCacheEntry
that isMetadataAware
- Since:
- 5.3
- Author:
- Galder ZamarreƱo
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
MetadataImmortalCacheEntry.Externalizer
-
Field Summary
Fields Modifier and Type Field Description protected Metadata
metadata
-
Fields inherited from class org.infinispan.container.entries.ImmortalCacheEntry
value
-
Fields inherited from class org.infinispan.container.entries.AbstractInternalCacheEntry
key
-
-
Constructor Summary
Constructors Constructor Description MetadataImmortalCacheEntry(Object key, Object value, Metadata metadata)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Metadata
getMetadata()
Get metadata of this cache entry.void
setMetadata(Metadata metadata)
Set the metadata in the cache entry.InternalCacheValue
toInternalCacheValue()
Creates a representation of this entry as anInternalCacheValue
.String
toString()
-
Methods inherited from class org.infinispan.container.entries.ImmortalCacheEntry
canExpire, clone, getCreated, getExpiryTime, getLastUsed, getLifespan, getMaxIdle, getValue, isExpired, isExpired, reincarnate, reincarnate, setValue, touch, touch
-
Methods inherited from class org.infinispan.container.entries.AbstractInternalCacheEntry
commit, equals, getKey, hashCode, isChanged, isCreated, isEvicted, isL1Entry, isNull, isRemoved, setChanged, setCreated, setEvicted, setRemoved, setSkipLookup, skipLookup
-
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
-
Methods inherited from interface org.infinispan.container.entries.InternalCacheEntry
canExpireMaxIdle
-
-
-
-
Field Detail
-
metadata
protected Metadata metadata
-
-
Method Detail
-
getMetadata
public Metadata getMetadata()
Description copied from interface:MetadataAware
Get metadata of this cache entry.- Specified by:
getMetadata
in interfaceMetadataAware
- Overrides:
getMetadata
in classImmortalCacheEntry
- Returns:
- a Metadata instance
-
setMetadata
public void setMetadata(Metadata metadata)
Description copied from interface:MetadataAware
Set the metadata in the cache entry.- Specified by:
setMetadata
in interfaceMetadataAware
- Overrides:
setMetadata
in classImmortalCacheEntry
- Parameters:
metadata
- to apply to the cache entry
-
toInternalCacheValue
public InternalCacheValue toInternalCacheValue()
Description copied from interface:InternalCacheEntry
Creates a representation of this entry as anInternalCacheValue
. The main purpose of this is to provide a representation that does not have a reference to the key. This is useful in situations where the key is already known or stored elsewhere, making serialization and deserialization more efficient. Note that this should not be used to optimize memory overhead, since the saving of an additional reference to a key (a single object reference) does not warrant the cost of constructing an InternalCacheValue. This only makes sense when marshalling is involved, since the cost of marshalling the key again can be sidestepped using an InternalCacheValue if the key is already known/marshalled.- Specified by:
toInternalCacheValue
in interfaceInternalCacheEntry
- Overrides:
toInternalCacheValue
in classImmortalCacheEntry
- Returns:
- a new InternalCacheValue encapsulating this InternalCacheEntry's value and expiration information.
-
toString
public String toString()
- Overrides:
toString
in classImmortalCacheEntry
-
-