Class JCacheManager

  • All Implemented Interfaces:
    Closeable, AutoCloseable, javax.cache.CacheManager

    public class JCacheManager
    extends org.infinispan.jcache.AbstractJCacheManager
    Infinispan's implementation of CacheManager.

    It is possible to manipulate the configuration programmatically by supplying objects through the properties parameter. The following list contains the supported special property names:

    • org.infinispan.configuration.parsing.ConfigurationBuilderHolder an instance of ConfigurationBuilderHolder that will be used instead of attempting to load the configuration file specified by the uri parameter.
    • org.infinispan.configuration.global.GlobalConfigurationBuilder an instance of GlobalConfigurationBuilder that will be used as thebase GlobalConfigurationBuilder before parsing the file specified by the uri parameter.
    • org.infinispan.configuration.global.GlobalConfigurationBuilder-Consumer an instance of Consumer that will be used to manipulate the global configuration after parsing the file specified by the uri parameter.
    • org.infinispan.configuration.cache.Configuration-Function an instance of Function that will be used to obtain the configuration for a cache. If the function returns null, it will use the default configuration.
    Since:
    5.3
    Author:
    Vladimir Blagojevic, Galder ZamarreƱo
    • Field Detail

      • CACHE_CONFIGURATION_FUNCTION

        public static final String CACHE_CONFIGURATION_FUNCTION
      • GLOBAL_CONFIGURATION_CONSUMER

        public static final String GLOBAL_CONFIGURATION_CONSUMER
    • Constructor Detail

      • JCacheManager

        public JCacheManager​(URI uri,
                             ClassLoader classLoader,
                             javax.cache.spi.CachingProvider provider,
                             Properties properties)
        Create a new InfinispanCacheManager given a cache name and a ClassLoader. Cache name might refer to a file on classpath containing Infinispan configuration file.
        Parameters:
        uri - identifies the cache manager
        classLoader - used to load classes stored in this cache manager
        properties - properties used to customize the configuration.
      • JCacheManager

        public JCacheManager​(URI uri,
                             org.infinispan.manager.EmbeddedCacheManager cacheManager,
                             javax.cache.spi.CachingProvider provider)
    • Method Detail

      • unwrap

        public <T> T unwrap​(Class<T> clazz)
      • delegateLogIsClosed

        protected void delegateLogIsClosed()
        Specified by:
        delegateLogIsClosed in class org.infinispan.jcache.AbstractJCacheManager
      • delegateStop

        protected void delegateStop()
        Specified by:
        delegateStop in class org.infinispan.jcache.AbstractJCacheManager
      • delegateCacheNames

        protected Iterable<String> delegateCacheNames()
        Specified by:
        delegateCacheNames in class org.infinispan.jcache.AbstractJCacheManager
      • delegateIsClosed

        protected boolean delegateIsClosed()
        Specified by:
        delegateIsClosed in class org.infinispan.jcache.AbstractJCacheManager
      • delegateRemoveCache

        protected <K,​V> void delegateRemoveCache​(org.infinispan.jcache.AbstractJCache<K,​V> jcache)
        Specified by:
        delegateRemoveCache in class org.infinispan.jcache.AbstractJCacheManager
      • create

        protected <K,​V,​C extends javax.cache.configuration.Configuration<K,​V>> org.infinispan.jcache.AbstractJCache<K,​V> create​(String cacheName,
                                                                                                                                                        C configuration)
        Specified by:
        create in class org.infinispan.jcache.AbstractJCacheManager
      • create

        protected <K,​V,​I extends org.infinispan.commons.api.BasicCache<K,​V>> org.infinispan.jcache.AbstractJCache<K,​V> create​(I ispnCache)
        Specified by:
        create in class org.infinispan.jcache.AbstractJCacheManager