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


Java ConcurrentMapCacheManager类代码示例

本文整理汇总了Java中org.springframework.cache.concurrent.ConcurrentMapCacheManager的典型用法代码示例。如果您正苦于以下问题:Java ConcurrentMapCacheManager类的具体用法?Java ConcurrentMapCacheManager怎么用?Java ConcurrentMapCacheManager使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: getCache

import org.springframework.cache.concurrent.ConcurrentMapCacheManager; //导入依赖的package包/类
private Cache getCache(final String cacheName) {

        Cache cache = cm.getCache(CacheNames.JWKS);
        if (cache == null) {
            LOG.warn("A no cache named {} was not provided by the cache manager an in-memory cache will be used", cacheName);
            cache = new ConcurrentMapCacheManager(cacheName).getCache(cacheName);
        }
        return cache;

    }
 
开发者ID:trajano,项目名称:app-ms,代码行数:11,代码来源:CachedDataProvider.java

示例2: customizeSimpleCacheManager

import org.springframework.cache.concurrent.ConcurrentMapCacheManager; //导入依赖的package包/类
@Test
public void customizeSimpleCacheManager() {
	load(SimpleConfiguration.class, "spring.cache.type=simple");
	ConcurrentMapCacheManager cacheManager = this.context
			.getBean(ConcurrentMapCacheManager.class);
	assertThat(cacheManager.getCacheNames()).containsOnly("one", "two");
}
 
开发者ID:vikrammane23,项目名称:https-github.com-g0t4-jenkins2-course-spring-boot,代码行数:8,代码来源:CacheManagerCustomizersTests.java

示例3: cacheManagerCustomizer

import org.springframework.cache.concurrent.ConcurrentMapCacheManager; //导入依赖的package包/类
@Bean
public CacheManagerCustomizer<ConcurrentMapCacheManager> cacheManagerCustomizer() {
	return new CacheManagerCustomizer<ConcurrentMapCacheManager>() {

		@Override
		public void customize(ConcurrentMapCacheManager cacheManager) {
			cacheManager.setCacheNames(Arrays.asList("one", "two"));
		}

	};
}
 
开发者ID:vikrammane23,项目名称:https-github.com-g0t4-jenkins2-course-spring-boot,代码行数:12,代码来源:CacheManagerCustomizersTests.java

示例4: cacheManagerBackOff

import org.springframework.cache.concurrent.ConcurrentMapCacheManager; //导入依赖的package包/类
@Test
public void cacheManagerBackOff() {
	load(CustomCacheManagerConfiguration.class);
	ConcurrentMapCacheManager cacheManager = validateCacheManager(
			ConcurrentMapCacheManager.class);
	assertThat(cacheManager.getCacheNames()).containsOnly("custom1");
}
 
开发者ID:vikrammane23,项目名称:https-github.com-g0t4-jenkins2-course-spring-boot,代码行数:8,代码来源:CacheAutoConfigurationTests.java

示例5: cacheManagerFromSupportBackOff

import org.springframework.cache.concurrent.ConcurrentMapCacheManager; //导入依赖的package包/类
@Test
public void cacheManagerFromSupportBackOff() {
	load(CustomCacheManagerFromSupportConfiguration.class);
	ConcurrentMapCacheManager cacheManager = validateCacheManager(
			ConcurrentMapCacheManager.class);
	assertThat(cacheManager.getCacheNames()).containsOnly("custom1");
}
 
开发者ID:vikrammane23,项目名称:https-github.com-g0t4-jenkins2-course-spring-boot,代码行数:8,代码来源:CacheAutoConfigurationTests.java

示例6: simpleCacheExplicit

import org.springframework.cache.concurrent.ConcurrentMapCacheManager; //导入依赖的package包/类
@Test
public void simpleCacheExplicit() {
	load(DefaultCacheConfiguration.class, "spring.cache.type=simple");
	ConcurrentMapCacheManager cacheManager = validateCacheManager(
			ConcurrentMapCacheManager.class);
	assertThat(cacheManager.getCacheNames()).isEmpty();
}
 
开发者ID:vikrammane23,项目名称:https-github.com-g0t4-jenkins2-course-spring-boot,代码行数:8,代码来源:CacheAutoConfigurationTests.java

示例7: simpleCacheExplicitWithCacheNames

import org.springframework.cache.concurrent.ConcurrentMapCacheManager; //导入依赖的package包/类
@Test
public void simpleCacheExplicitWithCacheNames() {
	load(DefaultCacheConfiguration.class, "spring.cache.type=simple",
			"spring.cache.cacheNames[0]=foo", "spring.cache.cacheNames[1]=bar");
	ConcurrentMapCacheManager cacheManager = validateCacheManager(
			ConcurrentMapCacheManager.class);
	assertThat(cacheManager.getCacheNames()).containsOnly("foo", "bar");
}
 
开发者ID:vikrammane23,项目名称:https-github.com-g0t4-jenkins2-course-spring-boot,代码行数:9,代码来源:CacheAutoConfigurationTests.java

示例8: whenSpringCacheTypeIsSimpleThenSimpleCacheLoaded

import org.springframework.cache.concurrent.ConcurrentMapCacheManager; //导入依赖的package包/类
@Test
public void whenSpringCacheTypeIsSimpleThenSimpleCacheLoaded() {
    loadContext(CacheConfiguration.class, "spring.cache.type=simple");

    CacheManager cacheManager = this.applicationContext.getBean(CacheManager.class);

    assertThat(cacheManager).isInstanceOf(ConcurrentMapCacheManager.class);
}
 
开发者ID:sixhours-team,项目名称:memcached-spring-boot,代码行数:9,代码来源:MemcachedAutoConfigurationTest.java

示例9: whenUsingCustomCacheManagerThenMemcachedCustomCacheManagerLoaded

import org.springframework.cache.concurrent.ConcurrentMapCacheManager; //导入依赖的package包/类
@Test
public void whenUsingCustomCacheManagerThenMemcachedCustomCacheManagerLoaded() {
    loadContext(CacheWithCustomCacheManagerConfiguration.class);

    CacheManager cacheManager = this.applicationContext.getBean(CacheManager.class);

    assertThat(cacheManager).isInstanceOf(ConcurrentMapCacheManager.class);
}
 
开发者ID:sixhours-team,项目名称:memcached-spring-boot,代码行数:9,代码来源:MemcachedAutoConfigurationTest.java

示例10: cacheManagerBackOff

import org.springframework.cache.concurrent.ConcurrentMapCacheManager; //导入依赖的package包/类
@Test
public void cacheManagerBackOff() {
	load(CustomCacheManagerConfiguration.class);
	ConcurrentMapCacheManager cacheManager = validateCacheManager(
			ConcurrentMapCacheManager.class);
	assertThat(cacheManager.getCacheNames(), contains("custom1"));
	assertThat(cacheManager.getCacheNames(), hasSize(1));
}
 
开发者ID:Nephilim84,项目名称:contestparser,代码行数:9,代码来源:CacheAutoConfigurationTests.java

示例11: cacheManagerFromSupportBackOff

import org.springframework.cache.concurrent.ConcurrentMapCacheManager; //导入依赖的package包/类
@Test
public void cacheManagerFromSupportBackOff() {
	load(CustomCacheManagerFromSupportConfiguration.class);
	ConcurrentMapCacheManager cacheManager = validateCacheManager(
			ConcurrentMapCacheManager.class);
	assertThat(cacheManager.getCacheNames(), contains("custom1"));
	assertThat(cacheManager.getCacheNames(), hasSize(1));
}
 
开发者ID:Nephilim84,项目名称:contestparser,代码行数:9,代码来源:CacheAutoConfigurationTests.java

示例12: simpleCacheExplicit

import org.springframework.cache.concurrent.ConcurrentMapCacheManager; //导入依赖的package包/类
@Test
public void simpleCacheExplicit() {
	load(DefaultCacheConfiguration.class, "spring.cache.type=simple");
	ConcurrentMapCacheManager cacheManager = validateCacheManager(
			ConcurrentMapCacheManager.class);
	assertThat(cacheManager.getCacheNames(), empty());
}
 
开发者ID:Nephilim84,项目名称:contestparser,代码行数:8,代码来源:CacheAutoConfigurationTests.java

示例13: simpleCacheExplicitWithCacheNames

import org.springframework.cache.concurrent.ConcurrentMapCacheManager; //导入依赖的package包/类
@Test
public void simpleCacheExplicitWithCacheNames() {
	load(DefaultCacheConfiguration.class, "spring.cache.type=simple",
			"spring.cache.cacheNames[0]=foo", "spring.cache.cacheNames[1]=bar");
	ConcurrentMapCacheManager cacheManager = validateCacheManager(
			ConcurrentMapCacheManager.class);
	assertThat(cacheManager.getCacheNames(), containsInAnyOrder("foo", "bar"));
	assertThat(cacheManager.getCacheNames(), hasSize(2));
}
 
开发者ID:Nephilim84,项目名称:contestparser,代码行数:10,代码来源:CacheAutoConfigurationTests.java

示例14: cacheManager

import org.springframework.cache.concurrent.ConcurrentMapCacheManager; //导入依赖的package包/类
@Bean
public CacheManager cacheManager() {	
	LOG.info("ACTIVANDO CACHE!!!");	
	return new ConcurrentMapCacheManager("saleweb"); 
}
 
开发者ID:jeche21,项目名称:SaleWeb,代码行数:6,代码来源:Application.java

示例15: FluuzCacheManager

import org.springframework.cache.concurrent.ConcurrentMapCacheManager; //导入依赖的package包/类
/**
 * Construct a dynamic {@link FluuzCacheManager} backed by a {@link ConcurrentMapCacheManager}, 
 * lazily creating cache instances as they are being requested.
 */
public FluuzCacheManager(EventManager eventManager) {
    this.eventManager = eventManager;
    proxy = new ConcurrentMapCacheManager();
}
 
开发者ID:ArawakCC,项目名称:fluuz,代码行数:9,代码来源:FluuzCacheManager.java


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