Class DefaultDynamicCacheManager

java.lang.Object
io.micronaut.cache.caffeine.DefaultDynamicCacheManager
All Implemented Interfaces:
DynamicCacheManager<com.github.benmanes.caffeine.cache.Cache>

@Singleton @Requires(missingBeans=DynamicCacheManager.class) @Requires(property="micronaut.cache.dynamic",notEquals="false") public class DefaultDynamicCacheManager extends Object implements DynamicCacheManager<com.github.benmanes.caffeine.cache.Cache>
Default DynamicCacheManager implementation that creates DefaultSyncCaches with default values.
Since:
1.3.0
Author:
Álvaro Sánchez-Mariscal
  • Constructor Summary

    Constructors
    Constructor
    Description
    DefaultDynamicCacheManager(io.micronaut.context.ApplicationContext applicationContext, io.micronaut.core.convert.ConversionService conversionService, io.micronaut.runtime.ApplicationConfiguration applicationConfiguration)
    Creates a default dynamic cache manager.
  • Method Summary

    Modifier and Type
    Method
    Description
    @NonNull SyncCache<com.github.benmanes.caffeine.cache.Cache>
    Retrieve a cache for the given name.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • DefaultDynamicCacheManager

      public DefaultDynamicCacheManager(io.micronaut.context.ApplicationContext applicationContext, io.micronaut.core.convert.ConversionService conversionService, io.micronaut.runtime.ApplicationConfiguration applicationConfiguration)
      Creates a default dynamic cache manager.
      Parameters:
      applicationContext - the application context
      conversionService - the conversion service
      applicationConfiguration - the application configuration
  • Method Details

    • getCache

      @NonNull public @NonNull SyncCache<com.github.benmanes.caffeine.cache.Cache> 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<com.github.benmanes.caffeine.cache.Cache>
      Parameters:
      name - The name of the cache
      Returns:
      The SyncCache instance