Class MetadataMortalCacheValue
- java.lang.Object
-
- org.infinispan.container.entries.ImmortalCacheValue
-
- org.infinispan.container.entries.metadata.MetadataMortalCacheValue
-
- All Implemented Interfaces:
Cloneable
,InternalCacheValue
,MetadataAware
- Direct Known Subclasses:
MetadataTransientMortalCacheValue
public class MetadataMortalCacheValue extends ImmortalCacheValue implements MetadataAware
A mortal cache value, to correspond withMetadataMortalCacheEntry
- Since:
- 5.1
- Author:
- Galder ZamarreƱo
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
MetadataMortalCacheValue.Externalizer
-
Field Summary
-
Fields inherited from class org.infinispan.container.entries.ImmortalCacheValue
value
-
-
Constructor Summary
Constructors Constructor Description MetadataMortalCacheValue(Object value, Metadata metadata, long created)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
canExpire()
long
getCreated()
long
getExpiryTime()
long
getLifespan()
Metadata
getMetadata()
Get metadata of this cache entry.boolean
isExpired()
boolean
isExpired(long now)
void
setMetadata(Metadata metadata)
Set the metadata in the cache entry.InternalCacheEntry
toInternalCacheEntry(Object key)
-
Methods inherited from class org.infinispan.container.entries.ImmortalCacheValue
clone, equals, getLastUsed, getMaxIdle, getValue, hashCode, setValue, toString
-
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.infinispan.container.entries.InternalCacheValue
isMaxIdleExpirable
-
-
-
-
Method Detail
-
toInternalCacheEntry
public InternalCacheEntry toInternalCacheEntry(Object key)
- Specified by:
toInternalCacheEntry
in interfaceInternalCacheValue
- Overrides:
toInternalCacheEntry
in classImmortalCacheValue
-
getMetadata
public Metadata getMetadata()
Description copied from interface:MetadataAware
Get metadata of this cache entry.- Specified by:
getMetadata
in interfaceInternalCacheValue
- Specified by:
getMetadata
in interfaceMetadataAware
- Overrides:
getMetadata
in classImmortalCacheValue
- 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
- Parameters:
metadata
- to apply to the cache entry
-
getCreated
public final long getCreated()
- Specified by:
getCreated
in interfaceInternalCacheValue
- Overrides:
getCreated
in classImmortalCacheValue
- Returns:
- timestamp when the entry was created
-
getLifespan
public final long getLifespan()
- Specified by:
getLifespan
in interfaceInternalCacheValue
- Overrides:
getLifespan
in classImmortalCacheValue
- Returns:
- lifespan of the value
-
isExpired
public boolean isExpired(long now)
- Specified by:
isExpired
in interfaceInternalCacheValue
- Overrides:
isExpired
in classImmortalCacheValue
- Parameters:
now
- the current time as expressed bySystem.currentTimeMillis()
- Returns:
- true if the entry has expired; false otherwise
-
isExpired
public boolean isExpired()
- Specified by:
isExpired
in interfaceInternalCacheValue
- Overrides:
isExpired
in classImmortalCacheValue
- Returns:
- true if the entry has expired; false otherwise
-
getExpiryTime
public long getExpiryTime()
- Specified by:
getExpiryTime
in interfaceInternalCacheValue
- Overrides:
getExpiryTime
in classImmortalCacheValue
-
canExpire
public final boolean canExpire()
- Specified by:
canExpire
in interfaceInternalCacheValue
- Overrides:
canExpire
in classImmortalCacheValue
- Returns:
- true if the entry can expire, false otherwise
-
-