comparison gnv-artifacts/src/main/java/de/intevation/gnv/transition/OutputTransitionBase.java @ 305:91c37bf28c0e

Remove chart from cache when data which is displayed in chart has changed. gnv-artifacts/trunk@363 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Ingo Weinzierl <ingo.weinzierl@intevation.de>
date Mon, 23 Nov 2009 17:20:14 +0000
parents 6a3a02e004d9
children 3eff9241ea1e
comparison
equal deleted inserted replaced
304:a16d337c5678 305:91c37bf28c0e
195 CacheFactory.getInstance().getCache().remove(key); 195 CacheFactory.getInstance().getCache().remove(key);
196 } 196 }
197 } 197 }
198 } 198 }
199 199
200 protected void removeChart(String uuid) {
201 log.debug("OutputTransitionBase.removeChart from cache");
202
203 CacheFactory cacheFactory = CacheFactory.getInstance();
204 if (cacheFactory.isInitialized()) {
205 String key = "chart_" + uuid + super.getID();
206 net.sf.ehcache.Element object = cacheFactory.getCache().get(key);
207 if (object != null)
208 cacheFactory.getCache().remove(key);
209 }
210 }
211
200 /** 212 /**
201 * @see de.intevation.gnv.transition.TransitionBase#purifyResult(java.util.Collection, 213 * @see de.intevation.gnv.transition.TransitionBase#purifyResult(java.util.Collection,
202 * java.lang.String) 214 * java.lang.String)
203 */ 215 */
204 @Override 216 @Override
228 public void putInputData(Collection<InputData> inputData, 240 public void putInputData(Collection<InputData> inputData,
229 String uuid) 241 String uuid)
230 throws TransitionException { 242 throws TransitionException {
231 log.debug("OutputTransitionBase.putInputData"); 243 log.debug("OutputTransitionBase.putInputData");
232 this.removeChartResult(uuid); 244 this.removeChartResult(uuid);
245 this.removeChart(uuid);
233 super.putInputData(inputData, uuid); 246 super.putInputData(inputData, uuid);
234 } 247 }
235 248
236 public void out(String outputMode, Collection<InputData> inputData, 249 public void out(String outputMode, Collection<InputData> inputData,
237 OutputStream outputStream, String uuid, CallMeta callMeta) 250 OutputStream outputStream, String uuid, CallMeta callMeta)

http://dive4elements.wald.intevation.org