org.infinispan.container.entries
Class TransientMortalCacheEntry
java.lang.Object
org.infinispan.container.entries.AbstractInternalCacheEntry
org.infinispan.container.entries.TransientCacheEntry
org.infinispan.container.entries.TransientMortalCacheEntry
- All Implemented Interfaces:
- Serializable, CacheEntry, InternalCacheEntry
public class TransientMortalCacheEntry
- extends TransientCacheEntry
A cache entry that is both transient and mortal.
- Since:
- 4.0
- Author:
- Manik Surtani
- See Also:
- Serialized Form
Methods inherited from class org.infinispan.container.entries.AbstractInternalCacheEntry |
commit, getKey, getValue, isChanged, isCreated, isNull, isRemoved, isValid, rollback, setCreated, setRemoved, setValid, setValue, toString |
TransientMortalCacheEntry
public TransientMortalCacheEntry(Object key,
Object value,
long maxIdle,
long lifespan,
long lastUsed,
long created)
setLifespan
public InternalCacheEntry setLifespan(long lifespan)
- Description copied from interface:
CacheEntry
- Sets the lifespan of the entry.
Note that if this method is used, you should always use a reference to the return value after invocation, since as
an optimization, implementations may change type of CacheEntry used after invoking this method, for example
changing a MortalCacheEntry to an ImmortalCacheEntry.
- Specified by:
setLifespan
in interface CacheEntry
- Specified by:
setLifespan
in interface InternalCacheEntry
- Overrides:
setLifespan
in class TransientCacheEntry
- Parameters:
lifespan
- lifespan to set
- Returns:
- the updated CacheEntry
setMaxIdle
public InternalCacheEntry setMaxIdle(long maxIdle)
- Description copied from interface:
CacheEntry
- Sets the maximum idle time of the entry.
Note that if this method is used, you should always use a reference to the return value after invocation, since as
an optimization, implementations may change type of CacheEntry used after invoking this method, for example
changing a MortalCacheEntry to an ImmortalCacheEntry.
- Specified by:
setMaxIdle
in interface CacheEntry
- Specified by:
setMaxIdle
in interface InternalCacheEntry
- Overrides:
setMaxIdle
in class TransientCacheEntry
- Parameters:
maxIdle
- maxIdle to set
- Returns:
- the updated CacheEntry
getLifespan
public long getLifespan()
- Specified by:
getLifespan
in interface CacheEntry
- Overrides:
getLifespan
in class TransientCacheEntry
- Returns:
- retrieves the lifespan of this entry. -1 means an unlimited lifespan.
getCreated
public long getCreated()
- Specified by:
getCreated
in interface InternalCacheEntry
- Overrides:
getCreated
in class TransientCacheEntry
- Returns:
- timestamp when the entry was created
isExpired
public boolean isExpired()
- Specified by:
isExpired
in interface InternalCacheEntry
- Overrides:
isExpired
in class TransientCacheEntry
- Returns:
- true if the entry has expired; false otherwise
getExpiryTime
public final long getExpiryTime()
- Description copied from interface:
InternalCacheEntry
- Only used with entries that have a lifespan, this determines when an entry is due to expire.
- Specified by:
getExpiryTime
in interface InternalCacheEntry
- Overrides:
getExpiryTime
in class TransientCacheEntry
- Returns:
- timestamp when the entry is due to expire, or -1 if it doesn't have a lifespan
equals
public boolean equals(Object o)
- Overrides:
equals
in class TransientCacheEntry
hashCode
public int hashCode()
- Overrides:
hashCode
in class TransientCacheEntry
Copyright © 2009 JBoss, a division of Red Hat. All Rights Reserved.