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
A mortal cache value, to correspond with
MortalCacheEntry
- Since:
- 4.0
- Author:
- Manik Surtani
-
Nested Class Summary
-
Field Summary
Fields inherited from class org.infinispan.container.entries.ImmortalCacheValue
internalMetadata, value
-
Constructor Summary
ModifierConstructorDescriptionMortalCacheValue
(Object value, long created, long lifespan) protected
MortalCacheValue
(Object value, PrivateMetadata internalMetadata, long created, long lifespan) -
Method Summary
Modifier and TypeMethodDescriptionprotected void
appendFieldsToString
(StringBuilder builder) final boolean
clone()
boolean
final long
long
final long
int
hashCode()
boolean
isExpired
(long now) final void
setCreated
(long created) final void
setLifespan
(long lifespan) InternalCacheEntry<?,
?> 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
-
Field Details
-
created
protected long created -
lifespan
protected long lifespan
-
-
Constructor Details
-
MortalCacheValue
-
MortalCacheValue
protected MortalCacheValue(Object value, PrivateMetadata internalMetadata, long created, long lifespan)
-
-
Method Details
-
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
-
canExpire
public final boolean canExpire()- Specified by:
canExpire
in interfaceInternalCacheValue
- Overrides:
canExpire
in classImmortalCacheValue
- Returns:
- true if the entry can expire, false otherwise
-
toInternalCacheEntry
- Specified by:
toInternalCacheEntry
in interfaceInternalCacheValue
- Overrides:
toInternalCacheEntry
in classImmortalCacheValue
-
getExpiryTime
public long getExpiryTime()- Specified by:
getExpiryTime
in interfaceInternalCacheValue
- Overrides:
getExpiryTime
in classImmortalCacheValue
-
equals
- Overrides:
equals
in classImmortalCacheValue
-
hashCode
public int hashCode()- Overrides:
hashCode
in classImmortalCacheValue
-
clone
- Overrides:
clone
in classImmortalCacheValue
-
appendFieldsToString
- Overrides:
appendFieldsToString
in classImmortalCacheValue
-