当前位置: 首页>>代码示例>>Java>>正文


Java EhCacheManagerFactoryBean类代码示例

本文整理汇总了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;
}
 
开发者ID:PacktPublishing,项目名称:Spring-5.0-Cookbook,代码行数:9,代码来源:SpringDispatcherConfig.java

示例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;
}
 
开发者ID:mrluo735,项目名称:cas-5.1.0,代码行数:11,代码来源:EhcacheTicketRegistryConfiguration.java

示例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;
}
 
开发者ID:liaojiacan,项目名称:zkAdmin,代码行数:8,代码来源:CommonConfig.java

示例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;
}
 
开发者ID:myopenresources,项目名称:cc-s,代码行数:12,代码来源:CacheConfig.java

示例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;
}
 
开发者ID:Witerium,项目名称:stuffEngine,代码行数:8,代码来源:CacheConfig.java

示例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;
}
 
开发者ID:r0n9,项目名称:demo-springboot,代码行数:8,代码来源:CacheConfiguration.java

示例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;
	}
 
开发者ID:zhaoshuxue,项目名称:springBoot,代码行数:14,代码来源:CacheConfiguration.java

示例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;
}
 
开发者ID:sheepmen,项目名称:Spring-Boot-Blog,代码行数:8,代码来源:CacheConfiguration.java

示例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;
}
 
开发者ID:dlcs,项目名称:the-mathmos-server,代码行数:8,代码来源:ServicesConfig.java

示例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));
}
 
开发者ID:c2mon,项目名称:c2mon,代码行数:16,代码来源:CacheManagerConfig.java

示例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;
}
 
开发者ID:opensingular,项目名称:singular-server,代码行数:8,代码来源:SingularDefaultBeanFactory.java

示例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());
}
 
开发者ID:abixen,项目名称:abixen-platform,代码行数:16,代码来源:PlatformAclConfiguration.java

示例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();
}
 
开发者ID:DevStreet,项目名称:FinanceAnalytics,代码行数:14,代码来源:CacheManagerComponentFactory.java

示例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;
}
 
开发者ID:sbanal,项目名称:ehcache-sample-cluster,代码行数:8,代码来源:EhCacheApplication.java

示例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;
}
 
开发者ID:ezand,项目名称:telldus-rest,代码行数:8,代码来源:CacheConfig.java


注:本文中的org.springframework.cache.ehcache.EhCacheManagerFactoryBean类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。