Class CaffeineCacheProviderFactory<K,V>

java.lang.Object
org.springframework.pulsar.cache.provider.caffeine.CaffeineCacheProviderFactory<K,V>
Type Parameters:
K - the type of cache key
V - the type of cache entries
All Implemented Interfaces:
CacheProviderFactory<K,V>

public class CaffeineCacheProviderFactory<K,V> extends Object implements CacheProviderFactory<K,V>
Factory to create instances of CaffeineCacheProvider.
Author:
Chris Bono
  • Constructor Details

    • CaffeineCacheProviderFactory

      public CaffeineCacheProviderFactory()
  • Method Details

    • create

      public CacheProvider<K,V> create(Duration cacheExpireAfterAccess, Long cacheMaximumSize, Integer cacheInitialCapacity, CacheProviderFactory.EvictionListener<K,V> evictionListener)
      Description copied from interface: CacheProviderFactory
      Create a cache provider instance with the specified options.
      Specified by:
      create in interface CacheProviderFactory<K,V>
      Parameters:
      cacheExpireAfterAccess - time period to expire unused entries in the cache
      cacheMaximumSize - maximum size of cache (entries)
      cacheInitialCapacity - the initial size of cache
      evictionListener - listener called when an entry is evicted from the cache
      Returns:
      cache provider instance