Class AbstractCacheControlPanel<C extends io.micronaut.cache.SyncCache<?>>
java.lang.Object
io.micronaut.controlpanel.core.AbstractControlPanel<AbstractCacheControlPanel.Body>
io.micronaut.controlpanel.core.AbstractEachBeanControlPanel<AbstractCacheControlPanel.Body>
io.micronaut.controlpanel.panels.cache.AbstractCacheControlPanel<C>
- Type Parameters:
C- the cache type
- All Implemented Interfaces:
ConfigurableControlPanel,ControlPanel<AbstractCacheControlPanel.Body>,io.micronaut.core.naming.Named,io.micronaut.core.order.Ordered,io.micronaut.core.util.Toggleable
- Direct Known Subclasses:
CaffeineCacheControlPanel,EhcacheControlPanel,HazelcastSyncCacheControlPanel,InfinispanSyncCacheControlPanel
public abstract class AbstractCacheControlPanel<C extends io.micronaut.cache.SyncCache<?>>
extends AbstractEachBeanControlPanel<AbstractCacheControlPanel.Body>
Base class for control panels for managing caches.
This class provides common functionality for displaying cache information
and operations in the Micronaut Control Panel.
- Since:
- 2.0.0
- Author:
- Álvaro Sánchez-Mariscal
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordRecord containing the data to display in the cache control panel.Nested classes/interfaces inherited from interface io.micronaut.controlpanel.core.ControlPanel
ControlPanel.Category, ControlPanel.View -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe property name to enable/disable cache control panels.static final StringThe name of the cache control panel category.Fields inherited from class io.micronaut.controlpanel.core.AbstractControlPanel
configuration, controlPanelNameFields inherited from interface io.micronaut.core.order.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedAbstractCacheControlPanel(String controlPanelName, ControlPanelConfiguration configuration) Constructor. -
Method Summary
Modifier and TypeMethodDescriptiongetBadge()Returns the badge displaying the cache size, or the default badge if size cannot be determined.protected StringReturns the name of the bean this control panel represents.getBody()Used to render the body of the control panel.protected abstract CgetCache()Attempts to determine the size of the cache.Returns the category for cache control panels.getIcon()Returns the icon for cache control panels.protected StringReturns the name of the panel category.Methods inherited from class io.micronaut.controlpanel.core.AbstractEachBeanControlPanel
getBodyView, getDetailedView, getName, getTitleMethods inherited from class io.micronaut.controlpanel.core.AbstractControlPanel
getOrder, isEnabledMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.micronaut.controlpanel.core.ControlPanel
hasDetails
-
Field Details
-
NAME
The name of the cache control panel category.- See Also:
-
ENABLED_PROPERTY
The property name to enable/disable cache control panels.- See Also:
-
-
Constructor Details
-
AbstractCacheControlPanel
protected AbstractCacheControlPanel(String controlPanelName, @Named("cache") ControlPanelConfiguration configuration) Constructor.- Parameters:
controlPanelName- the control panel nameconfiguration- the control panel configuration
-
-
Method Details
-
getCache
-
getBeanName
Description copied from class:AbstractEachBeanControlPanelReturns the name of the bean this control panel represents.- Specified by:
getBeanNamein classAbstractEachBeanControlPanel<AbstractCacheControlPanel.Body>- Returns:
- the bean name
-
getBody
Description copied from interface:ControlPanelUsed to render the body of the control panel.- Returns:
- the body of the control panel.
-
getPanelName
Description copied from class:AbstractEachBeanControlPanelReturns the name of the panel category.- Specified by:
getPanelNamein classAbstractEachBeanControlPanel<AbstractCacheControlPanel.Body>- Returns:
- the panel name
-
getBadge
Returns the badge displaying the cache size, or the default badge if size cannot be determined.- Returns:
- the badge text
-
getCacheSize
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.- Returns:
- an Optional containing the cache size, or empty if it cannot be determined
-
getCacheAsMap
-
getCategory
Returns the category for cache control panels.- Returns:
- the cache category
-
getIcon
Returns the icon for cache control panels.- Specified by:
getIconin interfaceConfigurableControlPanel- Overrides:
getIconin classAbstractControlPanel<AbstractCacheControlPanel.Body>- Returns:
- the icon name
-