Class CoherenceBasedCacheManager

java.lang.Object
com.tangosol.coherence.jcache.CoherenceBasedCacheManager
All Implemented Interfaces:
Disposable, Closeable, AutoCloseable, javax.cache.CacheManager

public class CoherenceBasedCacheManager extends Object implements javax.cache.CacheManager, Disposable
The Coherence-based implementation of a CacheManager.
Author:
jf 2013.06.18, bo 2013.12.17
  • Constructor Details

  • Method Details

    • getCacheToConfigurationMapping

      public CoherenceBasedCompleteConfiguration getCacheToConfigurationMapping(JCacheIdentifier cacheId)
      Provide access to meta cache that maps JCache cache names to JCache configuration. The mapping is a string to a JCache Configuration object.
      Parameters:
      cacheId - JCache unique identifier
      Returns:
      a named cache that maps JCache cache names to JCache configurations.
    • putCacheToConfigurationMapping

      public void putCacheToConfigurationMapping(JCacheIdentifier cacheId, CoherenceBasedCompleteConfiguration config)
      put entry with key of sName
      Parameters:
      cacheId - key of entry to put into _metaJCacheNameToConfig
    • removeCacheToConfigurationMapping

      public void removeCacheToConfigurationMapping(JCacheIdentifier cacheId)
      remove entry with key of sName
      Parameters:
      cacheId - key of entry to remove from _metaJCacheNameToConfig
    • getCachingProvider

      public javax.cache.spi.CachingProvider getCachingProvider()
      Specified by:
      getCachingProvider in interface javax.cache.CacheManager
    • getURI

      public URI getURI()
      Specified by:
      getURI in interface javax.cache.CacheManager
    • getProperties

      public Properties getProperties()
      Specified by:
      getProperties in interface javax.cache.CacheManager
    • getClassLoader

      public ClassLoader getClassLoader()
      Specified by:
      getClassLoader in interface javax.cache.CacheManager
    • createCache

      public <K, V, C extends javax.cache.configuration.Configuration<K, V>> javax.cache.Cache<K,V> createCache(String sJCacheName, C cfgJCache) throws IllegalArgumentException
      Specified by:
      createCache in interface javax.cache.CacheManager
      Throws:
      IllegalArgumentException
    • getCache

      public <K, V> javax.cache.Cache<K,V> getCache(String sJCacheName, Class<K> clzKey, Class<V> clzType)
      Specified by:
      getCache in interface javax.cache.CacheManager
    • getCache

      public javax.cache.Cache getCache(String sJCacheName)
      Specified by:
      getCache in interface javax.cache.CacheManager
    • getCacheNames

      public Iterable<String> getCacheNames()
      Specified by:
      getCacheNames in interface javax.cache.CacheManager
    • destroyCache

      public void destroyCache(String sName)
      Specified by:
      destroyCache in interface javax.cache.CacheManager
    • enableStatistics

      public void enableStatistics(String sName, boolean fEnabled)
      Specified by:
      enableStatistics in interface javax.cache.CacheManager
    • enableManagement

      public void enableManagement(String sName, boolean fEnabled)
      Specified by:
      enableManagement in interface javax.cache.CacheManager
    • close

      public void close()
      Description copied from interface: Disposable
      Default implementation invokes Disposable.dispose(), it is not recommended that this be overridden.
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface javax.cache.CacheManager
      Specified by:
      close in interface Closeable
      Specified by:
      close in interface Disposable
    • dispose

      public void dispose()
      Description copied from interface: Disposable
      Invoked when all resources owned by the implementer can safely be released.

      Once disposed of the object should no longer be considered to be usable.

      Note the Disposable interface is compatible with try-with-resources which will automatically invoke this method.

      Specified by:
      dispose in interface Disposable
    • isClosed

      public boolean isClosed()
      Specified by:
      isClosed in interface javax.cache.CacheManager
    • unwrap

      public <T> T unwrap(Class<T> clz)
      Specified by:
      unwrap in interface javax.cache.CacheManager
    • getConfigurableCacheFactory

      public ConfigurableCacheFactory getConfigurableCacheFactory()
      Get ConfigurableCacheFactory context.
      Returns:
      ConfigurableCacheFactory
    • releaseCache

      public void releaseCache(String sName)
      release cache named sName
      Parameters:
      sName - JCache Adapter map to release
    • validate

      public boolean validate()
      Validate if configurations map is valid with this instance.
      Returns:
      true iff it is valid
    • toString

      public String toString()
      Overrides:
      toString in class Object