public abstract class AbstractMapBackedCustomTtlCache<K,V,M extends MetaData> extends AbstractMapBackedCache<K,V,M> implements CustomTtlCache<K,V>
UNLIMITED_IDLE_TIME| Constructor and Description |
|---|
AbstractMapBackedCustomTtlCache(String name,
long defaultTimeToLive,
ExpungeStrategy expungeStrategy)
Construct a new AbstractCustomTtlCache.
|
AbstractMapBackedCustomTtlCache(String name,
long defaultTimeToLive,
long defaultMaxIdleTime,
ExpungeStrategy expungeStrategy)
Construct a new AbstractCustomTtlCache.
|
| Modifier and Type | Method and Description |
|---|---|
protected V |
doPut(K key,
V data)
Performs storage of the given data and adds new metadata to the map.
|
protected abstract V |
doPut(K key,
V data,
long timeToLive,
long defaultMaxIdleTime)
Performs storage of the given data and adds new metadata to the map.
|
V |
put(K key,
V data,
long timeToLive)
Store an entry in the cache with a specific time to live.
|
V |
put(K key,
V data,
long timeToLive,
long maxIdleTime)
Store an entry in the cache with a specific time to live and max idle time.
|
cleanUp, delete, delete, doDelete, doGet, expunge, get, getEntriesMetaData, getEntriesMetaDataMap, getExpungeStrategy, getMetaData, getStatistics, put, setEntriesMetaDataMap, setExpungeStrategygetCleanUpLogger, getDefaultMaxIdleTime, getDefaultTtl, getLogger, getName, setDefaultMaxIdleTime, setDefaultTtlclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitcleanUp, delete, get, getDefaultMaxIdleTime, getDefaultTtl, getMetaData, getName, getStatistics, putpublic AbstractMapBackedCustomTtlCache(String name, long defaultTimeToLive, ExpungeStrategy expungeStrategy)
name - The name of the cache.defaultTimeToLive - The default Time to Live for Cache entries.public AbstractMapBackedCustomTtlCache(String name, long defaultTimeToLive, long defaultMaxIdleTime, ExpungeStrategy expungeStrategy)
name - The name of the cache.defaultTimeToLive - The default Time to Live for Cache entries.public final V put(K key, V data, long timeToLive, long maxIdleTime) throws CacheException
CustomTtlCacheput in interface CustomTtlCache<K,V>data - The data to store, make sure that you don't alter the data after it has been put
to cache as (depending on the implementation) this might lead to altering the
entry in the cache. Use the returned entry instead.timeToLive - The time (in milliseconds) after which the entry expires.maxIdleTime - The time (in milliseconds) that an entry may idle (not being accessed) before
being expunged.CacheException - Thrown if the storage fails.public final V put(K key, V data, long timeToLive) throws CacheException
CustomTtlCacheput in interface CustomTtlCache<K,V>data - The data to store, make sure that you don't alter the data after it has been put
to cache as (depending on the implementation) this might lead to altering the
entry in the cache. Use the returned entry instead.timeToLive - The time (in milliseconds) after which the entry expires.CacheException - Thrown if the storage fails.protected V doPut(K key, V data) throws CacheException
AbstractMapBackedCachedoPut in class AbstractMapBackedCache<K,V,M extends MetaData>CacheExceptionprotected abstract V doPut(K key, V data, long timeToLive, long defaultMaxIdleTime) throws CacheException
CacheExceptionCopyright © 2012. All Rights Reserved.