Class JCache<K,V>

java.lang.Object
org.infinispan.jcache.AbstractJCache<K,V>
org.infinispan.jcache.embedded.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,V>
  • 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)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected void
    addCacheLoaderAdapter(javax.cache.integration.CacheLoader<K,V> cacheLoader)
     
    protected void
    addCacheWriterAdapter(javax.cache.integration.CacheWriter<? super K,? super V> cacheWriter)
     
    protected void
    addListener(org.infinispan.jcache.AbstractJCacheListenerAdapter<K,V> listenerAdapter)
     
    protected org.infinispan.jcache.AbstractJCache<K,V>
     
    void
     
    void
     
    boolean
     
    void
    deregisterCacheEntryListener(javax.cache.configuration.CacheEntryListenerConfiguration<K,V> listenerCfg)
     
    protected void
    evict(K key)
     
    get(K key)
     
    getAll(Set<? extends K> keys)
     
    getAndPut(K key, V value)
     
     
    getAndReplace(K key, V value)
     
    protected javax.cache.management.CacheStatisticsMXBean
     
    protected MBeanServer
     
     
    <T> T
    invoke(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)
     
    boolean
     
    Iterator<javax.cache.Cache.Entry<K,V>>
     
    void
    loadAll(Set<? extends K> keys, boolean replaceExistingValues, javax.cache.integration.CompletionListener listener)
     
    void
    put(K key, V value)
     
    void
    putAll(Map<? extends K,? extends V> inputMap)
     
    boolean
    putIfAbsent(K key, V value)
     
    void
    registerCacheEntryListener(javax.cache.configuration.CacheEntryListenerConfiguration<K,V> listenerCfg)
     
    boolean
    remove(K key)
     
    boolean
    remove(K key, V oldValue)
     
    void
     
    void
    removeAll(Set<? extends K> keys)
     
    protected void
    removeListener(org.infinispan.jcache.AbstractJCacheListenerAdapter<K,V> listenerAdapter)
     
    boolean
    replace(K key, V value)
     
    boolean
    replace(K key, V oldValue, V newValue)
     
    void
    setStatisticsEnabled(boolean enabled)
     
    <T> T
    unwrap(Class<T> clazz)
     

    Methods inherited from class org.infinispan.jcache.AbstractJCache

    addCacheEntryListenerConfiguration, addConfigurationListeners, checkNotNull, filterLoadAllKeys, getCacheManager, getCacheMXBean, getConfiguration, loadAllFromJCacheLoader, loadAllKeys, managementEnabled, processEntryProcessor, put, remove, removeCacheEntryListenerConfiguration, replace, replace, setCacheLoader, setCacheWriter, setListenerCompletion, setListenerException, setManagementEnabled, statisticsEnabled, updateTTLForAccessed, verifyKeys

    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
  • Constructor Details

    • JCache

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

    • 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>