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
public class TransientMortalCacheValue extends MortalCacheValue
A transient, mortal cache value to correspond withTransientMortalCacheEntry
- Since:
- 4.0
- Author:
- Manik Surtani
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
TransientMortalCacheValue.Externalizer
-
Field Summary
Fields Modifier and Type Field Description protected long
lastUsed
protected long
maxIdle
-
Fields inherited from class org.infinispan.container.entries.MortalCacheValue
created, lifespan
-
Fields inherited from class org.infinispan.container.entries.ImmortalCacheValue
internalMetadata, value
-
-
Constructor Summary
Constructors Modifier Constructor Description TransientMortalCacheValue(Object value, long created, long lifespan, long maxIdle, long lastUsed)
protected
TransientMortalCacheValue(Object value, PrivateMetadata internalMetadata, long created, long lifespan, long maxIdle, long lastUsed)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
appendFieldsToString(StringBuilder builder)
TransientMortalCacheValue
clone()
boolean
equals(Object o)
long
getExpiryTime()
long
getLastUsed()
long
getMaxIdle()
int
hashCode()
boolean
isExpired(long now)
boolean
isMaxIdleExpirable()
void
setLastUsed(long lastUsed)
void
setMaxIdle(long maxIdle)
InternalCacheEntry<?,?>
toInternalCacheEntry(Object key)
-
Methods inherited from class org.infinispan.container.entries.MortalCacheValue
canExpire, getCreated, getLifespan, setCreated, setLifespan
-
Methods inherited from class org.infinispan.container.entries.ImmortalCacheValue
getInternalMetadata, getMetadata, getValue, setInternalMetadata, setValue, toString
-
-
-
-
Constructor Detail
-
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 Detail
-
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 boolean isExpired(long now)
- Specified by:
isExpired
in interfaceInternalCacheValue
- Overrides:
isExpired
in 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
public InternalCacheEntry<?,?> toInternalCacheEntry(Object key)
- Specified by:
toInternalCacheEntry
in interfaceInternalCacheValue
- Overrides:
toInternalCacheEntry
in classMortalCacheValue
-
getExpiryTime
public long getExpiryTime()
- Specified by:
getExpiryTime
in interfaceInternalCacheValue
- Overrides:
getExpiryTime
in classMortalCacheValue
-
equals
public boolean equals(Object o)
- Overrides:
equals
in classMortalCacheValue
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classMortalCacheValue
-
clone
public TransientMortalCacheValue clone()
- Overrides:
clone
in classMortalCacheValue
-
appendFieldsToString
protected void appendFieldsToString(StringBuilder builder)
- Overrides:
appendFieldsToString
in classMortalCacheValue
-
-