Package org.ametys.core.ui
Class RibbonManagerCache
java.lang.Object
org.ametys.runtime.plugin.component.AbstractLogEnabled
org.ametys.core.ui.RibbonManagerCache
- All Implemented Interfaces:
LogEnabled
,Initializable
,Component
,Contextualizable
,Serviceable
public class RibbonManagerCache
extends AbstractLogEnabled
implements Contextualizable, Serviceable, Component, Initializable
Helper for RibbonManager, that support Thread safe usage of the managers, while implementing a cache for performances.
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addCachedConfiguration
(RibbonManager ribbonManager, RibbonConfiguration configuration, Map<String, Long> importsValidity) Add a ribbon configuration to the cachevoid
contextualize
(Context context) void
dispose
(RibbonManager ribbonManager) Dispose of a RibbonManager that was previously retrieve with this helpergetCachedConfiguration
(RibbonManager ribbonManager) Get the ribbon configuration managed by the RibbonManagergetManager
(String uri) Create the RibbonManager associated with the given ribbon file.void
void
Invalidate the cachevoid
service
(ServiceManager manager) Methods inherited from class org.ametys.runtime.plugin.component.AbstractLogEnabled
getLogger, setLogger
-
Field Details
-
ROLE
Avalon role
-
-
Constructor Details
-
RibbonManagerCache
public RibbonManagerCache()
-
-
Method Details
-
contextualize
- Specified by:
contextualize
in interfaceContextualizable
- Throws:
ContextException
-
service
- Specified by:
service
in interfaceServiceable
- Throws:
ServiceException
-
initialize
- Specified by:
initialize
in interfaceInitializable
- Throws:
Exception
-
invalidate
Invalidate the cache -
getManager
Create the RibbonManager associated with the given ribbon file. If the RibbonManager already exists for the ribbon file and is still valid, it is simply returned.- Parameters:
uri
- The ribbon configuration uri- Returns:
- The RibbonManager
- Throws:
Exception
- If an error occurs
-
dispose
Dispose of a RibbonManager that was previously retrieve with this helper- Parameters:
ribbonManager
- The ribbon manager
-
getCachedConfiguration
Get the ribbon configuration managed by the RibbonManager- Parameters:
ribbonManager
- The ribbon manager- Returns:
- The configuration, or null if no configuration was cached
-
addCachedConfiguration
public void addCachedConfiguration(RibbonManager ribbonManager, RibbonConfiguration configuration, Map<String, Long> importsValidity) Add a ribbon configuration to the cache- Parameters:
ribbonManager
- The ribbon managerconfiguration
- The configurationimportsValidity
- The list of imports for this ribbon configuration and their validity
-