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


Java CacheConfiguration.getName方法代码示例

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


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

示例1: createEnCachePool

import net.sf.ehcache.config.CacheConfiguration; //导入方法依赖的package包/类
public static CachePool createEnCachePool() {
	CacheConfiguration cacheConf = new CacheConfiguration();
	cacheConf.setName("testcache");
	cacheConf.maxBytesLocalHeap(400, MemoryUnit.MEGABYTES)
			.timeToIdleSeconds(3600);
	Cache cache = new Cache(cacheConf);
	CacheManager.create().addCache(cache);
	EnchachePool enCachePool = new EnchachePool(cacheConf.getName(),cache,400*10000);
	return enCachePool;
}
 
开发者ID:huang-up,项目名称:mycat-src-1.6.1-RELEASE,代码行数:11,代码来源:TestCachePoolPerformance.java

示例2: createEnCachePool

import net.sf.ehcache.config.CacheConfiguration; //导入方法依赖的package包/类
public static CachePool createEnCachePool() {
    CacheConfiguration cacheConf = new CacheConfiguration();
    cacheConf.setName("testcache");
    cacheConf.maxBytesLocalHeap(400, MemoryUnit.MEGABYTES)
            .timeToIdleSeconds(3600);
    Cache cache = new Cache(cacheConf);
    CacheManager.create().addCache(cache);
    EnchachePool enCachePool = new EnchachePool(cacheConf.getName(), cache, 400 * 10000);
    return enCachePool;
}
 
开发者ID:actiontech,项目名称:dble,代码行数:11,代码来源:TestCachePoolPerformance.java

示例3: init

import net.sf.ehcache.config.CacheConfiguration; //导入方法依赖的package包/类
@SuppressWarnings({ "unchecked", "unused" })
public void init() {
	log.info("Loading ehcache");
	// log.debug("Appcontext: " + applicationContext.toString());
	try {
		// instance the manager
		CacheManager cm = CacheManager.getInstance();
		// Use the Configuration to create our caches
		Configuration configuration = new Configuration();
		//set initial default cache name
		String defaultCacheName = Cache.DEFAULT_CACHE_NAME;
		//add the configs to a configuration
		for (CacheConfiguration conf : configs) {
			//set disk expiry
			conf.setDiskExpiryThreadIntervalSeconds(diskExpiryThreadIntervalSeconds);
			//set eviction policy
			conf.setMemoryStoreEvictionPolicy(memoryStoreEvictionPolicy);
			if (null == cache) {
				//get first cache name and use as default
				defaultCacheName = conf.getName();
				configuration.addDefaultCache(conf);
			} else {
				configuration.addCache(conf);
			}
		}
		//instance the helper
		ConfigurationHelper helper = new ConfigurationHelper(cm, configuration);
		//create the default cache
		cache = helper.createDefaultCache();
		//init the default
		cache.initialise();
		cache.bootstrap();
		//create the un-init'd caches
		Set<Cache> caches = helper.createCaches();
		if (log.isDebugEnabled()) {
			log.debug("Number of caches: " + caches.size() + " Default cache: " + (cache != null ? 1 : 0));
		}
		for (Cache nonDefaultCache : caches) {
			nonDefaultCache.initialise();
			nonDefaultCache.bootstrap();
			//set first cache to be main local member
			if (null == nonDefaultCache) {
				log.debug("Default cache name: {}", defaultCacheName);
				nonDefaultCache = cm.getCache(defaultCacheName);
			}
		}
	} catch (Exception e) {
		log.warn("Error on cache init", e);
	}
	if (log.isDebugEnabled()) {
		log.debug("Cache is null? {}", (null == cache));
	}
}
 
开发者ID:Kyunghwa-Yoo,项目名称:StitchRTSP,代码行数:54,代码来源:EhCacheImpl.java

示例4: init

import net.sf.ehcache.config.CacheConfiguration; //导入方法依赖的package包/类
@SuppressWarnings({ "unchecked", "unused" })
public void init() {
    log.info("Loading ehcache");
    // log.debug("Appcontext: " + applicationContext.toString());
    try {
        // instance the manager
        CacheManager cm = CacheManager.getInstance();
        // Use the Configuration to create our caches
        Configuration configuration = new Configuration();
        //set initial default cache name
        String defaultCacheName = Cache.DEFAULT_CACHE_NAME;
        //add the configs to a configuration
        for (CacheConfiguration conf : configs) {
            //set disk expiry
            conf.setDiskExpiryThreadIntervalSeconds(diskExpiryThreadIntervalSeconds);
            //set eviction policy
            conf.setMemoryStoreEvictionPolicy(memoryStoreEvictionPolicy);
            if (null == cache) {
                //get first cache name and use as default
                defaultCacheName = conf.getName();
                configuration.addDefaultCache(conf);
            } else {
                configuration.addCache(conf);
            }
        }
        //instance the helper
        ConfigurationHelper helper = new ConfigurationHelper(cm, configuration);
        //create the default cache
        cache = helper.createDefaultCache();
        //init the default
        cache.initialise();
        cache.bootstrap();
        //create the un-init'd caches
        Set<Cache> caches = helper.createCaches();
        if (log.isDebugEnabled()) {
            log.debug("Number of caches: " + caches.size() + " Default cache: " + (cache != null ? 1 : 0));
        }
        for (Cache nonDefaultCache : caches) {
            nonDefaultCache.initialise();
            nonDefaultCache.bootstrap();
            //set first cache to be main local member
            if (null == nonDefaultCache) {
                log.debug("Default cache name: {}", defaultCacheName);
                nonDefaultCache = cm.getCache(defaultCacheName);
            }
        }
    } catch (Exception e) {
        log.warn("Error on cache init", e);
    }
    if (log.isDebugEnabled()) {
        log.debug("Cache is null? {}", (null == cache));
    }
}
 
开发者ID:Red5,项目名称:red5-io,代码行数:54,代码来源:EhCacheImpl.java


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