Package org.springframework.cache.ehcache

Examples of org.springframework.cache.ehcache.EhCacheFactoryBean.afterPropertiesSet()


    if(env.getProperty("setting.cacheable", Boolean.class, Boolean.FALSE)){
      EhCacheFactoryBean cacheFactory = new EhCacheFactoryBean();
      //use default cache manager CacheManager.getInstance();
      cacheFactory.setCacheName("settingCache");
      try{
        cacheFactory.afterPropertiesSet();
      }catch(Exception e){
        //TODO: do something
        e.printStackTrace();
      }
      Ehcache settingCache = cacheFactory.getObject();
View Full Code Here


    if(cacheable){
      EhCacheFactoryBean cacheFactory = new EhCacheFactoryBean();
      //use default cache manager CacheManager.getInstance();
      cacheFactory.setCacheName("messageCache");
      try {
        cacheFactory.afterPropertiesSet();
      } catch (Exception e) {
        throw new IllegalStateException(e.getMessage(), e);
      }
      messageResolver.setCacheable(true);
      messageResolver.setCache(cacheFactory.getObject());
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.