|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.dontdrinkandroot.cache.impl.AbstractCache<K,V>
net.dontdrinkandroot.cache.impl.AbstractMapBackedCache<K,V,M>
net.dontdrinkandroot.cache.impl.AbstractMapBackedCustomTtlCache<K,V,M>
public abstract class AbstractMapBackedCustomTtlCache<K,V,M extends MetaData>
| Field Summary |
|---|
| Fields inherited from interface net.dontdrinkandroot.cache.Cache |
|---|
UNLIMITED_IDLE_TIME |
| Constructor Summary | |
|---|---|
AbstractMapBackedCustomTtlCache(String name,
long defaultTimeToLive,
ExpungeStrategy expungeStrategy)
Construct a new AbstractCustomTtlCache. |
|
AbstractMapBackedCustomTtlCache(String name,
long defaultTimeToLive,
long defaultMaxIdleTime,
ExpungeStrategy expungeStrategy)
Construct a new AbstractCustomTtlCache. |
|
| Method Summary | ||
|---|---|---|
protected
|
doPut(K key,
T data)
Performs storage of the given data and adds new metadata to the map. |
|
protected abstract
|
doPut(K key,
T data,
long timeToLive,
long defaultMaxIdleTime)
Performs storage of the given data and adds new metadata to the map. |
|
|
put(K key,
T data,
long timeToLive)
Store an entry in the cache with a specific time to live. |
|
|
put(K key,
T data,
long timeToLive,
long maxIdleTime)
Store an entry in the cache with a specific time to live and max idle time. |
|
|
putWithErrors(K key,
T data,
long timeToLive)
Store an entry in the cache with a specific time to live. |
|
|
putWithErrors(K key,
T data,
long timeToLive,
long maxIdleTime)
Store an entry in the cache with a specific time to live and max idle time. |
|
| Methods inherited from class net.dontdrinkandroot.cache.impl.AbstractMapBackedCache |
|---|
cleanUp, delete, delete, doDelete, doGet, expunge, get, getEntriesMetaData, getEntriesMetaDataMap, getExpungeStrategy, getMetaData, getStatistics, getWithErrors, put, putWithErrors, setEntriesMetaDataMap, setExpungeStrategy |
| Methods inherited from class net.dontdrinkandroot.cache.impl.AbstractCache |
|---|
getCleanUpLogger, getDefaultMaxIdleTime, getDefaultTtl, getLogger, getName, setDefaultMaxIdleTime, setDefaultTtl |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface net.dontdrinkandroot.cache.Cache |
|---|
cleanUp, delete, get, getDefaultMaxIdleTime, getDefaultTtl, getMetaData, getName, getStatistics, getWithErrors, put, putWithErrors |
| Constructor Detail |
|---|
public 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.| Method Detail |
|---|
public <T extends V> T put(K key,
T data,
long timeToLive)
CustomTtlCacheCustomTtlCache.put(Object, Object, long) if you want to handle them.
put 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.
public <T extends V> T put(K key,
T data,
long timeToLive,
long maxIdleTime)
CustomTtlCacheCustomTtlCache.putWithErrors(Object, Object, long) if you want to
handle them.
put 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.
public final <T extends V> T putWithErrors(K key,
T data,
long timeToLive,
long maxIdleTime)
throws CacheException
CustomTtlCache
putWithErrors 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 <T extends V> T putWithErrors(K key,
T data,
long timeToLive)
throws CacheException
CustomTtlCache
putWithErrors 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 <T extends V> T doPut(K key,
T data)
throws CacheException
AbstractMapBackedCache
doPut in class AbstractMapBackedCache<K,V,M extends MetaData>CacheException
protected abstract <T extends V> T doPut(K key,
T data,
long timeToLive,
long defaultMaxIdleTime)
throws CacheException
CacheException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||