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.
-
-
Constructor Summary
Constructors Constructor Description RibbonManagerCache()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
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 helperRibbonConfiguration
getCachedConfiguration(RibbonManager ribbonManager)
Get the ribbon configuration managed by the RibbonManagerRibbonManager
getManager(String uri)
Create the RibbonManager associated with the given ribbon file.void
initialize()
void
service(ServiceManager manager)
-
Methods inherited from class org.ametys.runtime.plugin.component.AbstractLogEnabled
getLogger, setLogger
-
-
-
-
Constructor Detail
-
RibbonManagerCache
public RibbonManagerCache()
-
-
Method Detail
-
contextualize
public void contextualize(Context context) throws ContextException
- Specified by:
contextualize
in interfaceContextualizable
- Throws:
ContextException
-
service
public void service(ServiceManager manager) throws ServiceException
- Specified by:
service
in interfaceServiceable
- Throws:
ServiceException
-
initialize
public void initialize() throws Exception
- Specified by:
initialize
in interfaceInitializable
- Throws:
Exception
-
getManager
public RibbonManager getManager(String uri) throws Exception
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
public void dispose(RibbonManager ribbonManager)
Dispose of a RibbonManager that was previously retrieve with this helper- Parameters:
ribbonManager
- The ribbon manager
-
getCachedConfiguration
public RibbonConfiguration getCachedConfiguration(RibbonManager ribbonManager)
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
-
-