Class 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
    • Method Detail

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

        public String getDomainPartition()
        Return the domain partition if it exists and it is not the global domain partition.
        Returns:
        non-global domain partition if it exists for m_ccf
      • getContainerManagedCacheManager

        public static javax.cache.CacheManager getContainerManagedCacheManager​(ExtensibleConfigurableCacheFactory eccf)
        Convenience and short cut method to get container-managed CacheManager of an ECCF.
        Parameters:
        eccf - ExtensibleConfigurableCacheFactory
        Returns:
        the container managed CacheManager of this ECCF if one exists.
      • 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