Java Code Examples for org.springframework.cache.ehcache.EhCacheManagerFactoryBean#setShared()

The following examples show how to use org.springframework.cache.ehcache.EhCacheManagerFactoryBean#setShared() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: EhCacheConfig.java    From kvf-admin with MIT License 5 votes vote down vote up
@Bean
public EhCacheManagerFactoryBean ehCacheManagerFactoryBean() {
    EhCacheManagerFactoryBean cacheManagerFactoryBean = new EhCacheManagerFactoryBean();
    cacheManagerFactoryBean.setConfigLocation(new ClassPathResource("ehcache.xml"));     // 缓存信息配置文件
    cacheManagerFactoryBean.setShared(true);
    return cacheManagerFactoryBean;
}
 
Example 2
Source File: CacheConfig.java    From api-layer with Eclipse Public License 2.0 5 votes vote down vote up
@Bean
public EhCacheManagerFactoryBean ehCacheCacheManager() {
    EhCacheManagerFactoryBean cmfb = new EhCacheManagerFactoryBean();
    cmfb.setConfigLocation(new ClassPathResource("ehcache.xml"));
    cmfb.setShared(true);
    return cmfb;
}
 
Example 3
Source File: CacheConfiguration.java    From MicroCommunity with Apache License 2.0 5 votes vote down vote up
@Bean
public EhCacheManagerFactoryBean ehCacheManagerFactoryBean(){
    EhCacheManagerFactoryBean cacheManagerFactoryBean = new EhCacheManagerFactoryBean ();
    cacheManagerFactoryBean.setConfigLocation (new ClassPathResource("cache/ehcache-app.xml"));
    cacheManagerFactoryBean.setShared (true);
    return cacheManagerFactoryBean;
}
 
Example 4
Source File: SpringDispatcherConfig.java    From Spring-5.0-Cookbook with MIT License 5 votes vote down vote up
@Bean
public EhCacheManagerFactoryBean ehCacheCacheManager() {
	EhCacheManagerFactoryBean cmfb = new EhCacheManagerFactoryBean();
	cmfb.setConfigLocation(resourceLoader.getResource("classpath:ehcache.xml"));
	
	cmfb.setShared(true);
	return cmfb;
}
 
Example 5
Source File: CacheConfig.java    From cc-s with MIT License 5 votes vote down vote up
/**
 * ehcache工厂
 * @return
 */
@Bean
public EhCacheManagerFactoryBean ehCacheManagerFactoryBean(){
    EhCacheManagerFactoryBean cacheManagerFactoryBean = new EhCacheManagerFactoryBean ();
    cacheManagerFactoryBean.setConfigLocation (new ClassPathResource(env.getProperty("ehcache.config-location")));
    cacheManagerFactoryBean.setShared(Boolean.valueOf(env.getProperty("shared")));
    return cacheManagerFactoryBean;
}
 
Example 6
Source File: CacheConfiguration.java    From Spring-Boot-Blog with MIT License 5 votes vote down vote up
@Bean
public EhCacheManagerFactoryBean ehCacheManagerFactoryBean(){
    EhCacheManagerFactoryBean cacheManagerFactoryBean = new EhCacheManagerFactoryBean();
    cacheManagerFactoryBean.setConfigLocation (new ClassPathResource("conf/ehcache.xml"));
    cacheManagerFactoryBean.setShared(true);
    return cacheManagerFactoryBean;
}
 
Example 7
Source File: CacheManagerConfig.java    From c2mon with GNU Lesser General Public License v3.0 4 votes vote down vote up
private EhCacheManagerFactoryBean getEhCacheManagerFactoryBean(String configLocation) {
  EhCacheManagerFactoryBean bean = new EhCacheManagerFactoryBean();
  bean.setConfigLocation(new ClassPathResource(configLocation));
  bean.setShared(true);
  return bean;
}