Class CacheFactory

java.lang.Object
io.micronaut.microstream.cache.CacheFactory

@Factory public class CacheFactory extends Object
Since:
1.0.0
Author:
Tim Yates
  • Constructor Details

    • CacheFactory

      public CacheFactory(io.micronaut.core.convert.ConversionService conversionService)
      Constructor.
      Parameters:
      conversionService - The conversion service
  • Method Details

    • createCache

      @Singleton @Bean(preDestroy="close") @EachBean(one.microstream.cache.types.CacheConfiguration.Builder.class) public <K, V> MicroStreamSyncCache<K,V> createCache(@Parameter String name, one.microstream.cache.types.CacheConfiguration.Builder<K,V> cacheConfigurationBuilder, @Named("io") ExecutorService executorService)
      Create a cache for each CacheConfiguration.
      Type Parameters:
      K - The key type
      V - The key type
      Parameters:
      name - The name of the cache
      cacheConfigurationBuilder - Cache Configuration Builder
      executorService - The IO executor service for async caches
      Returns:
      The cache