Package org.infinispan.container.entries
Class TransientCacheValue
- java.lang.Object
-
- org.infinispan.container.entries.ImmortalCacheValue
-
- org.infinispan.container.entries.TransientCacheValue
-
- All Implemented Interfaces:
java.lang.Cloneable,InternalCacheValue
public class TransientCacheValue extends ImmortalCacheValue
A transient cache value, to correspond withTransientCacheEntry- Since:
- 4.0
- Author:
- Manik Surtani
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classTransientCacheValue.Externalizer
-
Field Summary
Fields Modifier and Type Field Description protected longlastUsedprotected longmaxIdle-
Fields inherited from class org.infinispan.container.entries.ImmortalCacheValue
value
-
-
Constructor Summary
Constructors Constructor Description TransientCacheValue(java.lang.Object value, long maxIdle, long lastUsed)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancanExpire()TransientCacheValueclone()booleanequals(java.lang.Object o)longgetExpiryTime()longgetLastUsed()longgetMaxIdle()inthashCode()booleanisExpired(long now)voidsetLastUsed(long lastUsed)voidsetMaxIdle(long maxIdle)InternalCacheEntrytoInternalCacheEntry(java.lang.Object key)java.lang.StringtoString()-
Methods inherited from class org.infinispan.container.entries.ImmortalCacheValue
getCreated, getLifespan, getMetadata, getValue, setValue
-
-
-
-
Method Detail
-
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 final 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 boolean canExpire()
- Specified by:
canExpirein interfaceInternalCacheValue- Overrides:
canExpirein classImmortalCacheValue- Returns:
- true if the entry can expire, false otherwise
-
toInternalCacheEntry
public InternalCacheEntry toInternalCacheEntry(java.lang.Object key)
- Specified by:
toInternalCacheEntryin interfaceInternalCacheValue- Overrides:
toInternalCacheEntryin classImmortalCacheValue
-
getExpiryTime
public long getExpiryTime()
- Specified by:
getExpiryTimein interfaceInternalCacheValue- Overrides:
getExpiryTimein classImmortalCacheValue
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equalsin classImmortalCacheValue
-
hashCode
public int hashCode()
- Overrides:
hashCodein classImmortalCacheValue
-
toString
public java.lang.String toString()
- Overrides:
toStringin classImmortalCacheValue
-
clone
public TransientCacheValue clone()
- Overrides:
clonein classImmortalCacheValue
-
-