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


Java CacheConfiguration.setStatistics方法代码示例

本文整理汇总了Java中net.sf.ehcache.config.CacheConfiguration.setStatistics方法的典型用法代码示例。如果您正苦于以下问题:Java CacheConfiguration.setStatistics方法的具体用法?Java CacheConfiguration.setStatistics怎么用?Java CacheConfiguration.setStatistics使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在net.sf.ehcache.config.CacheConfiguration的用法示例。


在下文中一共展示了CacheConfiguration.setStatistics方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getCacheConfiguration

import net.sf.ehcache.config.CacheConfiguration; //导入方法依赖的package包/类
/**
 * Read cache config from the file caches.dat
 *
 * @param strCacheName
 *            The cache name
 * @return The config
 */
private CacheConfiguration getCacheConfiguration( String strCacheName )
{
    CacheConfiguration config = new CacheConfiguration( );
    config.setName( strCacheName );
    config.setMaxElementsInMemory( getIntProperty( strCacheName, PROPERTY_MAX_ELEMENTS, _nDefaultMaxElementsInMemory ) );
    config.setEternal( getBooleanProperty( strCacheName, PROPERTY_ETERNAL, _bDefaultEternal ) );
    config.setTimeToIdleSeconds( getLongProperty( strCacheName, PROPERTY_TIME_TO_IDLE, _lDefaultTimeToIdle ) );
    config.setTimeToLiveSeconds( getLongProperty( strCacheName, PROPERTY_TIME_TO_LIVE, _lDefaultTimeToLive ) );
    config.setOverflowToDisk( getBooleanProperty( strCacheName, PROPERTY_OVERFLOW_TO_DISK, _bDefaultOverflowToDisk ) );
    config.setDiskPersistent( getBooleanProperty( strCacheName, PROPERTY_DISK_PERSISTENT, _bDefaultDiskPersistent ) );
    config.setDiskExpiryThreadIntervalSeconds( getLongProperty( strCacheName, PROPERTY_DISK_EXPIRY, _lDefaultDiskExpiry ) );
    config.setMaxElementsOnDisk( getIntProperty( strCacheName, PROPERTY_MAX_ELEMENTS_DISK, _nDefaultMaxElementsOnDisk ) );
    config.setStatistics( getBooleanProperty( strCacheName, PROPERTY_STATISTICS, _bDefaultStatistics ) );

    return config;
}
 
开发者ID:lutece-platform,项目名称:lutece-core,代码行数:24,代码来源:CacheService.java

示例2: tweakCacheConfiguration

import net.sf.ehcache.config.CacheConfiguration; //导入方法依赖的package包/类
private static CacheConfiguration tweakCacheConfiguration(CacheConfiguration cacheConfiguration) {
  // Make copies of cached objects (use default Serializable copy)
  cacheConfiguration.setCopyOnRead(true);
  cacheConfiguration.setCopyOnWrite(true);
  cacheConfiguration.setStatistics(true);
  return cacheConfiguration;
}
 
开发者ID:DevStreet,项目名称:FinanceAnalytics,代码行数:8,代码来源:EHCachingSearchCache.java

示例3: tweakCacheConfiguration

import net.sf.ehcache.config.CacheConfiguration; //导入方法依赖的package包/类
private CacheConfiguration tweakCacheConfiguration(CacheConfiguration cacheConfiguration) {

    // Set searchable index
    Searchable uidToDocumentCacheSearchable = new Searchable();
    uidToDocumentCacheSearchable.addSearchAttribute(new SearchAttribute().name("ObjectId")
                                                        .expression("value.getObjectId().toString()"));
    uidToDocumentCacheSearchable.addSearchAttribute(new SearchAttribute().name("VersionFromInstant")
                                                        .className("com.opengamma.master.cache.InstantExtractor"));
    uidToDocumentCacheSearchable.addSearchAttribute(new SearchAttribute().name("VersionToInstant")
                                                        .className("com.opengamma.master.cache.InstantExtractor"));
    uidToDocumentCacheSearchable.addSearchAttribute(new SearchAttribute().name("CorrectionFromInstant")
                                                        .className("com.opengamma.master.cache.InstantExtractor"));
    uidToDocumentCacheSearchable.addSearchAttribute(new SearchAttribute().name("CorrectionToInstant")
                                                        .className("com.opengamma.master.cache.InstantExtractor"));
    cacheConfiguration.addSearchable(uidToDocumentCacheSearchable);

    // Make copies of cached objects
    CopyStrategyConfiguration copyStrategyConfiguration = new CopyStrategyConfiguration();
    copyStrategyConfiguration.setClass("com.opengamma.master.cache.JodaBeanCopyStrategy");
    cacheConfiguration.addCopyStrategy(copyStrategyConfiguration);
    cacheConfiguration.setCopyOnRead(true);
    cacheConfiguration.setCopyOnWrite(true);

    cacheConfiguration.setStatistics(true);

    return cacheConfiguration;
  }
 
开发者ID:DevStreet,项目名称:FinanceAnalytics,代码行数:28,代码来源:AbstractEHCachingMaster.java


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