Package org.infinispan.jcache
Class AbstractJCache<K,V>
- java.lang.Object
-
- org.infinispan.jcache.AbstractJCache<K,V>
-
- All Implemented Interfaces:
Closeable
,AutoCloseable
,Iterable<javax.cache.Cache.Entry<K,V>>
,javax.cache.Cache<K,V>
public abstract class AbstractJCache<K,V> extends Object implements javax.cache.Cache<K,V>
-
-
Field Summary
Fields Modifier and Type Field Description protected javax.cache.configuration.MutableConfiguration<K,V>
configuration
protected javax.cache.expiry.ExpiryPolicy
expiryPolicy
protected javax.cache.integration.CacheLoader<K,V>
jcacheLoader
protected javax.cache.integration.CacheWriter<? super K,? super V>
jcacheWriter
protected AbstractJCacheNotifier<K,V>
notifier
-
Constructor Summary
Constructors Constructor Description AbstractJCache(javax.cache.configuration.MutableConfiguration<K,V> configuration, javax.cache.CacheManager cacheManager, AbstractJCacheNotifier<K,V> notifier)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected void
addCacheEntryListenerConfiguration(javax.cache.configuration.CacheEntryListenerConfiguration<K,V> listenerCfg)
protected abstract void
addCacheLoaderAdapter(javax.cache.integration.CacheLoader<K,V> cacheLoader)
protected abstract void
addCacheWriterAdapter(javax.cache.integration.CacheWriter<? super K,? super V> cacheWriter)
protected void
addConfigurationListeners()
protected abstract void
addListener(AbstractJCacheListenerAdapter<K,V> listenerAdapter)
protected abstract AbstractJCache<K,V>
checkNotClosed()
AbstractJCache<K,V>
checkNotNull(Object obj, String name)
void
close()
protected abstract void
evict(K key)
protected List<K>
filterLoadAllKeys(Set<? extends K> keys, boolean replaceExistingValues, boolean cacheEvict)
javax.cache.CacheManager
getCacheManager()
protected Object
getCacheMXBean()
protected abstract Object
getCacheStatisticsMXBean()
<C extends javax.cache.configuration.Configuration<K,V>>
CgetConfiguration(Class<C> clazz)
protected abstract MBeanServer
getMBeanServer()
<T> Map<K,javax.cache.processor.EntryProcessorResult<T>>
invokeAll(Set<? extends K> keys, javax.cache.processor.EntryProcessor<K,V,T> entryProcessor, Object... arguments)
protected void
loadAllFromJCacheLoader(Set<? extends K> keys, boolean replaceExistingValues, javax.cache.integration.CompletionListener listener, org.infinispan.commons.api.BasicCache<K,V> cache, org.infinispan.commons.api.BasicCache<K,V> createCheckCache)
protected Map<K,V>
loadAllKeys(Collection<? extends K> keysToLoad)
protected <T> T
processEntryProcessor(MutableJCacheEntry<K,V> mutable, javax.cache.processor.EntryProcessor<K,V,T> entryProcessor, Object[] arguments)
protected V
put(org.infinispan.commons.api.BasicCache<K,V> cache, org.infinispan.commons.api.BasicCache<K,V> createCheckCache, K key, V value, boolean isPutIfAbsent)
protected boolean
remove(org.infinispan.commons.api.BasicCache<K,V> cache, K key, V oldValue)
protected void
removeCacheEntryListenerConfiguration(javax.cache.configuration.CacheEntryListenerConfiguration<K,V> listenerCfg)
protected abstract void
removeListener(AbstractJCacheListenerAdapter<K,V> listenerAdapter)
protected V
replace(org.infinispan.commons.api.BasicCache<K,V> cache, K key, V value)
protected boolean
replace(org.infinispan.commons.api.BasicCache<K,V> cache, org.infinispan.commons.api.BasicCache<K,V> existsCheckCache, K key, V oldValue, V value, boolean isConditional)
protected void
setCacheLoader(javax.cache.configuration.CompleteConfiguration<K,V> c)
protected void
setCacheWriter(javax.cache.configuration.CompleteConfiguration<K,V> c)
protected void
setListenerCompletion(javax.cache.integration.CompletionListener listener)
protected void
setListenerException(javax.cache.integration.CompletionListener listener, Throwable t)
void
setManagementEnabled(boolean enabled)
void
setStatisticsEnabled(boolean enabled)
protected boolean
statisticsEnabled()
<T> T
unwrap(Class<T> clazz)
protected void
updateTTLForAccessed(org.infinispan.commons.api.BasicCache<K,V> cache, K key, V value)
protected AbstractJCache<K,V>
verifyKeys(Set<? extends K> keys)
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface javax.cache.Cache
clear, containsKey, deregisterCacheEntryListener, get, getAll, getAndPut, getAndRemove, getAndReplace, getName, invoke, isClosed, iterator, loadAll, put, putAll, putIfAbsent, registerCacheEntryListener, remove, remove, removeAll, removeAll, replace, replace
-
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
-
-
-
Field Detail
-
expiryPolicy
protected final javax.cache.expiry.ExpiryPolicy expiryPolicy
-
notifier
protected final AbstractJCacheNotifier<K,V> notifier
-
-
Constructor Detail
-
AbstractJCache
public AbstractJCache(javax.cache.configuration.MutableConfiguration<K,V> configuration, javax.cache.CacheManager cacheManager, AbstractJCacheNotifier<K,V> notifier)
-
-
Method Detail
-
addConfigurationListeners
protected void addConfigurationListeners()
-
getConfiguration
public <C extends javax.cache.configuration.Configuration<K,V>> C getConfiguration(Class<C> clazz)
-
checkNotNull
public AbstractJCache<K,V> checkNotNull(Object obj, String name)
-
setCacheLoader
protected void setCacheLoader(javax.cache.configuration.CompleteConfiguration<K,V> c)
-
setCacheWriter
protected void setCacheWriter(javax.cache.configuration.CompleteConfiguration<K,V> c)
-
addCacheLoaderAdapter
protected abstract void addCacheLoaderAdapter(javax.cache.integration.CacheLoader<K,V> cacheLoader)
-
addCacheWriterAdapter
protected abstract void addCacheWriterAdapter(javax.cache.integration.CacheWriter<? super K,? super V> cacheWriter)
-
setListenerCompletion
protected void setListenerCompletion(javax.cache.integration.CompletionListener listener)
-
setListenerException
protected void setListenerException(javax.cache.integration.CompletionListener listener, Throwable t)
-
filterLoadAllKeys
protected List<K> filterLoadAllKeys(Set<? extends K> keys, boolean replaceExistingValues, boolean cacheEvict)
-
loadAllKeys
protected Map<K,V> loadAllKeys(Collection<? extends K> keysToLoad)
-
loadAllFromJCacheLoader
protected void loadAllFromJCacheLoader(Set<? extends K> keys, boolean replaceExistingValues, javax.cache.integration.CompletionListener listener, org.infinispan.commons.api.BasicCache<K,V> cache, org.infinispan.commons.api.BasicCache<K,V> createCheckCache)
-
processEntryProcessor
protected <T> T processEntryProcessor(MutableJCacheEntry<K,V> mutable, javax.cache.processor.EntryProcessor<K,V,T> entryProcessor, Object[] arguments)
-
checkNotClosed
protected abstract AbstractJCache<K,V> checkNotClosed()
-
verifyKeys
protected AbstractJCache<K,V> verifyKeys(Set<? extends K> keys)
-
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)
-
evict
protected abstract void evict(K key)
-
put
protected V put(org.infinispan.commons.api.BasicCache<K,V> cache, org.infinispan.commons.api.BasicCache<K,V> createCheckCache, K key, V value, boolean isPutIfAbsent)
-
updateTTLForAccessed
protected void updateTTLForAccessed(org.infinispan.commons.api.BasicCache<K,V> cache, K key, V value)
-
replace
protected boolean replace(org.infinispan.commons.api.BasicCache<K,V> cache, org.infinispan.commons.api.BasicCache<K,V> existsCheckCache, K key, V oldValue, V value, boolean isConditional)
-
remove
protected boolean remove(org.infinispan.commons.api.BasicCache<K,V> cache, K key, V oldValue)
-
getCacheManager
public javax.cache.CacheManager getCacheManager()
-
getMBeanServer
protected abstract MBeanServer getMBeanServer()
-
getCacheMXBean
protected Object getCacheMXBean()
-
getCacheStatisticsMXBean
protected abstract Object getCacheStatisticsMXBean()
-
setManagementEnabled
public void setManagementEnabled(boolean enabled)
-
setStatisticsEnabled
public void setStatisticsEnabled(boolean enabled)
-
addListener
protected abstract void addListener(AbstractJCacheListenerAdapter<K,V> listenerAdapter)
-
removeListener
protected abstract void removeListener(AbstractJCacheListenerAdapter<K,V> listenerAdapter)
-
unwrap
public <T> T unwrap(Class<T> clazz)
-
addCacheEntryListenerConfiguration
protected void addCacheEntryListenerConfiguration(javax.cache.configuration.CacheEntryListenerConfiguration<K,V> listenerCfg)
-
removeCacheEntryListenerConfiguration
protected void removeCacheEntryListenerConfiguration(javax.cache.configuration.CacheEntryListenerConfiguration<K,V> listenerCfg)
-
statisticsEnabled
protected boolean statisticsEnabled()
-
-