diff 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
line wrap: on
line diff
--- a/gnv-artifacts/src/main/java/de/intevation/gnv/transition/OutputTransitionBase.java	Mon Nov 23 17:01:28 2009 +0000
+++ b/gnv-artifacts/src/main/java/de/intevation/gnv/transition/OutputTransitionBase.java	Mon Nov 23 17:20:14 2009 +0000
@@ -197,6 +197,18 @@
         }
     }
 
+    protected void removeChart(String uuid) {
+        log.debug("OutputTransitionBase.removeChart from cache");
+
+        CacheFactory cacheFactory = CacheFactory.getInstance();
+        if (cacheFactory.isInitialized()) {
+            String key = "chart_" + uuid + super.getID();
+            net.sf.ehcache.Element object = cacheFactory.getCache().get(key);
+            if (object != null)
+                cacheFactory.getCache().remove(key);
+        }
+    }
+
     /**
      * @see de.intevation.gnv.transition.TransitionBase#purifyResult(java.util.Collection,
      *      java.lang.String)
@@ -230,6 +242,7 @@
                                          throws TransitionException {
         log.debug("OutputTransitionBase.putInputData");
         this.removeChartResult(uuid);
+        this.removeChart(uuid);
         super.putInputData(inputData, uuid);
     }
 

http://dive4elements.wald.intevation.org