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 class
MortalCacheValue.Externalizer
-
Field Summary
Fields Modifier and Type Field Description protected long
created
protected long
lifespan
-
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 boolean
canExpire()
MortalCacheValue
clone()
boolean
equals(Object o)
long
getCreated()
long
getExpiryTime()
long
getLifespan()
int
hashCode()
boolean
isExpired()
boolean
isExpired(long now)
void
setCreated(long created)
void
setLifespan(long lifespan)
InternalCacheEntry
toInternalCacheEntry(Object key)
String
toString()
-
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:
getCreated
in interfaceInternalCacheValue
- Overrides:
getCreated
in classImmortalCacheValue
- Returns:
- timestamp when the entry was created
-
setCreated
public final void setCreated(long created)
-
getLifespan
public final long getLifespan()
- Specified by:
getLifespan
in interfaceInternalCacheValue
- Overrides:
getLifespan
in classImmortalCacheValue
- Returns:
- lifespan of the value
-
setLifespan
public final void setLifespan(long lifespan)
-
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
-
isExpired
public boolean isExpired()
- Specified by:
isExpired
in interfaceInternalCacheValue
- Overrides:
isExpired
in classImmortalCacheValue
- Returns:
- true if the entry has expired; false otherwise
-
canExpire
public final boolean canExpire()
- Specified by:
canExpire
in interfaceInternalCacheValue
- Overrides:
canExpire
in classImmortalCacheValue
- Returns:
- true if the entry can expire, false otherwise
-
toInternalCacheEntry
public InternalCacheEntry toInternalCacheEntry(Object key)
- Specified by:
toInternalCacheEntry
in interfaceInternalCacheValue
- Overrides:
toInternalCacheEntry
in classImmortalCacheValue
-
getExpiryTime
public long getExpiryTime()
- Specified by:
getExpiryTime
in interfaceInternalCacheValue
- Overrides:
getExpiryTime
in classImmortalCacheValue
-
equals
public boolean equals(Object o)
- Overrides:
equals
in classImmortalCacheValue
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classImmortalCacheValue
-
toString
public String toString()
- Overrides:
toString
in classImmortalCacheValue
-
clone
public MortalCacheValue clone()
- Overrides:
clone
in classImmortalCacheValue
-
-