KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > info > magnolia > cms > cache > CacheConfigListener


1 package info.magnolia.cms.cache;
2
3 import javax.jcr.observation.EventIterator;
4 import javax.jcr.observation.EventListener;
5
6
7 /**
8  * @author Andreas Brenk
9  * @author Fabrizio Giustina
10  * @since 3.0
11  * $Id: CacheConfigListener.java 6341 2006-09-12 09:18:27Z philipp $
12  */

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 JavaDoc e) {
29             throw new RuntimeException JavaDoc(e);
30         }
31
32         // this.cacheManager.setConfigNode(this.content); // FIXME
33
this.cacheManager.restart();
34     }
35 }
36
Popular Tags