当前位置: 首页>>代码示例>>Java>>正文


Java RefreshableCacheListener类代码示例

本文整理汇总了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();
        }
    }); 
}
 
开发者ID:Alfresco,项目名称:alfresco-data-model,代码行数:45,代码来源:CompiledModelsCache.java


注:本文中的org.alfresco.util.cache.RefreshableCacheListener类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。