Package org.alfresco.repo.cache
Class AbstractMTAsynchronouslyRefreshedCache<T>
java.lang.Object
org.alfresco.util.cache.AbstractAsynchronouslyRefreshedCache<T>
org.alfresco.repo.cache.AbstractMTAsynchronouslyRefreshedCache<T>
- All Implemented Interfaces:
Callable<Void>,AsynchronouslyRefreshedCache<T>,RefreshableCache<T>,org.alfresco.util.cache.AsynchronouslyRefreshedCache<T>,org.alfresco.util.cache.RefreshableCache<T>,org.alfresco.util.cache.RefreshableCacheListener,org.alfresco.util.transaction.TransactionListener,org.springframework.beans.factory.Aware,org.springframework.beans.factory.BeanNameAware,org.springframework.beans.factory.InitializingBean
- Direct Known Subclasses:
AuthorityBridgeTableAsynchronouslyRefreshedCache,ConfigDataCache
public abstract class AbstractMTAsynchronouslyRefreshedCache<T>
extends org.alfresco.util.cache.AbstractAsynchronouslyRefreshedCache<T>
implements AsynchronouslyRefreshedCache<T>, org.springframework.beans.factory.InitializingBean
The base implementation for Multi-tenant asynchronously refreshed cache. Currently supports one value per tenant.
Implementors just need to provide buildCache(String tennantId)
- Since:
- 4.1.3
- Author:
- Andy
-
Field Summary
Fields inherited from class org.alfresco.util.cache.AbstractAsynchronouslyRefreshedCache
live, liveLock -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidprotected abstract TbuildCache(String tenantId) Build the cache entry for the specific tenant.voidget()Get the cache.booleanDetermine if the cache is up to datevoidrefresh()Refresh the cache asynchronously.voidsetTenantService(TenantService tenantService) Methods inherited from class org.alfresco.util.cache.AbstractAsynchronouslyRefreshedCache
afterCommit, afterRollback, beforeCommit, beforeCompletion, broadcastEvent, call, forceInChangesForThisUncommittedTransaction, get, getCacheId, init, isUpToDate, onRefreshableCacheEvent, refresh, register, setBeanName, setRegistry, setThreadPoolExecutor, toString, waitForBuildMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.alfresco.repo.cache.AsynchronouslyRefreshedCache
getCacheId
-
Constructor Details
-
AbstractMTAsynchronouslyRefreshedCache
public AbstractMTAsynchronouslyRefreshedCache()
-
-
Method Details
-
setTenantService
- Parameters:
tenantService- the tenantService to set
-
get
Description copied from interface:RefreshableCacheGet the cache. If there is no cache value this call will block. If the underlying cache is being refreshed, the old cache value will be returned until the refresh is complete.- Specified by:
getin interfaceRefreshableCache<T>- Returns:
- T
-
forceInChangesForThisUncommittedTransaction
public void forceInChangesForThisUncommittedTransaction() -
refresh
public void refresh()Description copied from interface:RefreshableCacheRefresh the cache asynchronously.- Specified by:
refreshin interfaceRefreshableCache<T>
-
isUpToDate
public boolean isUpToDate()Description copied from interface:AsynchronouslyRefreshedCacheDetermine if the cache is up to date- Specified by:
isUpToDatein interfaceAsynchronouslyRefreshedCache<T>- Returns:
- true if the cache is not currently refreshing itself
-
buildCache
Build the cache entry for the specific tenant. This method is called in a thread-safe manner i.e. it is only ever called by a single thread.- Specified by:
buildCachein classorg.alfresco.util.cache.AbstractAsynchronouslyRefreshedCache<T>
-
afterPropertiesSet
-