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
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
Modifier and TypeFieldDescriptionprotected boolean
Is size computable on this configurationFields inherited from class org.ametys.core.cache.AbstractCacheManager
_context, _memoryCaches, _requestCaches, _requestListenerManager, _requestsCacheInfos, _requestsCacheStats, ROLE
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected Cache
_createCache
(String id, I18nizableText name, I18nizableText description, boolean computableSize, Duration duration, boolean isDispatchable) Create a new cachevoid
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 Details
-
_canComputeSize
Is size computable on this configuration
-
-
Constructor Details
-
GuavaCacheManager
public GuavaCacheManager()
-
-
Method Details
-
initialize
- 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
-