de.laures.cewolf
Interface DatasetProducer

All Superinterfaces:
java.io.Serializable
All Known Implementing Classes:
DataSourceXYDatasetProducer, MovingAverageDatasetProducer

public interface DatasetProducer
extends java.io.Serializable

Produces a Dataset which will be rendered as a chart afterwards.

Author:
Guido Laures
See Also:
Dataset

Field Summary
static java.lang.String PRODUCER_ATTRIBUTE_NAME
          By default the the name of the JSP attribute holding the producer instance is passed to the produceDataset method as a prameter.
 
Method Summary
 java.lang.String getProducerId()
          Tis method returns a unique ID for a DatasetProducer from this class.
 boolean hasExpired(java.util.Map params, java.util.Date since)
          This method is called by the Cewolf framework to check if a formerly produced data can be reused.
 java.lang.Object produceDataset(java.util.Map params)
          Produces a Dataset object.
 

Field Detail

PRODUCER_ATTRIBUTE_NAME

static final java.lang.String PRODUCER_ATTRIBUTE_NAME
By default the the name of the JSP attribute holding the producer instance is passed to the produceDataset method as a prameter.

See Also:
Constant Field Values
Method Detail

produceDataset

java.lang.Object produceDataset(java.util.Map params)
                                throws DatasetProduceException
Produces a Dataset object.

Parameters:
params - additional params for the dataset production. All elements of this HashMap are of type java.io.Serializable. This is necessary to ensure the the serialization of the dataset producer into the http session. To provide a producer with additional production parameters the <param> tag is used (see tag library documentation). It is recommended to synchronize implementations of this method to avoid concurrency problems.
Returns:
an object of type org.jfree.data.general.Dataset.
Throws:
DatasetProduceException - if an error occured during production

hasExpired

boolean hasExpired(java.util.Map params,
                   java.util.Date since)
This method is called by the Cewolf framework to check if a formerly produced data can be reused. If the data which had already been used for chart rendering is still valid this method should return true. If possible the Cewolf framework will try to reuse the rendered chart image. If this is not possible because of some circumstances (e.g. the chart had been removed from the image cache) the produceDataset method is called afterwards. Therefore there is no guarantee that the dataset production is always avoided if this method returns true.

Parameters:
params - the production parameters of the already produced data
since - the point in time when the already produced data had been produced
Returns:
true if the data which had been produced with the passed in parameters has expired since its creation, false otherwise

getProducerId

java.lang.String getProducerId()
Tis method returns a unique ID for a DatasetProducer from this class. Producers with the same ID are supposed to produce the same data when called with the same parameters.

Returns:
the unique ID for instances of this poducer class


cewolf tag library - web charts with JFreeChart