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


Java CacheManager.cacheExists方法代码示例

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


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

示例1: RealCache

import net.sf.ehcache.CacheManager; //导入方法依赖的package包/类
public RealCache() {
	super();
	CacheManager manager = null;
	synchronized (RealCache.class) {
		manager = CacheManager.getInstance();
		if (!manager.cacheExists("AFPDataGrabberCache")) {
			Cache cache = new Cache(new CacheConfiguration("AFPDataGrabberCache", 50000).memoryStoreEvictionPolicy(MemoryStoreEvictionPolicy.LFU)
					.eternal(true).timeToLiveSeconds(0).timeToIdleSeconds(0).persistence(new PersistenceConfiguration().strategy(Strategy.NONE)));
			manager.addCache(cache);
		}
	}
	ehcache = manager.getCache("AFPDataGrabberCache");
}
 
开发者ID:ina-foss,项目名称:afp-api-client,代码行数:14,代码来源:AFPDataGrabberCache.java

示例2: onSetUpInTransaction

import net.sf.ehcache.CacheManager; //导入方法依赖的package包/类
protected void onSetUpInTransaction() {

        // make a cache
        CacheManager cacheManager = CacheManager.create();
        if (! cacheManager.cacheExists("ehcache.sakai.kaltura.entries")) {
            cacheManager.addCache("ehcache.sakai.kaltura.entries");
        }
        Ehcache entriesCache = cacheManager.getCache("ehcache.sakai.kaltura.entries");

        // create and setup the object to be tested
        external = new ExternalLogicStub();
        service = new KalturaAPIService();
        service.setExternal(external);
        service.setEntriesCache(entriesCache);
        service.setOffline(true); // for testing we do not try to fetch real data

        // run the init
        external.currentUserId = FakeDataPreload.ADMIN_USER_ID; // DEFAULT ADMIN
        // UNICON settings for testing
        external.config.put("kaltura.partnerid", 166762);
        external.config.put("kaltura.adminsecret", "26d08a0ba54c911492bbc7599028295f");
        external.config.put("kaltura.secret", "6e4755b613a38b19e4cfb5d7405ed170");

        service.testWSInit(); // SPECIAL INIT

        service.getKalturaClient();
    }
 
开发者ID:ITYug,项目名称:kaltura-ce-sakai-extension,代码行数:28,代码来源:KalturaTestWebservices.java

示例3: setUp

import net.sf.ehcache.CacheManager; //导入方法依赖的package包/类
@Override
protected void setUp() throws Exception {
    // THIS IS EXECUTED BEFORE EACH TEST

    // make the caches
    CacheManager cacheManager = CacheManager.create();
    if (! cacheManager.cacheExists("ehcache.sakai.kaltura.entries")) {
        cacheManager.addCache("ehcache.sakai.kaltura.entries");
    }
    Ehcache entriesCache = cacheManager.getCache("ehcache.sakai.kaltura.entries");

    if (! cacheManager.cacheExists("ehcache.sakai.kaltura.cats")) {
        cacheManager.addCache("ehcache.sakai.kaltura.cats");
    }
    Ehcache categoriesCache = cacheManager.getCache("ehcache.sakai.kaltura.cats");

    // create and setup the object to be tested
    external = new ExternalLogicStub();

    kalturaAPIService = new KalturaAPIServiceStub(external, entriesCache, categoriesCache);
    kalturaAPIService.setKalturaClippingEnabled(true); // for testing

    service = new MediaService();
    service.setExternal(external);
    service.setKalturaAPIService(kalturaAPIService);
    service.setEntriesCache(entriesCache);
    service.setForceMediaNameOrdering(false);

    // run the init
    service.init();
}
 
开发者ID:ITYug,项目名称:kaltura-ce-sakai-extension,代码行数:32,代码来源:MediaServiceTest.java


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