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
value
-
-
Constructor Summary
Constructors Constructor Description MortalCacheValue(Object value, long created, long lifespan)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancanExpire()MortalCacheValueclone()booleanequals(Object o)longgetCreated()longgetExpiryTime()longgetLifespan()inthashCode()booleanisExpired()booleanisExpired(long now)voidsetCreated(long created)voidsetLifespan(long lifespan)InternalCacheEntrytoInternalCacheEntry(Object key)StringtoString()-
Methods inherited from class org.infinispan.container.entries.ImmortalCacheValue
getLastUsed, getMaxIdle, getMetadata, getValue, setValue
-
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)
-
-
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
-
isExpired
public boolean isExpired()
- Specified by:
isExpiredin interfaceInternalCacheValue- Overrides:
isExpiredin classImmortalCacheValue- 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
-
toString
public String toString()
- Overrides:
toStringin classImmortalCacheValue
-
clone
public MortalCacheValue clone()
- Overrides:
clonein classImmortalCacheValue
-
-