Package org.infinispan.container.entries
Class TransientMortalCacheValue
java.lang.Object
org.infinispan.container.entries.ImmortalCacheValue
org.infinispan.container.entries.MortalCacheValue
org.infinispan.container.entries.TransientMortalCacheValue
- All Implemented Interfaces:
Cloneable,InternalCacheValue
A transient, mortal cache value to correspond with
TransientMortalCacheEntry- Since:
- 4.0
- Author:
- Manik Surtani
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsFields inherited from class org.infinispan.container.entries.MortalCacheValue
created, lifespanFields inherited from class org.infinispan.container.entries.ImmortalCacheValue
internalMetadata, value -
Constructor Summary
ConstructorsModifierConstructorDescriptionTransientMortalCacheValue(Object value, long created, long lifespan, long maxIdle, long lastUsed) protectedTransientMortalCacheValue(Object value, PrivateMetadata internalMetadata, long created, long lifespan, long maxIdle, long lastUsed) -
Method Summary
Modifier and TypeMethodDescriptionprotected voidappendFieldsToString(StringBuilder builder) clone()booleanlonglonglonginthashCode()booleanisExpired(long now) booleanvoidsetLastUsed(long lastUsed) voidsetMaxIdle(long maxIdle) InternalCacheEntry<?,?> Methods inherited from class org.infinispan.container.entries.MortalCacheValue
canExpire, getCreated, getLifespan, setCreated, setLifespanMethods inherited from class org.infinispan.container.entries.ImmortalCacheValue
getInternalMetadata, getMetadata, getValue, setInternalMetadata, setValue, toString
-
Field Details
-
maxIdle
protected long maxIdle -
lastUsed
protected long lastUsed
-
-
Constructor Details
-
TransientMortalCacheValue
public TransientMortalCacheValue(Object value, long created, long lifespan, long maxIdle, long lastUsed) -
TransientMortalCacheValue
protected TransientMortalCacheValue(Object value, PrivateMetadata internalMetadata, long created, long lifespan, long maxIdle, long lastUsed)
-
-
Method Details
-
getMaxIdle
public long getMaxIdle()- Specified by:
getMaxIdlein interfaceInternalCacheValue- Overrides:
getMaxIdlein classImmortalCacheValue- Returns:
- max idle time allowed
-
setMaxIdle
public void setMaxIdle(long maxIdle) -
getLastUsed
public long getLastUsed()- Specified by:
getLastUsedin interfaceInternalCacheValue- Overrides:
getLastUsedin classImmortalCacheValue- Returns:
- timestamp when the entry was last used
-
setLastUsed
public void setLastUsed(long lastUsed) -
isExpired
public boolean isExpired(long now) - Specified by:
isExpiredin interfaceInternalCacheValue- Overrides:
isExpiredin classMortalCacheValue- Parameters:
now- the current time as expressed bySystem.currentTimeMillis()- Returns:
- true if the entry has expired; false otherwise
-
isMaxIdleExpirable
public boolean isMaxIdleExpirable()- Returns:
- true if this entry can expire via max idle, false otherwise
-
toInternalCacheEntry
- Specified by:
toInternalCacheEntryin interfaceInternalCacheValue- Overrides:
toInternalCacheEntryin classMortalCacheValue
-
getExpiryTime
public long getExpiryTime()- Specified by:
getExpiryTimein interfaceInternalCacheValue- Overrides:
getExpiryTimein classMortalCacheValue
-
equals
- Overrides:
equalsin classMortalCacheValue
-
hashCode
public int hashCode()- Overrides:
hashCodein classMortalCacheValue
-
clone
- Overrides:
clonein classMortalCacheValue
-
appendFieldsToString
- Overrides:
appendFieldsToStringin classMortalCacheValue
-