public abstract class AbstractAsynchronouslyRefreshedCache extends java.lang.Object implements AsynchronouslyRefreshedCache, RefreshableCacheListener, java.util.concurrent.Callable, org.springframework.beans.factory.BeanNameAware, org.springframework.beans.factory.InitializingBean, TransactionListener
| Constructor and Description |
|---|
AbstractAsynchronouslyRefreshedCache() |
| Modifier and Type | Method and Description |
|---|---|
void |
afterCommit()
Invoked after transaction commit.
|
void |
afterPropertiesSet() |
void |
afterRollback()
Invoked after transaction rollback.
|
void |
beforeCommit(boolean readOnly)
Called before a transaction is committed.
|
void |
beforeCompletion()
Invoked before transaction commit/rollback.
|
void |
broadcastEvent(RefreshableCacheEvent event) |
protected abstract java.lang.Object |
buildCache(java.lang.String tenantId)
Build the cache entry for the specific tenant.
|
java.lang.Void |
call() |
void |
flush() |
void |
forceInChangesForThisUncommittedTransaction() |
java.lang.Object |
get()
Get the cache.
|
java.lang.String |
getCacheId()
Get the cache id
|
void |
init() |
boolean |
isUpToDate()
Determine if the cache is up to date
|
void |
onRefreshableCacheEvent(RefreshableCacheEvent refreshableCacheEvent)
Callback made when a cache refresh occurs
|
void |
refresh()
Refresh the cache asynchronously.
|
void |
register(RefreshableCacheListener listener)
Register to be informed when the cache is updated in the background.
|
void |
setBeanName(java.lang.String name) |
void |
setRegistry(AsynchronouslyRefreshedCacheRegistry registry) |
void |
setTenantService(org.alfresco.repo.tenant.TenantService tenantService) |
void |
setThreadPoolExecutor(java.util.concurrent.ThreadPoolExecutor threadPoolExecutor) |
protected void |
waitForBuild(org.alfresco.repo.cache.AbstractAsynchronouslyRefreshedCache.Refresh refresh) |
public AbstractAsynchronouslyRefreshedCache()
public void register(RefreshableCacheListener listener)
RefreshableCacheregister in interface RefreshableCachepublic void setThreadPoolExecutor(java.util.concurrent.ThreadPoolExecutor threadPoolExecutor)
threadPool - the threadPool to setpublic void setRegistry(AsynchronouslyRefreshedCacheRegistry registry)
registry - the registry to setpublic void setTenantService(org.alfresco.repo.tenant.TenantService tenantService)
tenantService - the tenantService to setpublic void init()
public java.lang.Object get()
RefreshableCacheget in interface RefreshableCachepublic void forceInChangesForThisUncommittedTransaction()
protected void waitForBuild(org.alfresco.repo.cache.AbstractAsynchronouslyRefreshedCache.Refresh refresh)
public void refresh()
RefreshableCacherefresh in interface RefreshableCachepublic void onRefreshableCacheEvent(RefreshableCacheEvent refreshableCacheEvent)
RefreshableCacheListeneronRefreshableCacheEvent in interface RefreshableCacheListenerpublic boolean isUpToDate()
AsynchronouslyRefreshedCacheisUpToDate in interface AsynchronouslyRefreshedCachepublic java.lang.Void call()
call in interface java.util.concurrent.Callablepublic void setBeanName(java.lang.String name)
setBeanName in interface org.springframework.beans.factory.BeanNameAwarepublic java.lang.String getCacheId()
AsynchronouslyRefreshedCachegetCacheId in interface AsynchronouslyRefreshedCachegetCacheId in interface RefreshableCacheListenerprotected abstract java.lang.Object buildCache(java.lang.String tenantId)
public void afterPropertiesSet()
throws java.lang.Exception
afterPropertiesSet in interface org.springframework.beans.factory.InitializingBeanjava.lang.Exceptionpublic void broadcastEvent(RefreshableCacheEvent event)
public void flush()
flush in interface TransactionListenerpublic void beforeCommit(boolean readOnly)
TransactionListenerAll transaction resources are still available.
beforeCommit in interface TransactionListenerreadOnly - true if the transaction is read-onlypublic void beforeCompletion()
TransactionListenerTransactionListener.beforeCommit(boolean) even if TransactionListener.beforeCommit(boolean)
failed.
All transaction resources are still available.
beforeCompletion in interface TransactionListenerpublic void afterCommit()
TransactionListenerAny exceptions generated here will only be logged and will have no effect on the state of the transaction.
Although all transaction resources are still available, this method should be used only for cleaning up resources after a commit has occured.
afterCommit in interface TransactionListenerpublic void afterRollback()
TransactionListenerAny exceptions generated here will only be logged and will have no effect on the state of the transaction.
Although all transaction resources are still available, this method should be used only for cleaning up resources after a rollback has occured.
afterRollback in interface TransactionListenerCopyright © 2005 - 2013 Alfresco Software, Inc. All Rights Reserved.