Package org.infinispan.container.entries
Class MortalCacheValue
- java.lang.Object
-
- org.infinispan.container.entries.ImmortalCacheValue
-
- org.infinispan.container.entries.MortalCacheValue
-
- All Implemented Interfaces:
Cloneable,InternalCacheValue
- Direct Known Subclasses:
TransientMortalCacheValue
public class MortalCacheValue extends ImmortalCacheValue
A mortal cache value, to correspond withMortalCacheEntry- Since:
- 4.0
- Author:
- Manik Surtani
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classMortalCacheValue.Externalizer
-
Field Summary
Fields Modifier and Type Field Description protected longcreatedprotected longlifespan-
Fields inherited from class org.infinispan.container.entries.ImmortalCacheValue
internalMetadata, value
-
-
Constructor Summary
Constructors Modifier Constructor Description MortalCacheValue(Object value, long created, long lifespan)protectedMortalCacheValue(Object value, PrivateMetadata internalMetadata, long created, long lifespan)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidappendFieldsToString(StringBuilder builder)booleancanExpire()MortalCacheValueclone()booleanequals(Object o)longgetCreated()longgetExpiryTime()longgetLifespan()inthashCode()booleanisExpired(long now)voidsetCreated(long created)voidsetLifespan(long lifespan)InternalCacheEntry<?,?>toInternalCacheEntry(Object key)-
Methods inherited from class org.infinispan.container.entries.ImmortalCacheValue
getInternalMetadata, getLastUsed, getMaxIdle, getMetadata, getValue, 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 Detail
-
MortalCacheValue
public MortalCacheValue(Object value, long created, long lifespan)
-
MortalCacheValue
protected MortalCacheValue(Object value, PrivateMetadata internalMetadata, long created, long lifespan)
-
-
Method Detail
-
getCreated
public final long getCreated()
- Specified by:
getCreatedin interfaceInternalCacheValue- Overrides:
getCreatedin classImmortalCacheValue- Returns:
- timestamp when the entry was created
-
setCreated
public final void setCreated(long created)
-
getLifespan
public final long getLifespan()
- Specified by:
getLifespanin interfaceInternalCacheValue- Overrides:
getLifespanin classImmortalCacheValue- Returns:
- lifespan of the value
-
setLifespan
public final void setLifespan(long lifespan)
-
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
-
canExpire
public final boolean canExpire()
- Specified by:
canExpirein interfaceInternalCacheValue- Overrides:
canExpirein classImmortalCacheValue- Returns:
- true if the entry can expire, false otherwise
-
toInternalCacheEntry
public InternalCacheEntry<?,?> toInternalCacheEntry(Object key)
- Specified by:
toInternalCacheEntryin interfaceInternalCacheValue- Overrides:
toInternalCacheEntryin classImmortalCacheValue
-
getExpiryTime
public long getExpiryTime()
- Specified by:
getExpiryTimein interfaceInternalCacheValue- Overrides:
getExpiryTimein classImmortalCacheValue
-
equals
public boolean equals(Object o)
- Overrides:
equalsin classImmortalCacheValue
-
hashCode
public int hashCode()
- Overrides:
hashCodein classImmortalCacheValue
-
clone
public MortalCacheValue clone()
- Overrides:
clonein classImmortalCacheValue
-
appendFieldsToString
protected void appendFieldsToString(StringBuilder builder)
- Overrides:
appendFieldsToStringin classImmortalCacheValue
-
-