本文整理了Java中net.sf.ehcache.config.Configuration.diskStore()
方法的一些代码示例,展示了Configuration.diskStore()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Configuration.diskStore()
方法的具体详情如下:
包路径:net.sf.ehcache.config.Configuration
类名称:Configuration
方法名:diskStore
[英]Builder to add a disk store to the cache manager, only one disk store can be added.
[中]要将磁盘存储添加到缓存管理器,只能添加一个磁盘存储。
代码示例来源:origin: bonitasoft/bonita-engine
protected void buildCacheManagerWithDefaultConfiguration() throws SCacheException {
if (cacheManager != null) {
String message = "Unable to build a new Cache Manager as the existing one is still alive: " + cacheManager + ". ";
if (logger.isLoggable(this.getClass(), TechnicalLogSeverity.TRACE)) {
message += ". Last creation was: \n" + cacheManagerLastCreation;
}
throw new SCacheException(message);
}
final Configuration configuration = new Configuration();
configuration.setDefaultCacheConfiguration(defaultCacheConfiguration);
configuration.diskStore(new DiskStoreConfiguration().path(diskStorePath));
cacheManager = new CacheManager(configuration);
if (logger.isLoggable(this.getClass(), TechnicalLogSeverity.TRACE)) {
cacheManagerLastCreation = getCacheManagerCreationDetails();
}
}
代码示例来源:origin: bonitasoft/bonita-engine
protected void buildCacheManagerWithDefaultConfiguration() throws SCacheException {
if (cacheManager != null) {
String message = "Unable to build a new Cache Manager as the existing one is still alive: " + cacheManager + ". ";
if (logger.isLoggable(this.getClass(), TechnicalLogSeverity.TRACE)) {
message += ". Last creation was: \n" + cacheManagerLastCreation;
}
throw new SCacheException(message);
}
final Configuration configuration = new Configuration();
configuration.setDefaultCacheConfiguration(defaultCacheConfiguration);
configuration.diskStore(new DiskStoreConfiguration().path(diskStorePath));
cacheManager = new CacheManager(configuration);
if (logger.isLoggable(this.getClass(), TechnicalLogSeverity.TRACE)) {
cacheManagerLastCreation = getCacheManagerCreationDetails();
}
}
代码示例来源:origin: fr.inria.eventcloud/eventcloud-core
private CacheManager createCacheManager(String diskStorePath) {
Configuration cacheManagerConfig =
new Configuration().dynamicConfig(false)
.diskStore(
new DiskStoreConfiguration().path(diskStorePath))
.name("default")
.updateCheck(false);
return CacheManager.create(cacheManagerConfig);
}
代码示例来源:origin: org.geotools/gt-s3-geotiff
private static CacheManager buildCache(CacheConfig config) {
CacheManager manager;
if (config.getConfigurationPath() != null) {
manager = CacheManager.newInstance(config.getConfigurationPath());
} else {
Configuration cacheConfig = new Configuration();
cacheConfig.setMaxBytesLocalDisk((long) config.getDiskCacheSize());
cacheConfig.setMaxBytesLocalHeap((long) config.getHeapSize());
CacheConfiguration defaultCacheConfiguration =
new CacheConfiguration()
.persistence(
new PersistenceConfiguration()
.strategy(
PersistenceConfiguration.Strategy
.LOCALTEMPSWAP));
cacheConfig.defaultCache(defaultCacheConfiguration);
if (config.isUseDiskCache()) {
DiskStoreConfiguration diskConfig = new DiskStoreConfiguration();
diskConfig.setPath(config.getCacheDirectory().toAbsolutePath().toString());
cacheConfig.diskStore(diskConfig);
}
manager = new CacheManager(cacheConfig);
manager.addCache(DEFAULT_CACHE);
Cache cache = manager.getCache(DEFAULT_CACHE);
SelfPopulatingCache populatingCache =
new SelfPopulatingCache(cache, new S3ChunkEntryFactory(config));
manager.replaceCacheWithDecoratedCache(cache, populatingCache);
}
return manager;
}
代码示例来源:origin: org.apache.archiva.redback.components.cache/spring-cache-ehcache
this.cacheManager = new CacheManager( new Configuration().name( getName() ).diskStore(
new DiskStoreConfiguration().path( getDiskStorePath() ) ) );
代码示例来源:origin: yrain/smart-cache
configuration.diskStore(dsc);
内容来源于网络,如有侵权,请联系作者删除!