本文整理汇总了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;
}
示例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);
}
示例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);
}
示例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));
}
示例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));
}
示例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());
}
示例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));
}
示例14: cacheManager
import org.springframework.cache.concurrent.ConcurrentMapCacheManager; //导入依赖的package包/类
@Bean
public CacheManager cacheManager() {
LOG.info("ACTIVANDO CACHE!!!");
return new ConcurrentMapCacheManager("saleweb");
}
示例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();
}