如果我有以下配置:
<defaultCache timeToIdleSeconds="120"
timeToLiveSeconds="120" />
<cache name="test"
timeToLiveSeconds="300" />
会有什么价值timeToIdleSeconds
用于缓存test
?它会从默认缓存继承,从而等于 120,还是会采用手册中给出的默认值,即 0(无穷大)?
timeToIdleSeconds 将是默认值,并且不继承自“defaultCache”。 “defaultCache”有点用词不当/误导,因为它没有为每个缓存提供“默认值”,但它只是为可以/动态添加的缓存指定配置的一种方法 - 使用cacheManager.addCache(String cacheName )。
From http://www.ehcache.org/ehcache.xml http://www.ehcache.org/ehcache.xml,该标签的文档如下
Default Cache configuration.
These settings will be applied to caches created programmatically using
CacheManager.add(String cacheName). This element is optional, and using
CacheManager.add(String cacheName) when its not present will throw CacheException
The defaultCache has an implicit name "default" which is a reserved cache name.
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)