Class MetadataTransientCacheValue
java.lang.Object
org.infinispan.container.entries.ImmortalCacheValue
org.infinispan.container.entries.metadata.MetadataTransientCacheValue
- All Implemented Interfaces:
Cloneable
,InternalCacheValue
,MetadataAware
A transient cache value, to correspond with
TransientCacheEntry
which is MetadataAware
- Since:
- 5.3
- Author:
- Galder ZamarreƱo
-
Nested Class Summary
-
Field Summary
Fields inherited from class org.infinispan.container.entries.ImmortalCacheValue
internalMetadata, value
-
Constructor Summary
ModifierConstructorDescriptionprotected
MetadataTransientCacheValue
(Object value, PrivateMetadata internalMetadata, Metadata metadata, long lastUsed) MetadataTransientCacheValue
(Object value, Metadata metadata, long lastUsed) -
Method Summary
Modifier and TypeMethodDescriptionprotected void
appendFieldsToString
(StringBuilder builder) boolean
long
long
long
Get metadata of this cache entry.final boolean
isExpired
(long now) boolean
void
setMetadata
(Metadata metadata) Set the metadata in the cache entry.InternalCacheEntry<?,
?> Methods inherited from class org.infinispan.container.entries.ImmortalCacheValue
clone, equals, getCreated, getInternalMetadata, getLifespan, getValue, hashCode, setInternalMetadata, setValue, toString
-
Constructor Details
-
MetadataTransientCacheValue
-
MetadataTransientCacheValue
protected MetadataTransientCacheValue(Object value, PrivateMetadata internalMetadata, Metadata metadata, long lastUsed)
-
-
Method Details
-
toInternalCacheEntry
- Specified by:
toInternalCacheEntry
in interfaceInternalCacheValue
- Overrides:
toInternalCacheEntry
in classImmortalCacheValue
-
getMaxIdle
public long getMaxIdle()- Specified by:
getMaxIdle
in interfaceInternalCacheValue
- Overrides:
getMaxIdle
in classImmortalCacheValue
- Returns:
- max idle time allowed
-
getLastUsed
public long getLastUsed()- Specified by:
getLastUsed
in interfaceInternalCacheValue
- Overrides:
getLastUsed
in classImmortalCacheValue
- Returns:
- timestamp when the entry was last used
-
isExpired
public final 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
-
canExpire
public boolean canExpire()- Specified by:
canExpire
in interfaceInternalCacheValue
- Overrides:
canExpire
in classImmortalCacheValue
- Returns:
- true if the entry can expire, false otherwise
-
isMaxIdleExpirable
public boolean isMaxIdleExpirable()- Specified by:
isMaxIdleExpirable
in interfaceInternalCacheValue
- Returns:
- true if this entry can expire via max idle, false otherwise
-
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
-
getExpiryTime
public long getExpiryTime()- Specified by:
getExpiryTime
in interfaceInternalCacheValue
- Overrides:
getExpiryTime
in classImmortalCacheValue
-
appendFieldsToString
- Overrides:
appendFieldsToString
in classImmortalCacheValue
-