alfresco中的ehcache介绍

本文介绍了Alfresco中使用的Ehcache缓存技术,包括两种主要的缓存类型:transactionalEHCacheManager和internalEHCacheManager。详细讨论了它们的作用、配置以及在Alfresco系统中的应用。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

一、alfresco中的ehcache介绍

为了提高系统性能,alfresco采用了许多不同的方法,使用cache就是其中之一。alfresco使用了ehcache作为其缓存。最新使用的ehcache的版本为 ehcache-core-2.0.0.jar

在alfresco中有两类ehcache:一个是用于事务的beanName为transactionalEHCacheManager,类名为org.alfresco.repo.cache.EhCacheManagerFactoryBean,不能覆盖或者集群使用;

另一个是用于共享的缓存beanName为internalEHCacheManager,类名为org.alfresco.repo.cache.InternalEhCacheManagerFactoryBean,这个缓存作为hibernate二级缓存用,在hibernate.cfg.xml中可以看到org.alfresco.repo.cache.InternalEhCacheManagerFactoryBean作为jdbc connection中hibernate.cache.provider_class属性的值。

transactionalEHCacheManager提供getObject()方法获得net.sf.ehcache.CacheManager的实例,返回的类型是Object;
internalEHCacheManager提供getObject()方法和getInstance()获得net.sf.ehcache.CacheManager的实例,区别是getObject()方法返回类型是Object,getInstance()返回类型是net.sf.ehcache.CacheManager;同时提供的buildCache()方法返回的是经过org.hibernate.cache.EhCache.EhCache(Cache cache)封装后的对象,即作为hibernate的二级缓存用。

transactionalEHCacheManager的配置文件是alfresco/ehcache-transactional.xml,在cache-context.xml中描述。
internalEHCacheManager的配置文件是alfresco/extension/ehcache-custom.xml和alfresco/ehcache-default.xml,先加载custom.xml,如果没有这个文件,再尝试加载default.xml文件。配置文件在类中设定。


二、两者的关系

所有的共享类型的缓存 Shared Cache都在cache-context.xml中被注入到事务类型的缓存中。

所有的事务类型的缓存都在ehcache-default.xml中有同名的cache的定义,以及在hibernate-context.xml 中被赋值给需要缓存的内容Dao的实现,比如qnameEntityCache赋值给qnameDAO。

三、alfresco中cache的内容
下面是alfreso中的cache缓存的内容,每种类型都包括两个缓存:即事务缓存和共享缓存。
ID lookup for QName entities
ID lookup for Namespace entities
ID lookup for Locale entities
Store and Node ID cache lookup
Parent Associations lookup for nodes
Authority container look up for users
Permissions access cache
Node owner cache
Person username to NodeRef cache
Authentication Ticket Cache
SysAdmin (JMX Config) Cache
AVM Lookup Cache
AVM Store lookup cache
WebServices Query Session Cache
ACL cache
Messages Caches
–LoadedResourceBundles
–ResourceBundleBaseNames
Dictionary / Namespace Caches
–UriToModels
–CompiledModels
Namespace Uris
–urisCache
–prefixesCache
Web Scripts Caches

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值