public class RibbonManagerCache extends AbstractLogEnabled implements Contextualizable, Serviceable, Component
Modifier and Type | Field and Description |
---|---|
private ServiceManager |
_cocoonManager |
private Context |
_context |
private SourceResolver |
_resolver |
private Map<RibbonManager,RibbonConfiguration> |
_ribbonConfigurationCache |
private RibbonControlsManager |
_ribbonControlsManager |
private Map<String,RibbonManager> |
_ribbonManagerCache |
private Map<RibbonManager,Map<String,Long>> |
_ribbonManagerCacheValidity |
private Map<RibbonManager,Integer> |
_ribbonManagerUsageCache |
private Map<RibbonManager,ThreadSafeComponentManager<Object>> |
_ribbonServiceManagers |
private RibbonTabsManager |
_ribbonTabsManager |
static String |
ROLE
Avalon role
|
Constructor and Description |
---|
RibbonManagerCache() |
Modifier and Type | Method and Description |
---|---|
private RibbonManager |
_createRibbonManager() |
private void |
_decreaseUsage(RibbonManager ribbonManager,
boolean forceRemove) |
private void |
_increaseUsage(RibbonManager ribbonManager) |
private boolean |
_isRibbonEntryStillValid(Long cachedValidity,
RibbonConfigurationSource ribbonEntrySource) |
private boolean |
_isRibbonManagerStillValid(RibbonManager ribbonManager) |
void |
addCachedConfiguration(RibbonManager ribbonManager,
RibbonConfiguration configuration,
Map<String,Long> importsValidity)
Add a ribbon configuration to the cache
|
void |
contextualize(Context context) |
void |
dispose(RibbonManager ribbonManager)
Dispose of a RibbonManager that was previously retrieve with this helper
|
RibbonConfiguration |
getCachedConfiguration(RibbonManager ribbonManager)
Get the ribbon configuration managed by the RibbonManager
|
RibbonManager |
getManager(String uri)
Create the RibbonManager associated with the given ribbon file.
|
void |
service(ServiceManager manager) |
getLogger, setLogger
private Map<String,RibbonManager> _ribbonManagerCache
private Map<RibbonManager,Map<String,Long>> _ribbonManagerCacheValidity
private Map<RibbonManager,Integer> _ribbonManagerUsageCache
private Map<RibbonManager,RibbonConfiguration> _ribbonConfigurationCache
private Map<RibbonManager,ThreadSafeComponentManager<Object>> _ribbonServiceManagers
private ServiceManager _cocoonManager
private RibbonControlsManager _ribbonControlsManager
private RibbonTabsManager _ribbonTabsManager
private SourceResolver _resolver
public RibbonManagerCache()
public void contextualize(Context context) throws ContextException
contextualize
in interface Contextualizable
ContextException
public void service(ServiceManager manager) throws ServiceException
service
in interface Serviceable
ServiceException
public RibbonManager getManager(String uri) throws Exception
uri
- The ribbon configuration uriException
- If an error occursprivate boolean _isRibbonManagerStillValid(RibbonManager ribbonManager)
private boolean _isRibbonEntryStillValid(Long cachedValidity, RibbonConfigurationSource ribbonEntrySource)
private RibbonManager _createRibbonManager() throws Exception
Exception
public void dispose(RibbonManager ribbonManager)
ribbonManager
- The ribbon managerprivate void _increaseUsage(RibbonManager ribbonManager)
private void _decreaseUsage(RibbonManager ribbonManager, boolean forceRemove)
public RibbonConfiguration getCachedConfiguration(RibbonManager ribbonManager)
ribbonManager
- The ribbon managerpublic void addCachedConfiguration(RibbonManager ribbonManager, RibbonConfiguration configuration, Map<String,Long> importsValidity)
ribbonManager
- The ribbon managerconfiguration
- The configurationimportsValidity
- The list of imports for this ribbon configuration and their validity