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
-
Field Summary
Fields inherited from class org.infinispan.container.entries.ImmortalCacheValue
internalMetadata, value
-
Constructor Summary
ModifierConstructorDescriptionTransientCacheValue
(Object value, long maxIdle, long lastUsed) protected
TransientCacheValue
(Object value, PrivateMetadata internalMetadata, long maxIdle, long lastUsed) -
Method Summary
Modifier and TypeMethodDescriptionprotected void
appendFieldsToString
(StringBuilder builder) boolean
clone()
boolean
long
long
long
int
hashCode()
final boolean
isExpired
(long now) boolean
void
setLastUsed
(long lastUsed) void
setMaxIdle
(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:
getMaxIdle
in interfaceInternalCacheValue
- Overrides:
getMaxIdle
in classImmortalCacheValue
- Returns:
- max idle time allowed
-
setMaxIdle
public void setMaxIdle(long maxIdle) -
getLastUsed
public long getLastUsed()- Specified by:
getLastUsed
in interfaceInternalCacheValue
- Overrides:
getLastUsed
in classImmortalCacheValue
- Returns:
- timestamp when the entry was last used
-
setLastUsed
public void setLastUsed(long lastUsed) -
isExpired
public final 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 boolean canExpire()- Specified by:
canExpire
in interfaceInternalCacheValue
- Overrides:
canExpire
in 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:
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
-