Package io.micronaut.microstream.cache
Class CacheFactory
java.lang.Object
io.micronaut.microstream.cache.CacheFactory
- Since:
- 1.0.0
- Author:
- Tim Yates
-
Constructor Summary
ConstructorDescriptionCacheFactory
(io.micronaut.core.convert.ConversionService conversionService) Constructor. -
Method Summary
Modifier and TypeMethodDescription<K,
V> MicroStreamSyncCache<K, V> createCache
(String name, one.microstream.cache.types.CacheConfiguration.Builder<K, V> cacheConfigurationBuilder, ExecutorService executorService) Create a cache for each CacheConfiguration.
-
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 typeV
- The key type- Parameters:
name
- The name of the cachecacheConfigurationBuilder
- Cache Configuration BuilderexecutorService
- The IO executor service for async caches- Returns:
- The cache
-