Class Cache.Default<K,​V>

java.lang.Object
one.microstream.cache.Cache.Default<K,​V>
All Implemented Interfaces:
Closeable, AutoCloseable, Iterable<javax.cache.Cache.Entry<K,​V>>, javax.cache.Cache<K,​V>, Cache<K,​V>, Unwrappable
Enclosing interface:
Cache<K,​V>

public static class Cache.Default<K,​V>
extends Object
implements Cache<K,​V>
  • Constructor Details

  • Method Details

    • getName

      public String getName()
      Specified by:
      getName in interface javax.cache.Cache<K,​V>
    • getCacheManager

      public CacheManager getCacheManager()
      Specified by:
      getCacheManager in interface javax.cache.Cache<K,​V>
      Specified by:
      getCacheManager in interface Cache<K,​V>
    • getConfiguration

      public CacheConfiguration<K,​V> getConfiguration()
      Description copied from interface: Cache
      Returns the CacheConfiguration which was used to create this cache.
      Specified by:
      getConfiguration in interface Cache<K,​V>
    • getConfiguration

      public <C extends javax.cache.configuration.Configuration<K,​ V>> C getConfiguration​(Class<C> clazz)
      Specified by:
      getConfiguration in interface javax.cache.Cache<K,​V>
    • registerCacheEntryListener

      public void registerCacheEntryListener​(javax.cache.configuration.CacheEntryListenerConfiguration<K,​V> cacheEntryListenerConfiguration)
      Specified by:
      registerCacheEntryListener in interface javax.cache.Cache<K,​V>
    • deregisterCacheEntryListener

      public void deregisterCacheEntryListener​(javax.cache.configuration.CacheEntryListenerConfiguration<K,​V> cacheEntryListenerConfiguration)
      Specified by:
      deregisterCacheEntryListener in interface javax.cache.Cache<K,​V>
    • isClosed

      public boolean isClosed()
      Specified by:
      isClosed in interface javax.cache.Cache<K,​V>
    • 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
    • size

      public long size()
      Description copied from interface: Cache
      Returns the amount of entries in this cache.
      Specified by:
      size in interface Cache<K,​V>
      Returns:
      this cache's size
    • get

      public V get​(K key)
      Specified by:
      get in interface javax.cache.Cache<K,​V>
    • getAll

      public Map<K,​V> getAll​(Set<? extends K> keys)
      Specified by:
      getAll in interface javax.cache.Cache<K,​V>
    • containsKey

      public boolean containsKey​(K key)
      Specified by:
      containsKey in interface javax.cache.Cache<K,​V>
    • loadAll

      public void loadAll​(Set<? extends K> keys, boolean replaceExistingValues, javax.cache.integration.CompletionListener completionListener)
      Specified by:
      loadAll in interface javax.cache.Cache<K,​V>
    • put

      public void put​(K key, V value)
      Specified by:
      put in interface javax.cache.Cache<K,​V>
    • getAndPut

      public V getAndPut​(K key, V value)
      Specified by:
      getAndPut in interface javax.cache.Cache<K,​V>
    • putAll

      public void putAll​(Map<? extends K,​? extends V> map, boolean replaceExistingValues, boolean useWriteThrough)
      Description copied from interface: Cache
      Adds all entries to this cache.
      Specified by:
      putAll in interface Cache<K,​V>
      Parameters:
      map - entries to add
      replaceExistingValues - if values with same keys should be replaces
      useWriteThrough - enable write through mode for this operation
    • putIfAbsent

      public boolean putIfAbsent​(K key, V value)
      Specified by:
      putIfAbsent in interface javax.cache.Cache<K,​V>
    • remove

      public boolean remove​(K key)
      Specified by:
      remove in interface javax.cache.Cache<K,​V>
    • remove

      public boolean remove​(K key, V oldValue)
      Specified by:
      remove in interface javax.cache.Cache<K,​V>
    • getAndRemove

      public V getAndRemove​(K key)
      Specified by:
      getAndRemove in interface javax.cache.Cache<K,​V>
    • replace

      public boolean replace​(K key, V oldValue, V newValue)
      Specified by:
      replace in interface javax.cache.Cache<K,​V>
    • replace

      public boolean replace​(K key, V value)
      Specified by:
      replace in interface javax.cache.Cache<K,​V>
    • getAndReplace

      public V getAndReplace​(K key, V value)
      Specified by:
      getAndReplace in interface javax.cache.Cache<K,​V>
    • removeAll

      public void removeAll​(Set<? extends K> keys)
      Specified by:
      removeAll in interface javax.cache.Cache<K,​V>
    • removeAll

      public void removeAll()
      Specified by:
      removeAll in interface javax.cache.Cache<K,​V>
    • clear

      public void clear()
      Specified by:
      clear in interface javax.cache.Cache<K,​V>
    • iterator

      public Iterator<javax.cache.Cache.Entry<K,​V>> iterator()
      Specified by:
      iterator in interface javax.cache.Cache<K,​V>
      Specified by:
      iterator in interface Iterable<K>
    • setStatisticsEnabled

      public void setStatisticsEnabled​(boolean enabled)
      Description copied from interface: Cache
      Enables or disables statistics gathering.
      Specified by:
      setStatisticsEnabled in interface Cache<K,​V>
    • setManagementEnabled

      public void setManagementEnabled​(boolean enabled)
      Description copied from interface: Cache
      Enables or disables the management bean of this cache.
      Specified by:
      setManagementEnabled in interface Cache<K,​V>
    • 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>
    • invoke

      public <T> T invoke​(K key, javax.cache.processor.EntryProcessor<K,​V,​T> entryProcessor, Object... arguments) throws javax.cache.processor.EntryProcessorException
      Specified by:
      invoke in interface javax.cache.Cache<K,​V>
      Throws:
      javax.cache.processor.EntryProcessorException
    • evict

      public void evict​(Iterable<KeyValue<Object,​CachedValue>> entriesToEvict)
      Description copied from interface: Cache
      Evicts given entries from this cache.
      Specified by:
      evict in interface Cache<K,​V>