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
Nested Classes -
Field Summary
Fields inherited from class org.infinispan.container.entries.ImmortalCacheValue
internalMetadata, value -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedMetadataMortalCacheValue(Object value, PrivateMetadata internalMetadata, Metadata metadata, long created) MetadataMortalCacheValue(Object value, Metadata metadata, long created) -
Method Summary
Modifier and TypeMethodDescriptionprotected voidappendFieldsToString(StringBuilder builder) final booleanfinal longlongfinal longGet metadata of this cache entry.booleanisExpired(long now) voidsetMetadata(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, toStringMethods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, waitMethods 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:
toInternalCacheEntryin interfaceInternalCacheValue- Overrides:
toInternalCacheEntryin classImmortalCacheValue
-
getMetadata
Description copied from interface:MetadataAwareGet metadata of this cache entry.- Specified by:
getMetadatain interfaceInternalCacheValue- Specified by:
getMetadatain interfaceMetadataAware- Overrides:
getMetadatain classImmortalCacheValue- Returns:
- a Metadata instance
-
setMetadata
Description copied from interface:MetadataAwareSet the metadata in the cache entry.- Specified by:
setMetadatain interfaceMetadataAware- Parameters:
metadata- to apply to the cache entry
-
getCreated
public final long getCreated()- Specified by:
getCreatedin interfaceInternalCacheValue- Overrides:
getCreatedin classImmortalCacheValue- Returns:
- timestamp when the entry was created
-
getLifespan
public final long getLifespan()- Specified by:
getLifespanin interfaceInternalCacheValue- Overrides:
getLifespanin classImmortalCacheValue- Returns:
- lifespan of the value
-
isExpired
public boolean isExpired(long now) - Specified by:
isExpiredin interfaceInternalCacheValue- Overrides:
isExpiredin 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:
getExpiryTimein interfaceInternalCacheValue- Overrides:
getExpiryTimein classImmortalCacheValue
-
canExpire
public final boolean canExpire()- Specified by:
canExpirein interfaceInternalCacheValue- Overrides:
canExpirein classImmortalCacheValue- Returns:
- true if the entry can expire, false otherwise
-
appendFieldsToString
- Overrides:
appendFieldsToStringin classImmortalCacheValue
-