Package org.alfresco.repo.config
Class ConfigDataCache
- java.lang.Object
-
- org.alfresco.util.cache.AbstractAsynchronouslyRefreshedCache<T>
-
- org.alfresco.repo.cache.AbstractMTAsynchronouslyRefreshedCache<ConfigDataCache.ConfigData>
-
- org.alfresco.repo.config.ConfigDataCache
-
- All Implemented Interfaces:
java.util.concurrent.Callable<java.lang.Void>,AsynchronouslyRefreshedCache<ConfigDataCache.ConfigData>,RefreshableCache<ConfigDataCache.ConfigData>,org.alfresco.util.cache.AsynchronouslyRefreshedCache<ConfigDataCache.ConfigData>,org.alfresco.util.cache.RefreshableCache<ConfigDataCache.ConfigData>,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
public class ConfigDataCache extends AbstractMTAsynchronouslyRefreshedCache<ConfigDataCache.ConfigData>
An innder class that uses theconfig serviceto asynchronously refresh tenant config data. Cluster-wide invalidation messages mean that we have to be very careful about only making updates to caches when entries really change. However, the nature of theConfigServicehierarchy makes it very difficult to do this in a deterministic manner without performing write locks that run across tenants. By receiving asynchronous messages to refresh we no longer have to rely on a cluster-aware cache.- Since:
- 4.1.5
- Author:
- Derek Hulley, Andy Hind
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classConfigDataCache.ConfigDataData containing all a tenant's required UI configurationstatic classConfigDataCache.ImmutableConfigDataImmutable version ofConfigDataCache.ConfigDatato ensure cast-iron safety of data being put into the caches.
-
Constructor Summary
Constructors Constructor Description ConfigDataCache()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected ConfigDataCache.ConfigDatabuildCache(java.lang.String tenantId)Build the cache entry for the specific tenant.voidsetRepoXMLConfigService(RepoXMLConfigService repoXMLConfigService)Set the config service.-
Methods inherited from class org.alfresco.repo.cache.AbstractMTAsynchronouslyRefreshedCache
afterPropertiesSet, forceInChangesForThisUncommittedTransaction, get, isUpToDate, refresh, setTenantService
-
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, waitForBuild
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.alfresco.repo.cache.AsynchronouslyRefreshedCache
getCacheId
-
-
-
-
Method Detail
-
setRepoXMLConfigService
public void setRepoXMLConfigService(RepoXMLConfigService repoXMLConfigService)
Set the config service. Depending on the order of injection, this might have to be done by code.
-
buildCache
protected ConfigDataCache.ConfigData buildCache(java.lang.String tenantId)
Description copied from class:AbstractMTAsynchronouslyRefreshedCacheBuild 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 classAbstractMTAsynchronouslyRefreshedCache<ConfigDataCache.ConfigData>
-
-