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
Nested Classes -
Field Summary
FieldsFields inherited from class org.infinispan.container.entries.ImmortalCacheValue
internalMetadata, value -
Constructor Summary
ConstructorsModifierConstructorDescriptionMortalCacheValue(Object value, long created, long lifespan) protectedMortalCacheValue(Object value, PrivateMetadata internalMetadata, long created, long lifespan) -
Method Summary
Modifier and TypeMethodDescriptionprotected voidappendFieldsToString(StringBuilder builder) final booleanclone()booleanfinal longlongfinal longinthashCode()booleanisExpired(long now) final voidsetCreated(long created) final voidsetLifespan(long lifespan) InternalCacheEntry<?,?> Methods inherited from class org.infinispan.container.entries.ImmortalCacheValue
getInternalMetadata, getLastUsed, getMaxIdle, getMetadata, getValue, 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
-
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:
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
- Specified by:
toInternalCacheEntryin interfaceInternalCacheValue- Overrides:
toInternalCacheEntryin classImmortalCacheValue
-
getExpiryTime
public long getExpiryTime()- Specified by:
getExpiryTimein interfaceInternalCacheValue- Overrides:
getExpiryTimein classImmortalCacheValue
-
equals
- Overrides:
equalsin classImmortalCacheValue
-
hashCode
public int hashCode()- Overrides:
hashCodein classImmortalCacheValue
-
clone
- Overrides:
clonein classImmortalCacheValue
-
appendFieldsToString
- Overrides:
appendFieldsToStringin classImmortalCacheValue
-