當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。