Builder(String cacheName, CaffeineConfiguration<K, V> config) { this.config = config; this.cacheName = cacheName; this.caffeine = Caffeine.newBuilder(); this.statistics = new JCacheStatisticsMXBean(); this.ticker = config.getTickerFactory().create(); this.executor = config.getExecutorFactory().create(); this.expiryPolicy = config.getExpiryPolicyFactory().create(); this.dispatcher = new EventDispatcher<>(executor); caffeine.executor(executor); config.getCacheEntryListenerConfigurations().forEach(dispatcher::register); }
Builder(String cacheName, CaffeineConfiguration<K, V> config) { this.config = config; this.cacheName = cacheName; this.caffeine = Caffeine.newBuilder(); this.statistics = new JCacheStatisticsMXBean(); this.ticker = config.getTickerFactory().create(); this.executor = config.getExecutorFactory().create(); this.expiryPolicy = config.getExpiryPolicyFactory().create(); this.dispatcher = new EventDispatcher<>(executor); caffeine.executor(executor); config.getCacheEntryListenerConfigurations().forEach(dispatcher::register); }