Package de.laures.cewolf.taglib.util

Examples of de.laures.cewolf.taglib.util.DatasetProductionTimeStore


    public Dataset getDataset() throws DatasetProduceException {
        Assert.check(producer != null, "you need to specifiy a producer for the data of the chart.");
        if (data == null) {
            data = (Dataset) producer.produceDataset(datasetProductionParams);
            DatasetProductionTimeStore dataCache = DatasetProductionTimeStore.getInstance();
            dataCache.addEntry(producer.getProducerId(), datasetProductionParams, new Date(datasetProduceTime));
        }
        Assert.check(data != null, "your producer of type " + producer.getClass().getName() + " produced a null dataset.");
        return data;
    }
View Full Code Here


     * This method is called during serialization to ensure the same serialized
     * representation of this and a eventually formally stored object.
     */
    private void checkDataProductionNeed() {
        final String prodId = producer.getProducerId();
        DatasetProductionTimeStore dataCache = DatasetProductionTimeStore.getInstance();
        if (useCache && dataCache.containsEntry(prodId, datasetProductionParams)) {
            Date produceTime = dataCache.getProductionTime(prodId, datasetProductionParams);
            // cached data available
            if (!producer.hasExpired(datasetProductionParams, produceTime)) {
                this.datasetProduceTime = produceTime.getTime();
                return;
            }
            dataCache.removeEntry(prodId, datasetProductionParams);
        }
        datasetProduceTime = System.currentTimeMillis();
    }
View Full Code Here

        Assert.check(producer != null, "you need to specifiy a producer for the data of the chart.");
        log.debug("getting data..");
        if (data == null) {
            log.debug("producing new dataset for " + producer.getProducerId());
            data = (Dataset) producer.produceDataset(datasetProductionParams);
            DatasetProductionTimeStore dataCache = DatasetProductionTimeStore.getInstance();
            dataCache.addEntry(producer.getProducerId(), datasetProductionParams, new Date(datasetProduceTime));
        }
        Assert.check(data != null, "your producer of type " + producer.getClass().getName() + " produced a null dataset.");
        return data;
    }
View Full Code Here

    private void checkDataProductionNeed() {
        log.debug("checking data actuality..." + producer + ", " + datasetProductionParams);
        final String prodId = producer.getProducerId();
        log.debug(prodId + ", " + KeyGenerator.generateKey((Serializable)datasetProductionParams));
        log.debug("useCache = " + useCache);
        DatasetProductionTimeStore dataCache = DatasetProductionTimeStore.getInstance();
        if (useCache && dataCache.containsEntry(prodId, datasetProductionParams)) {
            Date produceTime = dataCache.getProductionTime(prodId, datasetProductionParams);
            log.debug("cached data available.");
            // cached data available
            if (!producer.hasExpired(datasetProductionParams, produceTime)) {
                log.debug("cached data is still valid.");
                this.datasetProduceTime = produceTime.getTime();
                return;
            }
            dataCache.removeEntry(prodId, datasetProductionParams);
        }
        datasetProduceTime = System.currentTimeMillis();
    }
View Full Code Here

TOP

Related Classes of de.laures.cewolf.taglib.util.DatasetProductionTimeStore

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.