net.dontdrinkandroot.cache.impl.memory
Class MemoryCache<K,V>
java.lang.Object
net.dontdrinkandroot.cache.impl.AbstractCache<K,V>
net.dontdrinkandroot.cache.impl.AbstractMapBackedCache<K,V,M>
net.dontdrinkandroot.cache.impl.AbstractMapBackedCustomTtlCache<K,V,SimpleMetaData>
net.dontdrinkandroot.cache.impl.memory.MemoryCache<K,V>
- All Implemented Interfaces:
- Cache<K,V>, CustomTtlCache<K,V>
public class MemoryCache<K,V>
- extends AbstractMapBackedCustomTtlCache<K,V,SimpleMetaData>
- Author:
- Philip W. Sorst
| Methods inherited from class net.dontdrinkandroot.cache.impl.AbstractMapBackedCache |
cleanUp, delete, delete, expunge, get, getEntriesMetaData, getEntriesMetaDataMap, getExpungeStrategy, getMetaData, getStatistics, getWithErrors, put, putWithErrors, setEntriesMetaDataMap, setExpungeStrategy |
| 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 |
dataMap
protected final HashMap<K,V> dataMap
MemoryCache
public MemoryCache(String name,
long defaultTimeToLive,
ExpungeStrategy expungeStrategy)
MemoryCache
public MemoryCache(String name,
long defaultTimeToLive,
long defaultMaxIdleTime,
ExpungeStrategy expungeStrategy)
doPut
protected <T extends V> T doPut(K key,
T data,
long timeToLive,
long maxIdleTime)
throws CacheException
- Description copied from class:
AbstractMapBackedCustomTtlCache
- Performs storage of the given data and adds new metadata to the map.
- Specified by:
doPut in class AbstractMapBackedCustomTtlCache<K,V,SimpleMetaData>
- Throws:
CacheException
doDelete
protected void doDelete(K key,
SimpleMetaData metaData)
throws CacheException
- Description copied from class:
AbstractMapBackedCache
- Performs deletion of the data belonging to the metadata. Removal from the map is done by the
superclass.
- Specified by:
doDelete in class AbstractMapBackedCache<K,V,SimpleMetaData>
- Throws:
CacheException
doGet
protected <T extends V> T doGet(K key,
SimpleMetaData metaData)
throws CacheException
- Description copied from class:
AbstractMapBackedCache
- Performs retrieval of the data belonging to the metadata.
- Specified by:
doGet in class AbstractMapBackedCache<K,V,SimpleMetaData>
- Throws:
CacheException
copyData
protected <T extends V> T copyData(T data)
isCopyOnRead
public boolean isCopyOnRead()
isCopyOnWrite
public boolean isCopyOnWrite()
setCopyOnRead
public MemoryCache<K,V> setCopyOnRead(boolean copyOnRead)
setCopyOnWrite
public MemoryCache<K,V> setCopyOnWrite(boolean copyOnWrite)
Copyright © 2013 dontdrinkandroot. All Rights Reserved.