Package com.tangosol.net.cache
Interface ConfigurableCacheMap.Entry
-
- All Superinterfaces:
Map.Entry
- All Known Implementing Classes:
ConverterCollections.ConverterCacheEntry
,LocalCache.Entry
,ObservableSplittingBackingCache.EntrySet.Entry
,OldCache.Entry
,SerializationCache.EntrySet.Entry
- Enclosing interface:
- ConfigurableCacheMap
public static interface ConfigurableCacheMap.Entry extends Map.Entry
A cache Entry carries information additional to the base Map Entry in order to support eviction and expiry.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description long
getExpiryMillis()
Determine when the cache entry will expire, if ever.long
getLastTouchMillis()
Determine when the cache entry was last touched.int
getTouchCount()
Determine the number of times that the cache entry has been touched (since the touch count was last reset).int
getUnits()
Determine the number of cache units used by this Entry.void
setExpiryMillis(long lMillis)
Specify when the cache entry will expire, or disable expiry.void
setUnits(int cUnits)
Specify the number of cache units used by this Entry.void
touch()
Indicate to the entry that it has been touched, such as when it is accessed or modified.
-
-
-
Method Detail
-
touch
void touch()
Indicate to the entry that it has been touched, such as when it is accessed or modified.
-
getTouchCount
int getTouchCount()
Determine the number of times that the cache entry has been touched (since the touch count was last reset).- Returns:
- the number of times that the cache entry has been touched
-
getLastTouchMillis
long getLastTouchMillis()
Determine when the cache entry was last touched.- Returns:
- the date/time value, in millis, when the entry was most recently touched
-
getExpiryMillis
long getExpiryMillis()
Determine when the cache entry will expire, if ever.- Returns:
- the date/time value, in millis, when the entry will (or did) expire; zero indicates no expiry
-
setExpiryMillis
void setExpiryMillis(long lMillis)
Specify when the cache entry will expire, or disable expiry. Note that if the cache is configured for automatic expiry, each subsequent update to this cache entry will reschedule the expiry time.- Parameters:
lMillis
- pass the date/time value, in millis, for when the entry will expire, or pass zero to disable automatic expiry
-
getUnits
int getUnits()
Determine the number of cache units used by this Entry.- Returns:
- an integer value 0 or greater, with a larger value signifying a higher cost; -1 implies that the Entry has been discarded
-
setUnits
void setUnits(int cUnits)
Specify the number of cache units used by this Entry.- Parameters:
cUnits
- an integer value 0 or greater, with a larger value signifying a higher cost
-
-