Class GuavaCacheManager
- java.lang.Object
-
- org.ametys.runtime.plugin.component.AbstractLogEnabled
-
- org.ametys.core.cache.AbstractCacheManager
-
- org.ametys.plugins.core.impl.cache.GuavaCacheManager
-
- All Implemented Interfaces:
LogEnabled
,RequestListener
,Initializable
,Component
,Contextualizable
,Serviceable
public class GuavaCacheManager extends AbstractCacheManager
Implementation of AbstractCacheManager to create new Cache using GuavaCache implementation
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.ametys.core.cache.AbstractCacheManager
AbstractCacheManager.CacheInfo, AbstractCacheManager.CacheType
-
-
Field Summary
Fields Modifier and Type Field Description protected boolean
_canComputeSize
Is size computable on this configuration-
Fields inherited from class org.ametys.core.cache.AbstractCacheManager
_context, _memoryCaches, _requestCaches, _requestListenerManager, _requestsCacheInfos, _requestsCacheStats, ROLE
-
-
Constructor Summary
Constructors Constructor Description GuavaCacheManager()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected Cache
_createCache(String id, I18nizableText name, I18nizableText description, boolean computableSize, Duration duration, boolean isDispatchable)
Create a new cachevoid
initialize()
-
Methods inherited from class org.ametys.core.cache.AbstractCacheManager
_createCache, contextualize, createMemoryCache, createRequestCache, get, getAllCaches, getCachesAsJSONMap, hasCache, refreshStats, removeCache, requestEnded, requestStarted, service, setSize
-
Methods inherited from class org.ametys.runtime.plugin.component.AbstractLogEnabled
getLogger, setLogger
-
-
-
-
Field Detail
-
_canComputeSize
protected boolean _canComputeSize
Is size computable on this configuration
-
-
Constructor Detail
-
GuavaCacheManager
public GuavaCacheManager()
-
-
Method Detail
-
initialize
public void initialize() throws Exception
- Specified by:
initialize
in interfaceInitializable
- Overrides:
initialize
in classAbstractCacheManager
- Throws:
Exception
-
_createCache
protected Cache _createCache(String id, I18nizableText name, I18nizableText description, boolean computableSize, Duration duration, boolean isDispatchable)
Description copied from class:AbstractCacheManager
Create a new cache- Specified by:
_createCache
in classAbstractCacheManager
- Parameters:
id
- the id of the cachename
- the name of the cachedescription
- the description of the cachecomputableSize
- true if the size of the cache can be computedduration
- the length of time after an entry is created that it should be automatically removedisDispatchable
- true if the cache can be transmitted in sub-requests of DispatchGenerator- Returns:
- new cache
-
-