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
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddCachedConfiguration(RibbonManager ribbonManager, RibbonConfiguration configuration, Map<String, Long> importsValidity) Add a ribbon configuration to the cachevoidcontextualize(Context context) voiddispose(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.voidvoidInvalidate the cachevoidservice(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:
contextualizein interfaceContextualizable- Throws:
ContextException
-
service
- Specified by:
servicein interfaceServiceable- Throws:
ServiceException
-
initialize
- Specified by:
initializein 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
-