本文整理汇总了Java中org.springframework.cache.ehcache.EhCacheManagerFactoryBean类的典型用法代码示例。如果您正苦于以下问题:Java EhCacheManagerFactoryBean类的具体用法?Java EhCacheManagerFactoryBean怎么用?Java EhCacheManagerFactoryBean使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
EhCacheManagerFactoryBean类属于org.springframework.cache.ehcache包,在下文中一共展示了EhCacheManagerFactoryBean类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: ehCacheCacheManager
import org.springframework.cache.ehcache.EhCacheManagerFactoryBean; //导入依赖的package包/类
@Bean
public EhCacheManagerFactoryBean ehCacheCacheManager() {
EhCacheManagerFactoryBean cmfb = new EhCacheManagerFactoryBean();
cmfb.setConfigLocation(resourceLoader.getResource("classpath:ehcache.xml"));
cmfb.setShared(true);
return cmfb;
}
示例2: cacheManager
import org.springframework.cache.ehcache.EhCacheManagerFactoryBean; //导入依赖的package包/类
@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;
}
示例3: ehCacheManagerFactoryBean
import org.springframework.cache.ehcache.EhCacheManagerFactoryBean; //导入依赖的package包/类
@Bean(name="ehCacheManagerFactoryBean")
public EhCacheManagerFactoryBean ehCacheManagerFactoryBean(){
EhCacheManagerFactoryBean cacheManagerFactoryBean = new EhCacheManagerFactoryBean();
cacheManagerFactoryBean.setConfigLocation (new ClassPathResource("ehcache.xml"));
cacheManagerFactoryBean.setShared (true);
return cacheManagerFactoryBean;
}
示例4: ehCacheManagerFactoryBean
import org.springframework.cache.ehcache.EhCacheManagerFactoryBean; //导入依赖的package包/类
/**
* 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;
}
示例5: ehcache
import org.springframework.cache.ehcache.EhCacheManagerFactoryBean; //导入依赖的package包/类
@Bean
public EhCacheManagerFactoryBean ehcache(){
EhCacheManagerFactoryBean ehCacheManagerFactoryBean = new EhCacheManagerFactoryBean();
ehCacheManagerFactoryBean.setConfigLocation(new ClassPathResource("ehcache.xml"));
ehCacheManagerFactoryBean.setShared(true);
return ehCacheManagerFactoryBean;
}
示例6: ehCacheManagerFactoryBean
import org.springframework.cache.ehcache.EhCacheManagerFactoryBean; //导入依赖的package包/类
@Bean // 向spring容器中加入bean
public EhCacheManagerFactoryBean ehCacheManagerFactoryBean() {
EhCacheManagerFactoryBean cacheManagerFactoryBean = new EhCacheManagerFactoryBean();
cacheManagerFactoryBean.setConfigLocation(new ClassPathResource("ehcache.xml"));
cacheManagerFactoryBean.setShared(true);
return cacheManagerFactoryBean;
}
示例7: ehCacheManagerFactoryBean
import org.springframework.cache.ehcache.EhCacheManagerFactoryBean; //导入依赖的package包/类
/**
* 缓存工厂bean
* @return
*/
@Bean
public EhCacheManagerFactoryBean ehCacheManagerFactoryBean(){
EhCacheManagerFactoryBean factoryBean = new EhCacheManagerFactoryBean();
// 指定xml配置文件
factoryBean.setConfigLocation(new ClassPathResource("ehcache.xml"));
factoryBean.setShared(true);
return factoryBean;
}
示例8: ehCacheManagerFactoryBean
import org.springframework.cache.ehcache.EhCacheManagerFactoryBean; //导入依赖的package包/类
@Bean
public EhCacheManagerFactoryBean ehCacheManagerFactoryBean(){
EhCacheManagerFactoryBean cacheManagerFactoryBean = new EhCacheManagerFactoryBean();
cacheManagerFactoryBean.setConfigLocation (new ClassPathResource("conf/ehcache.xml"));
cacheManagerFactoryBean.setShared(true);
return cacheManagerFactoryBean;
}
示例9: ehCacheCacheManager
import org.springframework.cache.ehcache.EhCacheManagerFactoryBean; //导入依赖的package包/类
@Bean
public EhCacheManagerFactoryBean ehCacheCacheManager() {
EhCacheManagerFactoryBean ehcache = new EhCacheManagerFactoryBean();
ehcache.setConfigLocation(new ClassPathResource("ehcache.xml"));
ehcache.setShared(true);
return ehcache;
}
示例10: ehCacheManagerFactoryBean
import org.springframework.cache.ehcache.EhCacheManagerFactoryBean; //导入依赖的package包/类
@Bean
public EhCacheManagerFactoryBean ehCacheManagerFactoryBean() throws IOException {
String cacheMode = properties.getMode();
switch (cacheMode) {
case "single-nonpersistent":
return getEhCacheManagerFactoryBean("ehcache/ehcache-single-nonpersistent.xml");
case "single":
return getEhCacheManagerFactoryBean("ehcache/ehcache-single.xml");
case "multi":
return getEhCacheManagerFactoryBean("ehcache/ehcache-multi.xml");
}
throw new RuntimeException(format("Unsupported cache mode specified: '%s'", cacheMode));
}
示例11: ehCacheCacheManager
import org.springframework.cache.ehcache.EhCacheManagerFactoryBean; //导入依赖的package包/类
@Bean
public EhCacheManagerFactoryBean ehCacheCacheManager() {
EhCacheManagerFactoryBean cacheManager = new EhCacheManagerFactoryBean();
cacheManager.setConfigLocation(new ClassPathResource("default-singular-ehcache.xml"));
cacheManager.setShared(true);
return cacheManager;
}
示例12: aclCache
import org.springframework.cache.ehcache.EhCacheManagerFactoryBean; //导入依赖的package包/类
@Bean
EhCacheBasedAclCache aclCache() {
EhCacheFactoryBean factoryBean = new EhCacheFactoryBean();
EhCacheManagerFactoryBean cacheManager = new EhCacheManagerFactoryBean();
cacheManager.setAcceptExisting(true);
cacheManager.setCacheManagerName(CacheManager.class.getName());
cacheManager.afterPropertiesSet();
factoryBean.setCacheName("aclCache");
factoryBean.setCacheManager(cacheManager.getObject());
//factoryBean.setMaxBytesLocalHeap("16M");
//factoryBean.setMaxEntriesLocalHeap(0L);
factoryBean.afterPropertiesSet();
return new EhCacheBasedAclCache(factoryBean.getObject());
}
示例13: createCacheManager
import org.springframework.cache.ehcache.EhCacheManagerFactoryBean; //导入依赖的package包/类
/**
* Creates the cache manager without registering it.
*
* @param repo the component repository, only used to register secondary items like lifecycle, not null
* @return the cache manager, not null
*/
protected CacheManager createCacheManager(ComponentRepository repo) throws IOException {
EhCacheManagerFactoryBean factoryBean = new EhCacheManagerFactoryBean();
factoryBean.setShared(isShared());
factoryBean.setConfigLocation(ResourceUtils.createResource(getConfigLocation()));
factoryBean.afterPropertiesSet();
return factoryBean.getObject();
}
示例14: ehCacheCacheManager
import org.springframework.cache.ehcache.EhCacheManagerFactoryBean; //导入依赖的package包/类
@Bean
public EhCacheManagerFactoryBean ehCacheCacheManager() {
EhCacheManagerFactoryBean cmfb = new EhCacheManagerFactoryBean();
cmfb.setConfigLocation(new ClassPathResource("ehcache.xml"));
cmfb.setShared(true);
return cmfb;
}
示例15: ehCacheCacheManager
import org.springframework.cache.ehcache.EhCacheManagerFactoryBean; //导入依赖的package包/类
@Bean
public EhCacheManagerFactoryBean ehCacheCacheManager() {
final EhCacheManagerFactoryBean factory = new EhCacheManagerFactoryBean();
factory.setConfigLocation(new ClassPathResource("ehcache.xml"));
factory.setShared(true);
return factory;
}