Class JCache<K,​V>

  • All Implemented Interfaces:
    Closeable, AutoCloseable, Iterable<javax.cache.Cache.Entry<K,​V>>, javax.cache.Cache<K,​V>

    public class JCache<K,​V>
    extends org.infinispan.jcache.AbstractJCache<K,​V>
    Infinispan's implementation of Cache interface.
    Since:
    5.3
    Author:
    Vladimir Blagojevic, Galder ZamarreƱo
    • Nested Class Summary

      • Nested classes/interfaces inherited from interface javax.cache.Cache

        javax.cache.Cache.Entry<K extends Object,​V extends Object>
    • Field Summary

      • Fields inherited from class org.infinispan.jcache.AbstractJCache

        configuration, expiryPolicy, jcacheLoader, jcacheWriter, notifier
    • Constructor Summary

      Constructors 
      Constructor Description
      JCache​(org.infinispan.AdvancedCache<K,​V> cache, javax.cache.CacheManager cacheManager, ConfigurationAdapter<K,​V> c)  
    • Constructor Detail

      • JCache

        public JCache​(org.infinispan.AdvancedCache<K,​V> cache,
                      javax.cache.CacheManager cacheManager,
                      ConfigurationAdapter<K,​V> c)
    • Method Detail

      • addCacheLoaderAdapter

        protected void addCacheLoaderAdapter​(javax.cache.integration.CacheLoader<K,​V> cacheLoader)
        Specified by:
        addCacheLoaderAdapter in class org.infinispan.jcache.AbstractJCache<K,​V>
      • addCacheWriterAdapter

        protected void addCacheWriterAdapter​(javax.cache.integration.CacheWriter<? super K,​? super V> cacheWriter)
        Specified by:
        addCacheWriterAdapter in class org.infinispan.jcache.AbstractJCache<K,​V>
      • clear

        public void clear()
      • containsKey

        public boolean containsKey​(K key)
      • get

        public V get​(K key)
      • getAll

        public Map<K,​V> getAll​(Set<? extends K> keys)
      • getAndPut

        public V getAndPut​(K key,
                           V value)
      • getAndRemove

        public V getAndRemove​(K key)
      • getAndReplace

        public V getAndReplace​(K key,
                               V value)
      • close

        public void close()
        Specified by:
        close in interface AutoCloseable
        Specified by:
        close in interface javax.cache.Cache<K,​V>
        Specified by:
        close in interface Closeable
        Overrides:
        close in class org.infinispan.jcache.AbstractJCache<K,​V>
      • isClosed

        public boolean isClosed()
      • getName

        public String getName()
      • invoke

        public <T> T invoke​(K key,
                            javax.cache.processor.EntryProcessor<K,​V,​T> entryProcessor,
                            Object... arguments)
      • 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)
        Specified by:
        invokeAll in interface javax.cache.Cache<K,​V>
        Overrides:
        invokeAll in class org.infinispan.jcache.AbstractJCache<K,​V>
      • iterator

        public Iterator<javax.cache.Cache.Entry<K,​V>> iterator()
      • loadAll

        public void loadAll​(Set<? extends K> keys,
                            boolean replaceExistingValues,
                            javax.cache.integration.CompletionListener listener)
      • put

        public void put​(K key,
                        V value)
      • putAll

        public void putAll​(Map<? extends K,​? extends V> inputMap)
      • putIfAbsent

        public boolean putIfAbsent​(K key,
                                   V value)
      • remove

        public boolean remove​(K key)
      • remove

        public boolean remove​(K key,
                              V oldValue)
      • removeAll

        public void removeAll()
      • removeAll

        public void removeAll​(Set<? extends K> keys)
      • replace

        public boolean replace​(K key,
                               V value)
      • replace

        public boolean replace​(K key,
                               V oldValue,
                               V newValue)
      • unwrap

        public <T> T unwrap​(Class<T> clazz)
        Specified by:
        unwrap in interface javax.cache.Cache<K,​V>
        Overrides:
        unwrap in class org.infinispan.jcache.AbstractJCache<K,​V>
      • registerCacheEntryListener

        public void registerCacheEntryListener​(javax.cache.configuration.CacheEntryListenerConfiguration<K,​V> listenerCfg)
      • deregisterCacheEntryListener

        public void deregisterCacheEntryListener​(javax.cache.configuration.CacheEntryListenerConfiguration<K,​V> listenerCfg)
      • setStatisticsEnabled

        public void setStatisticsEnabled​(boolean enabled)
        Overrides:
        setStatisticsEnabled in class org.infinispan.jcache.AbstractJCache<K,​V>
      • getCacheStatisticsMXBean

        protected javax.cache.management.CacheStatisticsMXBean getCacheStatisticsMXBean()
        Specified by:
        getCacheStatisticsMXBean in class org.infinispan.jcache.AbstractJCache<K,​V>
      • getMBeanServer

        protected MBeanServer getMBeanServer()
        Specified by:
        getMBeanServer in class org.infinispan.jcache.AbstractJCache<K,​V>
      • checkNotClosed

        protected org.infinispan.jcache.AbstractJCache<K,​V> checkNotClosed()
        Specified by:
        checkNotClosed in class org.infinispan.jcache.AbstractJCache<K,​V>
      • addListener

        protected void addListener​(org.infinispan.jcache.AbstractJCacheListenerAdapter<K,​V> listenerAdapter)
        Specified by:
        addListener in class org.infinispan.jcache.AbstractJCache<K,​V>
      • removeListener

        protected void removeListener​(org.infinispan.jcache.AbstractJCacheListenerAdapter<K,​V> listenerAdapter)
        Specified by:
        removeListener in class org.infinispan.jcache.AbstractJCache<K,​V>
      • evict

        protected void evict​(K key)
        Specified by:
        evict in class org.infinispan.jcache.AbstractJCache<K,​V>