本文整理汇总了Java中org.alfresco.util.cache.RefreshableCacheListener类的典型用法代码示例。如果您正苦于以下问题:Java RefreshableCacheListener类的具体用法?Java RefreshableCacheListener怎么用?Java RefreshableCacheListener使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
RefreshableCacheListener类属于org.alfresco.util.cache包,在下文中一共展示了RefreshableCacheListener类的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: afterPropertiesSet
import org.alfresco.util.cache.RefreshableCacheListener; //导入依赖的package包/类
@Override
public void afterPropertiesSet() throws Exception
{
super.afterPropertiesSet();
// RefreshableCacheListener as anonymous class since CompileModelsCache already
// implements this interface, but expects to be invoked in different circumstances.
register(new RefreshableCacheListener()
{
@Override
public void onRefreshableCacheEvent(RefreshableCacheEvent event)
{
if (logger.isDebugEnabled())
{
logger.debug("Handling "+event.getClass().getSimpleName()+
", cache="+event.getCacheId()+
", key="+event.getKey());
}
if (event instanceof RefreshableCacheRefreshedEvent &&
event.getCacheId().equals(getCacheId()))
{
// notify registered listeners that dictionary has been initialised (population is complete).
// Note we do that here to ensure that the dictionary registry has been added to the cache,
// so that any dependencies (like the CMIS dictionary) will use the new dictionary.
for (DictionaryListener dictionaryListener : dictionaryDAO.getDictionaryListeners())
{
logger.debug("Calling afterDIctionaryInit ["+event.getClass().getSimpleName()+
", cache="+event.getCacheId()+
", key="+event.getKey()+
"] on "+
dictionaryListener.getClass().getSimpleName());
dictionaryListener.afterDictionaryInit();
}
}
}
@Override
public String getCacheId()
{
return CompiledModelsCache.this.getCacheId();
}
});
}