use of org.springframework.cache.ehcache.EhCacheManagerFactoryBean in project cas by apereo.
the class EhcacheTicketRegistryConfiguration method cacheManager.
@Lazy
@Bean
public EhCacheManagerFactoryBean cacheManager() {
final EhcacheProperties cache = casProperties.getTicket().getRegistry().getEhcache();
final EhCacheManagerFactoryBean bean = new EhCacheManagerFactoryBean();
bean.setConfigLocation(cache.getConfigLocation());
bean.setShared(cache.isShared());
bean.setCacheManagerName(cache.getCacheManagerName());
return bean;
}
use of org.springframework.cache.ehcache.EhCacheManagerFactoryBean in project sppanblog4springboot by whoismy8023.
the class CacheConfig method ehCacheManagerFactoryBean.
/**
* 据shared与否的设置,Spring分别通过CacheManager.create()或new CacheManager()方式来创建一个ehcache基地.
*/
@Bean
public EhCacheManagerFactoryBean ehCacheManagerFactoryBean() {
EhCacheManagerFactoryBean cacheManagerFactoryBean = new EhCacheManagerFactoryBean();
cacheManagerFactoryBean.setConfigLocation(new ClassPathResource("ehcache.xml"));
cacheManagerFactoryBean.setShared(true);
return cacheManagerFactoryBean;
}
use of org.springframework.cache.ehcache.EhCacheManagerFactoryBean in project ocvn by devgateway.
the class CacheConfiguration method ehCacheManagerFactoryBean.
@Bean
public EhCacheManagerFactoryBean ehCacheManagerFactoryBean() {
EhCacheManagerFactoryBean ehCacheManagerFactoryBean = new EhCacheManagerFactoryBean();
ehCacheManagerFactoryBean.setConfigLocation(new ClassPathResource("ehcache.xml"));
ehCacheManagerFactoryBean.setShared(true);
return ehCacheManagerFactoryBean;
}
use of org.springframework.cache.ehcache.EhCacheManagerFactoryBean in project openmrs-core by openmrs.
the class CacheConfig method apiCacheManagerFactoryBean.
@Bean(name = "apiCacheManagerFactoryBean")
public EhCacheManagerFactoryBean apiCacheManagerFactoryBean() {
OpenmrsCacheManagerFactoryBean cacheManagerFactoryBean = new OpenmrsCacheManagerFactoryBean();
cacheManagerFactoryBean.setConfigLocation(new ClassPathResource("ehcache-api.xml"));
cacheManagerFactoryBean.setShared(false);
cacheManagerFactoryBean.setAcceptExisting(true);
return cacheManagerFactoryBean;
}
use of org.springframework.cache.ehcache.EhCacheManagerFactoryBean in project vip by guangdada.
the class ShiroConfig method getCacheShiroManager.
/**
* 缓存管理器 使用Ehcache实现
*/
@Bean
public CacheManager getCacheShiroManager(EhCacheManagerFactoryBean ehcache) {
EhCacheManager ehCacheManager = new EhCacheManager();
ehCacheManager.setCacheManager(ehcache.getObject());
return ehCacheManager;
}
Aggregations