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
A mortal cache value, to correspond with
MetadataMortalCacheEntry
- Since:
- 5.1
- Author:
- Galder ZamarreƱo
-
Nested Class Summary
-
Field Summary
Fields inherited from class org.infinispan.container.entries.ImmortalCacheValue
internalMetadata, value
-
Constructor Summary
ModifierConstructorDescriptionprotected
MetadataMortalCacheValue
(Object value, PrivateMetadata internalMetadata, Metadata metadata, long created) MetadataMortalCacheValue
(Object value, Metadata metadata, long created) -
Method Summary
Modifier and TypeMethodDescriptionprotected void
appendFieldsToString
(StringBuilder builder) final boolean
final long
long
final long
Get metadata of this cache entry.boolean
isExpired
(long now) void
setMetadata
(Metadata metadata) Set the metadata in the cache entry.InternalCacheEntry<?,
?> Methods inherited from class org.infinispan.container.entries.ImmortalCacheValue
clone, equals, getInternalMetadata, getLastUsed, getMaxIdle, getValue, hashCode, setInternalMetadata, 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
-
Constructor Details
-
MetadataMortalCacheValue
-
MetadataMortalCacheValue
protected MetadataMortalCacheValue(Object value, PrivateMetadata internalMetadata, Metadata metadata, long created)
-
-
Method Details
-
toInternalCacheEntry
- Specified by:
toInternalCacheEntry
in interfaceInternalCacheValue
- Overrides:
toInternalCacheEntry
in classImmortalCacheValue
-
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
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
-
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
-
appendFieldsToString
- Overrides:
appendFieldsToString
in classImmortalCacheValue
-