Class InfinispanCacheManager

java.lang.Object
io.micronaut.cache.infinispan.InfinispanCacheManager
All Implemented Interfaces:
DynamicCacheManager<org.infinispan.client.hotrod.RemoteCache<Object,Object>>

@Singleton public class InfinispanCacheManager extends Object implements DynamicCacheManager<org.infinispan.client.hotrod.RemoteCache<Object,Object>>
A DynamicCacheManager that creates Infinispan caches on demand.
Since:
1.0.0
Author:
Álvaro Sánchez-Mariscal
See Also:
  • RemoteCacheManagerAdmin.getOrCreateCache(String, BasicConfiguration)
  • Constructor Details

    • InfinispanCacheManager

      public InfinispanCacheManager(org.infinispan.client.hotrod.RemoteCacheManager remoteCacheManager, io.micronaut.core.convert.ConversionService conversionService)
      Parameters:
      remoteCacheManager - the Infinispan remote cache manager
      conversionService - the conversion service
  • Method Details

    • getCache

      @NonNull public @NonNull SyncCache<org.infinispan.client.hotrod.RemoteCache<Object,Object>> getCache(String name)
      Description copied from interface: DynamicCacheManager
      Retrieve a cache for the given name. If the cache does not previously exist, a new one will be created. The cache instance should not be cached internally because the cache manager will maintain the instance for future requests.
      Specified by:
      getCache in interface DynamicCacheManager<org.infinispan.client.hotrod.RemoteCache<Object,Object>>
      Parameters:
      name - The name of the cache
      Returns:
      The SyncCache instance