diff gnv-artifacts/src/main/java/de/intevation/gnv/transition/OutputTransitionBase.java @ 300:6a3a02e004d9

Refactored process of chart generation. Charts will be generated via Chart-Interface from rev351 and no more via factory classes. gnv-artifacts/trunk@354 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Ingo Weinzierl <ingo.weinzierl@intevation.de>
date Fri, 20 Nov 2009 13:51:14 +0000
parents 3d6d89bcbf42
children 91c37bf28c0e
line wrap: on
line diff
--- a/gnv-artifacts/src/main/java/de/intevation/gnv/transition/OutputTransitionBase.java	Thu Nov 19 17:54:18 2009 +0000
+++ b/gnv-artifacts/src/main/java/de/intevation/gnv/transition/OutputTransitionBase.java	Fri Nov 20 13:51:14 2009 +0000
@@ -145,6 +145,20 @@
         }
         return null;
     }
+
+    protected Object getChartFromCache(String uuid) {
+        log.debug("Fetch chart [" + uuid + "] 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) {
+                return object.getObjectValue();
+            }
+        }
+        return null;
+    }
     
     protected Collection<Result> getODVResult(String uuid) {
         log.debug("OutputTransitionBase.getODVResult");
@@ -197,6 +211,16 @@
         }
     }
 
+
+    protected void purifyChart(Object chart, String uuid) {
+        log.debug("Prufify chart [" + uuid + "]");
+        CacheFactory cacheFactory = CacheFactory.getInstance();
+        if (cacheFactory.isInitialized()) {
+            String key = "chart_" + uuid + getID();
+            cacheFactory.getCache().put(new net.sf.ehcache.Element(key, chart));
+        }
+    }
+
     /**
      * @see de.intevation.gnv.transition.TransitionBase#putInputData(java.util.Collection, java.lang.String)
      */

http://dive4elements.wald.intevation.org