Mercurial > dive4elements > gnv-client
comparison geo-backend/src/main/java/de/intevation/gnv/geobackend/base/query/cache/CacheCleaner.java @ 897:02cd2935b5fa
Removed trailing whitespace.
geo-backend/trunk@1013 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Ingo Weinzierl <ingo.weinzierl@intevation.de> |
---|---|
date | Wed, 28 Apr 2010 07:04:19 +0000 |
parents | eb777022b628 |
children | ebeb56428409 |
comparison
equal
deleted
inserted
replaced
896:c7756576044f | 897:02cd2935b5fa |
---|---|
31 | 31 |
32 /** | 32 /** |
33 * The Systemproperty-identifier for the Configuration of the TimeInterval | 33 * The Systemproperty-identifier for the Configuration of the TimeInterval |
34 */ | 34 */ |
35 public static final String CACHE_CLEANER_INTERVAL = "caching.cleaner.interval"; | 35 public static final String CACHE_CLEANER_INTERVAL = "caching.cleaner.interval"; |
36 | 36 |
37 /** | 37 /** |
38 * The Time To wait between two Cleanups. | 38 * The Time To wait between two Cleanups. |
39 */ | 39 */ |
40 private long timeout = 1000 * 60; // 1 Minute | 40 private long timeout = 1000 * 60; // 1 Minute |
41 | 41 |
42 /** | 42 /** |
43 * The Border which has to be used to Query the updated Tables. | 43 * The Border which has to be used to Query the updated Tables. |
44 */ | 44 */ |
45 private long lowerBorderTime = 0; | 45 private long lowerBorderTime = 0; |
46 | 46 |
125 */ | 125 */ |
126 public CacheCleaner(ThreadGroup arg0, Runnable arg1, String arg2, long arg3) { | 126 public CacheCleaner(ThreadGroup arg0, Runnable arg1, String arg2, long arg3) { |
127 super(arg0, arg1, arg2, arg3); | 127 super(arg0, arg1, arg2, arg3); |
128 this.setUp(); | 128 this.setUp(); |
129 } | 129 } |
130 | 130 |
131 /** | 131 /** |
132 * Sets up the members of the CacheCleaner. | 132 * Sets up the members of the CacheCleaner. |
133 */ | 133 */ |
134 protected void setUp(){ | 134 protected void setUp(){ |
135 String intervalValue = System.getProperty(CACHE_CLEANER_INTERVAL); | 135 String intervalValue = System.getProperty(CACHE_CLEANER_INTERVAL); |
195 .getQueryExecutor().clearCache(tableNames); | 195 .getQueryExecutor().clearCache(tableNames); |
196 } | 196 } |
197 } catch (QueryException e) { | 197 } catch (QueryException e) { |
198 log.error(e,e); | 198 log.error(e,e); |
199 } | 199 } |
200 | 200 |
201 } | 201 } |
202 | 202 |
203 /** | 203 /** |
204 * Returns the Names of the Tables which have been updated. | 204 * Returns the Names of the Tables which have been updated. |
205 * @return the Names of the Tables which have been updated. | 205 * @return the Names of the Tables which have been updated. |
211 Date date = new Date(this.lowerBorderTime); | 211 Date date = new Date(this.lowerBorderTime); |
212 this.lowerBorderTime = System.currentTimeMillis(); | 212 this.lowerBorderTime = System.currentTimeMillis(); |
213 log.debug("New Lookup at "+DateUtils.getPatternedDateAmer(new Date(lowerBorderTime))); | 213 log.debug("New Lookup at "+DateUtils.getPatternedDateAmer(new Date(lowerBorderTime))); |
214 String queryDate = DateUtils.getPatternedDateAmer(date); | 214 String queryDate = DateUtils.getPatternedDateAmer(date); |
215 Collection<Result> result = queryExecutor. | 215 Collection<Result> result = queryExecutor. |
216 executeQuery(queryID, | 216 executeQuery(queryID, |
217 new String[]{queryDate}); | 217 new String[]{queryDate}); |
218 if (result != null && !result.isEmpty()){ | 218 if (result != null && !result.isEmpty()){ |
219 tableNames = new String[result.size()]; | 219 tableNames = new String[result.size()]; |
220 Iterator<Result> it = result.iterator(); | 220 Iterator<Result> it = result.iterator(); |
221 int i = 0; | 221 int i = 0; |