Package de.caluga.morphium.cache.jcache
Class CacheImpl<K,CE>
- java.lang.Object
-
- de.caluga.morphium.cache.jcache.CacheImpl<K,CE>
-
- All Implemented Interfaces:
Closeable,AutoCloseable,Iterable<javax.cache.Cache.Entry<K,CacheEntry<CE>>>,javax.cache.Cache<K,CacheEntry<CE>>
public class CacheImpl<K,CE> extends Object implements javax.cache.Cache<K,CacheEntry<CE>>
User: Stephan Bösebeck Date: 17.05.18 Time: 08:38simple copy before update implemenation of a in-Memory Cache
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description classCacheImpl.CEvent
-
Constructor Summary
Constructors Constructor Description CacheImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclear()voidclose()booleancontainsKey(K key)voidderegisterCacheEntryListener(javax.cache.configuration.CacheEntryListenerConfiguration<K,CacheEntry<CE>> cacheEntryListenerConfiguration)voidexpire(Object k)CacheEntry<CE>get(K key)Map<K,CacheEntry<CE>>getAll(Set<? extends K> keys)CacheEntry<CE>getAndPut(K key, CacheEntry<CE> value)CacheEntry<CE>getAndRemove(K key)CacheEntry<CE>getAndReplace(K key, CacheEntry<CE> value)javax.cache.CacheManagergetCacheManager()<C extends javax.cache.configuration.Configuration<K,CacheEntry<CE>>>
CgetConfiguration(Class<C> clazz)StringgetName()intgetSize()<T> Tinvoke(K key, javax.cache.processor.EntryProcessor<K,CacheEntry<CE>,T> entryProcessor, Object... arguments)<T> Map<K,javax.cache.processor.EntryProcessorResult<T>>invokeAll(Set<? extends K> keys, javax.cache.processor.EntryProcessor<K,CacheEntry<CE>,T> entryProcessor, Object... arguments)booleanisClosed()Iterator<javax.cache.Cache.Entry<K,CacheEntry<CE>>>iterator()voidloadAll(Set<? extends K> keys, boolean replaceExistingValues, javax.cache.integration.CompletionListener completionListener)voidput(K key, CacheEntry<CE> value)voidputAll(Map<? extends K,? extends CacheEntry<CE>> map)booleanputIfAbsent(K key, CacheEntry<CE> value)voidregisterCacheEntryListener(javax.cache.configuration.CacheEntryListenerConfiguration<K,CacheEntry<CE>> cacheEntryListenerConfiguration)booleanremove(K key)booleanremove(K key, CacheEntry<CE> oldValue)voidremoveAll()voidremoveAll(Set<? extends K> keys)booleanreplace(K key, CacheEntry<CE> value)booleanreplace(K key, CacheEntry<CE> oldValue, CacheEntry<CE> newValue)voidsetCacheManager(javax.cache.CacheManager cm)voidsetName(String name)<T> Tunwrap(Class<T> clazz)-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
-
-
-
Method Detail
-
setCacheManager
public void setCacheManager(javax.cache.CacheManager cm)
-
get
public CacheEntry<CE> get(K key)
-
containsKey
public boolean containsKey(K key)
-
loadAll
public void loadAll(Set<? extends K> keys, boolean replaceExistingValues, javax.cache.integration.CompletionListener completionListener)
-
put
public void put(K key, CacheEntry<CE> value)
-
getAndPut
public CacheEntry<CE> getAndPut(K key, CacheEntry<CE> value)
-
putAll
public void putAll(Map<? extends K,? extends CacheEntry<CE>> map)
-
putIfAbsent
public boolean putIfAbsent(K key, CacheEntry<CE> value)
-
remove
public boolean remove(K key, CacheEntry<CE> oldValue)
-
getAndRemove
public CacheEntry<CE> getAndRemove(K key)
-
replace
public boolean replace(K key, CacheEntry<CE> oldValue, CacheEntry<CE> newValue)
-
replace
public boolean replace(K key, CacheEntry<CE> value)
-
getAndReplace
public CacheEntry<CE> getAndReplace(K key, CacheEntry<CE> value)
-
getConfiguration
public <C extends javax.cache.configuration.Configuration<K,CacheEntry<CE>>> C getConfiguration(Class<C> clazz)
-
invoke
public <T> T invoke(K key, javax.cache.processor.EntryProcessor<K,CacheEntry<CE>,T> entryProcessor, Object... arguments) throws javax.cache.processor.EntryProcessorException
-
invokeAll
public <T> Map<K,javax.cache.processor.EntryProcessorResult<T>> invokeAll(Set<? extends K> keys, javax.cache.processor.EntryProcessor<K,CacheEntry<CE>,T> entryProcessor, Object... arguments)
-
setName
public void setName(String name)
-
getCacheManager
public javax.cache.CacheManager getCacheManager()
-
close
public void close()
-
unwrap
public <T> T unwrap(Class<T> clazz)
-
registerCacheEntryListener
public void registerCacheEntryListener(javax.cache.configuration.CacheEntryListenerConfiguration<K,CacheEntry<CE>> cacheEntryListenerConfiguration)
-
deregisterCacheEntryListener
public void deregisterCacheEntryListener(javax.cache.configuration.CacheEntryListenerConfiguration<K,CacheEntry<CE>> cacheEntryListenerConfiguration)
-
iterator
public Iterator<javax.cache.Cache.Entry<K,CacheEntry<CE>>> iterator()
-
getSize
public int getSize()
-
expire
public void expire(Object k)
-
-