Class CacheProvider

java.lang.Object
io.mangoo.cache.CacheProvider
All Implemented Interfaces:
com.google.inject.Provider<Cache>, javax.inject.Provider<Cache>

public class CacheProvider extends Object implements com.google.inject.Provider<Cache>
Author:
svenkubiak
  • Constructor Details

    • CacheProvider

      @Inject public CacheProvider(Config config)
  • Method Details

    • registerCacheConfiguration

      public void registerCacheConfiguration(String name, org.ehcache.config.CacheConfiguration<String,Object> configuration)
      Registers a new cache with custom configuration
      Parameters:
      name - The name of the cache
      configuration - The configuration for the cache to use
    • getCacheStatistics

      public Map<String,org.ehcache.core.statistics.CacheStatistics> getCacheStatistics()
      Returns a map containing cache names and cache statistics
      Returns:
      Map of cache statistics
    • getCache

      public Cache getCache(CacheName name)
      Retrieves a cache by its name from the cache pool
      Parameters:
      name - The name of the cache
      Returns:
      A Cache instance
    • getCache

      public Cache getCache(String name)
      Retrieves a cache by its name from the cache pool
      Parameters:
      name - The name of the cache
      Returns:
      A Cache instance
    • close

      public void close()
      Closes all caches
    • get

      public Cache get()
      Specified by:
      get in interface com.google.inject.Provider<Cache>
      Specified by:
      get in interface javax.inject.Provider<Cache>