T - The type of the cached itempublic class TimedMemoryItemCache<T> extends MemoryItemCache<T>
ItemCache implementation that stores
the item only for a certain time.| Constructor and Description |
|---|
TimedMemoryItemCache(ItemValueRetriever<T> itemValueRetriever,
long maxCacheTime)
Creates a new timed memory item cache.
|
| Modifier and Type | Method and Description |
|---|---|
T |
get()
Returns the cached item.
|
clearretrieveValuepublic TimedMemoryItemCache(ItemValueRetriever<T> itemValueRetriever, long maxCacheTime)
itemValueRetriever - The item value retrievermaxCacheTime - The maximum time for the cached item to stay in memory (in
milliseconds)public T get() throws CacheException
get in interface ItemCache<T>get in class MemoryItemCache<T>CacheException - if the item was not cached before and retrieving the item for
the first time failedCopyright © 2026. All rights reserved.