Package org.cache2k.jcache.provider
Class JCacheAdapter<K,V>
- java.lang.Object
-
- org.cache2k.jcache.provider.JCacheAdapter<K,V>
-
- All Implemented Interfaces:
Closeable,AutoCloseable,Iterable<javax.cache.Cache.Entry<K,V>>,javax.cache.Cache<K,V>
public class JCacheAdapter<K,V> extends Object implements javax.cache.Cache<K,V>
Forward cache operations to cache2k cache implementation.- Author:
- Jens Wilke
-
-
Field Summary
Fields Modifier and Type Field Description protected org.cache2k.core.api.InternalCache<K,V>cacheprotected AtomicLongiterationHitCorrectionCounterprotected booleanjmxEnabledprotected booleanjmxStatisticsEnabledprotected booleanreadThrough
-
Constructor Summary
Constructors Constructor Description JCacheAdapter(JCacheManagerAdapter manager, org.cache2k.Cache<K,V> cache, Class<K> keyType, Class<V> valueType, boolean storeByValue, boolean readThrough, boolean loaderConfigured, EventHandling<K,V> eventHandling)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclear()voidclose()booleancontainsKey(K key)voidderegisterCacheEntryListener(javax.cache.configuration.CacheEntryListenerConfiguration<K,V> cfg)Vget(K k)Map<K,V>getAll(Set<? extends K> keys)VgetAndPut(K key, V value)VgetAndRemove(K key)VgetAndReplace(K key, V value)javax.cache.CacheManagergetCacheManager()<C extends javax.cache.configuration.Configuration<K,V>>
CgetConfiguration(Class<C> type)StringgetName()<T> Tinvoke(K key, javax.cache.processor.EntryProcessor<K,V,T> entryProcessor, Object... arguments)<T> Map<K,javax.cache.processor.EntryProcessorResult<T>>invokeAll(Set<? extends K> keys, javax.cache.processor.EntryProcessor<K,V,T> entryProcessor, Object... arguments)booleanisClosed()Iterator<javax.cache.Cache.Entry<K,V>>iterator()Iterate with the help of cache2k key iterator.voidloadAll(Set<? extends K> keys, boolean replaceExistingValues, javax.cache.integration.CompletionListener completionListener)voidput(K k, V v)voidputAll(Map<? extends K,? extends V> map)booleanputIfAbsent(K key, V value)voidregisterCacheEntryListener(javax.cache.configuration.CacheEntryListenerConfiguration<K,V> cfg)booleanremove(K key)booleanremove(K key, V oldValue)voidremoveAll()voidremoveAll(Set<? extends K> keys)booleanreplace(K key, V value)booleanreplace(K key, V oldValue, V newValue)StringtoString()<T> Tunwrap(Class<T> clazz)-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
-
-
-
Field Detail
-
readThrough
protected final boolean readThrough
-
iterationHitCorrectionCounter
protected final AtomicLong iterationHitCorrectionCounter
-
jmxStatisticsEnabled
protected volatile boolean jmxStatisticsEnabled
-
jmxEnabled
protected volatile boolean jmxEnabled
-
-
Constructor Detail
-
JCacheAdapter
public JCacheAdapter(JCacheManagerAdapter manager, org.cache2k.Cache<K,V> cache, Class<K> keyType, Class<V> valueType, boolean storeByValue, boolean readThrough, boolean loaderConfigured, EventHandling<K,V> eventHandling)
-
-
Method Detail
-
containsKey
public boolean containsKey(K key)
-
loadAll
public void loadAll(Set<? extends K> keys, boolean replaceExistingValues, javax.cache.integration.CompletionListener completionListener)
-
getConfiguration
public <C extends javax.cache.configuration.Configuration<K,V>> C getConfiguration(Class<C> type)
-
invoke
public <T> T invoke(K key, javax.cache.processor.EntryProcessor<K,V,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,V,T> entryProcessor, Object... arguments)
-
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,V> cfg)
-
deregisterCacheEntryListener
public void deregisterCacheEntryListener(javax.cache.configuration.CacheEntryListenerConfiguration<K,V> cfg)
-
iterator
public Iterator<javax.cache.Cache.Entry<K,V>> iterator()
Iterate with the help of cache2k key iterator.
-
-