Class CoherenceCache

java.lang.Object
com.oracle.coherence.spring.cache.CoherenceCache
All Implemented Interfaces:
Cache

public class CoherenceCache extends Object implements Cache
Coherence-specific implementation of Cache that defines common cache operations.
Since:
3.0
Author:
Gunnar Hillert
  • Constructor Details

    • CoherenceCache

      public CoherenceCache(com.tangosol.net.NamedCache<Object,Object> cache, CoherenceCacheConfiguration cacheConfiguration)
      Construct the CoherenceCache.
      Parameters:
      cache - must not be null
      cacheConfiguration - must not be null
  • Method Details

    • clear

      public void clear()
      Specified by:
      clear in interface Cache
    • evict

      public void evict(Object key)
      Specified by:
      evict in interface Cache
    • get

      public Cache.ValueWrapper get(Object key)
      Specified by:
      get in interface Cache
    • get

      public <T> T get(Object key, Class<T> type)
      Specified by:
      get in interface Cache
    • get

      public <T> T get(Object key, Callable<T> valueLoader)
      Return the value to which this cache maps the specified key. If the key does not exist in the cache, the method will obtain that value using the provided valueLoader. In that case, the key will be locked, unless CoherenceCacheConfiguration.isUseLocks() returns false.
      Specified by:
      get in interface Cache
      Type Parameters:
      T - type of the return value.
      Parameters:
      key - might be null. See Map.get(Object).
      valueLoader - must not be null.
      Returns:
      the value from the cache.
    • getName

      public String getName()
      Specified by:
      getName in interface Cache
    • getNativeCache

      public Object getNativeCache()
      Specified by:
      getNativeCache in interface Cache
    • put

      public void put(Object key, Object value)
      Specified by:
      put in interface Cache
    • size

      public int size()
      Returns the number of key-value mappings of the underlying NamedCache.
      Returns:
      the number of key-value mappings in this map
    • getCacheConfiguration

      public CoherenceCacheConfiguration getCacheConfiguration()
      Returns:
      never returns null.