use of org.springframework.cache.CacheManager in project tutorials by eugenp.
the class CacheConfiguration method cacheManager.
@Bean
public CacheManager cacheManager(HazelcastInstance hazelcastInstance) {
log.debug("Starting HazelcastCacheManager");
CacheManager cacheManager = new com.hazelcast.spring.cache.HazelcastCacheManager(hazelcastInstance);
return cacheManager;
}
use of org.springframework.cache.CacheManager in project cetc by DiscoverForever.
the class CacheConfiguration method cacheManager.
@Bean
public CacheManager cacheManager(HazelcastInstance hazelcastInstance) {
log.debug("Starting HazelcastCacheManager");
CacheManager cacheManager = new com.hazelcast.spring.cache.HazelcastCacheManager(hazelcastInstance);
return cacheManager;
}
use of org.springframework.cache.CacheManager in project jhipster-sample-app-hazelcast by jhipster.
the class CacheConfiguration method cacheManager.
@Bean
public CacheManager cacheManager(HazelcastInstance hazelcastInstance) {
log.debug("Starting HazelcastCacheManager");
CacheManager cacheManager = new com.hazelcast.spring.cache.HazelcastCacheManager(hazelcastInstance);
return cacheManager;
}
use of org.springframework.cache.CacheManager in project nextprot-api by calipho-sib.
the class GenerateSolrIndex method launch.
protected void launch(String[] args) {
try {
// System.setProperty("spring.profiles.active", "dev");
System.setProperty("spring.profiles.active", "dev, cache");
ctx = new ClassPathXmlApplicationContext("classpath:spring/commons-context.xml", "classpath:spring/core-context.xml");
cacheManager = ctx.getBean(CacheManager.class);
start(args);
} finally {
shutdown();
}
}
use of org.springframework.cache.CacheManager in project spring-boot by spring-projects.
the class CacheAutoConfigurationTests method couchbaseCacheWithCouchbaseCacheManagerBuilderCustomizer.
@Test
void couchbaseCacheWithCouchbaseCacheManagerBuilderCustomizer() {
this.contextRunner.withUserConfiguration(CouchbaseConfiguration.class).withPropertyValues("spring.cache.type=couchbase", "spring.cache.couchbase.expiration=15s").withBean(CouchbaseCacheManagerBuilderCustomizer.class, () -> (builder) -> builder.cacheDefaults(CouchbaseCacheConfiguration.defaultCacheConfig().entryExpiry(java.time.Duration.ofSeconds(10)))).run((context) -> {
CouchbaseCacheManager cacheManager = getCacheManager(context, CouchbaseCacheManager.class);
CouchbaseCacheConfiguration couchbaseCacheConfiguration = getDefaultCouchbaseCacheConfiguration(cacheManager);
assertThat(couchbaseCacheConfiguration.getExpiry()).isEqualTo(java.time.Duration.ofSeconds(10));
});
}
Aggregations