comparison gnv-artifacts/src/main/java/de/intevation/gnv/artifacts/cache/CacheFactory.java @ 845:797a6264b89b

Integrated the CacheCleaner for the ThematicDataCache gnv-artifacts/trunk@961 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Tim Englich <tim.englich@intevation.de>
date Tue, 20 Apr 2010 18:38:22 +0000
parents feae2f9d6c6f
children cf421645a2d3
comparison
equal deleted inserted replaced
844:74608c12b4fe 845:797a6264b89b
2 2
3 import net.sf.ehcache.Cache; 3 import net.sf.ehcache.Cache;
4 import net.sf.ehcache.CacheManager; 4 import net.sf.ehcache.CacheManager;
5 5
6 import org.apache.log4j.Logger; 6 import org.apache.log4j.Logger;
7
8 import de.intevation.gnv.geobackend.base.query.cache.CacheCleaner;
9 import de.intevation.gnv.state.cache.ThematicDataCacheCleaner;
7 10
8 /** 11 /**
9 * The <code>CacheFactory</code> is used to initialize and retrieve Cache. 12 * The <code>CacheFactory</code> is used to initialize and retrieve Cache.
10 * 13 *
11 * @author <a href="mailto:tim.englich@intevation.de">Tim Englich</a> 14 * @author <a href="mailto:tim.englich@intevation.de">Tim Englich</a>
23 * The singleton Instance of this Factory. 26 * The singleton Instance of this Factory.
24 */ 27 */
25 private static CacheFactory instance = null; 28 private static CacheFactory instance = null;
26 29
27 /** 30 /**
28 * 31 * The manager of the Cache
29 */ 32 */
30 private CacheManager cacheManager = null; 33 private CacheManager cacheManager = null;
34
35 /**
36 * The Cleaner of the Cache
37 */
38 private CacheCleaner cacheCleaner = null;
31 39
32 /** 40 /**
33 * Basic-Constructor of this Class 41 * Basic-Constructor of this Class
34 */ 42 */
35 private CacheFactory() { 43 private CacheFactory() {
65 */ 73 */
66 public void initializeCache(String configurationFileName) { 74 public void initializeCache(String configurationFileName) {
67 if (cacheManager == null) { 75 if (cacheManager == null) {
68 cacheManager = new CacheManager(configurationFileName); 76 cacheManager = new CacheManager(configurationFileName);
69 cacheManager.addCache(CACHENAME); 77 cacheManager.addCache(CACHENAME);
78 this.cacheCleaner = new ThematicDataCacheCleaner();
79 this.cacheCleaner.start();
70 } 80 }
71 } 81 }
72 82
73 /** 83 /**
74 * Checks if the ConnectionPool has already been initialized. 84 * Checks if the ConnectionPool has already been initialized.

http://dive4elements.wald.intevation.org