1 package info.magnolia.cms.cache; 2 3 import javax.jcr.observation.EventIterator; 4 import javax.jcr.observation.EventListener; 5 6 7 13 class CacheConfigListener implements EventListener { 14 15 private CacheManager cacheManager; 16 17 private CacheConfig cacheConfig; 18 19 protected CacheConfigListener(CacheManager cacheManager, CacheConfig cacheConfig) { 20 this.cacheManager = cacheManager; 21 this.cacheConfig = cacheConfig; 22 } 23 24 public void onEvent(EventIterator events) { 25 try { 26 this.cacheConfig.reload(); 27 } 28 catch (Exception e) { 29 throw new RuntimeException (e); 30 } 31 32 this.cacheManager.restart(); 34 } 35 } 36 | Popular Tags |