Package org.infinispan.container.entries
Class TransientCacheValue
java.lang.Object
org.infinispan.container.entries.ImmortalCacheValue
org.infinispan.container.entries.TransientCacheValue
- All Implemented Interfaces:
Cloneable,InternalCacheValue
A transient cache value, to correspond with
TransientCacheEntry- 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
ConstructorsModifierConstructorDescriptionTransientCacheValue(Object value, long maxIdle, long lastUsed) protectedTransientCacheValue(Object value, PrivateMetadata internalMetadata, long maxIdle, long lastUsed) -
Method Summary
Modifier and TypeMethodDescriptionprotected voidappendFieldsToString(StringBuilder builder) booleanclone()booleanlonglonglonginthashCode()final booleanisExpired(long now) booleanvoidsetLastUsed(long lastUsed) voidsetMaxIdle(long maxIdle) InternalCacheEntry<?,?> Methods inherited from class org.infinispan.container.entries.ImmortalCacheValue
getCreated, getInternalMetadata, getLifespan, getMetadata, getValue, setInternalMetadata, setValue, toString
-
Field Details
-
maxIdle
protected long maxIdle -
lastUsed
protected long lastUsed
-
-
Constructor Details
-
TransientCacheValue
-
TransientCacheValue
protected TransientCacheValue(Object value, PrivateMetadata internalMetadata, 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 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
-
isMaxIdleExpirable
public boolean isMaxIdleExpirable()- Returns:
- true if this entry can expire via max idle, 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
-