Class CaffeineCacheControlPanel

All Implemented Interfaces:
ConfigurableControlPanel, ControlPanel<AbstractCacheControlPanel.Body>, io.micronaut.core.naming.Named, io.micronaut.core.order.Ordered, io.micronaut.core.util.Toggleable

@EachBean(io.micronaut.cache.caffeine.DefaultSyncCache.class) public class CaffeineCacheControlPanel extends AbstractCacheControlPanel<io.micronaut.cache.caffeine.DefaultSyncCache>
Control panel for managing Caffeine caches. Provides cache information and operations specific to Caffeine-based caches.
Since:
2.0.0
Author:
Álvaro Sánchez-Mariscal
  • Constructor Details

    • CaffeineCacheControlPanel

      protected CaffeineCacheControlPanel(@Parameter io.micronaut.cache.caffeine.DefaultSyncCache cache, @Named("cache") ControlPanelConfiguration configuration)
      Constructor.
      Parameters:
      cache - the Caffeine cache instance
      configuration - the control panel configuration
  • Method Details

    • getCache

      protected io.micronaut.cache.caffeine.DefaultSyncCache getCache()
      Specified by:
      getCache in class AbstractCacheControlPanel<io.micronaut.cache.caffeine.DefaultSyncCache>
    • getCacheSize

      protected Optional<Long> getCacheSize()
      Description copied from class: AbstractCacheControlPanel
      Attempts to determine the size of the cache. Supports Map-based caches and Iterable-based caches. Subclasses can override this method to provide more accurate size calculations for specific cache implementations.
      Overrides:
      getCacheSize in class AbstractCacheControlPanel<io.micronaut.cache.caffeine.DefaultSyncCache>
      Returns:
      an Optional containing the cache size, or empty if it cannot be determined
    • getCacheAsMap

      protected Map<String,Object> getCacheAsMap()
      Specified by:
      getCacheAsMap in class AbstractCacheControlPanel<io.micronaut.cache.caffeine.DefaultSyncCache>
    • getIcon

      public String getIcon()
      Returns the icon for Caffeine cache control panels.
      Specified by:
      getIcon in interface ConfigurableControlPanel
      Overrides:
      getIcon in class AbstractCacheControlPanel<io.micronaut.cache.caffeine.DefaultSyncCache>
      Returns:
      the icon name