當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。