Package fr.becpg.repo.cache.impl
Class BeCPGCacheServiceImpl
java.lang.Object
fr.becpg.repo.cache.impl.BeCPGCacheServiceImpl
- All Implemented Interfaces:
BeCPGCacheService,org.alfresco.util.cache.RefreshableCacheListener,org.springframework.beans.factory.InitializingBean
public class BeCPGCacheServiceImpl
extends Object
implements BeCPGCacheService, org.springframework.beans.factory.InitializingBean, org.alfresco.util.cache.RefreshableCacheListener
BeCPGCacheServiceImpl class.
- Version:
- $Id: $Id
- Author:
- matthieu
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate booleanprivate static final intprivate booleanprivate static final org.apache.commons.logging.Logprivate org.alfresco.util.cache.AsynchronouslyRefreshedCacheRegistry -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidvoidclearAllCaches.voidclearCache(String cacheName) clearCache.private StringcomputeCacheKey(String cacheKey) <T> TgetFromCache(String cacheName, String cacheKey) getFromCache.<T> TgetFromCache(String cacheName, String cacheKey, Supplier<T> cacheDataProviderCallBack) getFromCache.<T> TgetFromCache(String cacheName, String cacheKey, Supplier<T> cacheDataProviderCallBack, boolean deleteOnTxRollback) getFromCache.<T> TgetFromTransactionCache(String cacheName, String itemKey, Supplier<T> valueSupplier) Gets a value from the transaction cache, computing it if not presentvoidonRefreshableCacheEvent(org.alfresco.util.cache.RefreshableCacheEvent refreshableCacheEvent) voidprintCacheInfos.voidremoveFromCache(String cacheName, String cacheKey) removeFromCache.voidsetCacheSizes(Map<String, Integer> cacheSizes) Setter for the fieldcacheSizes.voidsetDisableAllCache(boolean disableAllCache) Setter for the fielddisableAllCache.voidsetRegistry(org.alfresco.util.cache.AsynchronouslyRefreshedCacheRegistry registry) Setter for the fieldregistry.<T> voidstoreInCache(String cacheName, String cacheKey, T data) storeInCache.
-
Field Details
-
logger
private static final org.apache.commons.logging.Log logger -
cacheSizes
-
isDebugEnable
private boolean isDebugEnable -
disableAllCache
private boolean disableAllCache -
registry
private org.alfresco.util.cache.AsynchronouslyRefreshedCacheRegistry registry -
INITIAL_CACHE_MAP_SIZE
private static final int INITIAL_CACHE_MAP_SIZE- See Also:
-
caches
-
-
Constructor Details
-
BeCPGCacheServiceImpl
public BeCPGCacheServiceImpl()
-
-
Method Details
-
afterPropertiesSet
- Specified by:
afterPropertiesSetin interfaceorg.springframework.beans.factory.InitializingBean- Throws:
Exception
-
setDisableAllCache
public void setDisableAllCache(boolean disableAllCache) Setter for the field
disableAllCache.- Parameters:
disableAllCache- a boolean.
-
setCacheSizes
Setter for the field
cacheSizes.- Parameters:
cacheSizes- aMapobject.
-
setRegistry
public void setRegistry(org.alfresco.util.cache.AsynchronouslyRefreshedCacheRegistry registry) Setter for the field
registry.- Parameters:
registry- aAsynchronouslyRefreshedCacheRegistryobject
-
getFromCache
getFromCache.
- Specified by:
getFromCachein interfaceBeCPGCacheService- Type Parameters:
T- a T class- Parameters:
cacheName- aStringobject.cacheKey- aStringobject.cacheDataProviderCallBack- a Supplier object.- Returns:
- a T object.
-
storeInCache
storeInCache.
- Specified by:
storeInCachein interfaceBeCPGCacheService- Type Parameters:
T- a T class- Parameters:
cacheName- aStringobject.cacheKey- aStringobject.data- a T object.
-
getFromCache
getFromCache.
- Specified by:
getFromCachein interfaceBeCPGCacheService- Type Parameters:
T- a T class- Parameters:
cacheName- aStringobject.cacheKey- aStringobject..- Returns:
- a T object.
-
getFromCache
public <T> T getFromCache(String cacheName, String cacheKey, Supplier<T> cacheDataProviderCallBack, boolean deleteOnTxRollback) getFromCache.
- Specified by:
getFromCachein interfaceBeCPGCacheService- Type Parameters:
T- a T class- Parameters:
cacheName- aStringobject.cacheKey- aStringobject.cacheDataProviderCallBack- a Supplier object.deleteOnTxRollback- a boolean.- Returns:
- a T object.
-
removeFromCache
removeFromCache.
- Specified by:
removeFromCachein interfaceBeCPGCacheService- Parameters:
cacheName- aStringobject.cacheKey- aStringobject.
-
getFromTransactionCache
Gets a value from the transaction cache, computing it if not present- Specified by:
getFromTransactionCachein interfaceBeCPGCacheService- Type Parameters:
T- The type of the value- Parameters:
cacheName- The cache name (used as part of the transaction resource key)itemKey- aStringobjectvalueSupplier- aSupplierobject- Returns:
- The cached or computed value
-
clearCache
clearCache.
- Specified by:
clearCachein interfaceBeCPGCacheService- Parameters:
cacheName- aStringobject.
-
clearAllCaches
public void clearAllCaches()clearAllCaches.
- Specified by:
clearAllCachesin interfaceBeCPGCacheService
-
computeCacheKey
-
printCacheInfos
public void printCacheInfos()printCacheInfos.
- Specified by:
printCacheInfosin interfaceBeCPGCacheService
-
onRefreshableCacheEvent
public void onRefreshableCacheEvent(org.alfresco.util.cache.RefreshableCacheEvent refreshableCacheEvent) - Specified by:
onRefreshableCacheEventin interfaceorg.alfresco.util.cache.RefreshableCacheListener
-
getCacheId
- Specified by:
getCacheIdin interfaceorg.alfresco.util.cache.RefreshableCacheListener
-