com.tonbeller.jpivot.olap.model
Class CachingOlapModel

java.lang.Object
  extended by com.tonbeller.jpivot.core.ExtensionSupport
      extended by com.tonbeller.jpivot.olap.model.OlapModelDecorator
          extended by com.tonbeller.jpivot.olap.model.CachingOlapModel
All Implemented Interfaces:
Extension, Model, ModelChangeListener, OlapModel, com.tonbeller.wcf.bookmarks.Bookmarkable, java.util.EventListener

public class CachingOlapModel
extends OlapModelDecorator
implements ModelChangeListener

An OlapModel decorator that caches the result

Author:
av

Nested Class Summary
 
Nested classes/interfaces inherited from interface com.tonbeller.jpivot.olap.model.OlapModel
OlapModel.EmptyCubeException, OlapModel.ResultTooLargeException
 
Field Summary
 
Fields inherited from class com.tonbeller.jpivot.olap.model.OlapModelDecorator
delegate
 
Fields inherited from interface com.tonbeller.wcf.bookmarks.Bookmarkable
EXTENSIONAL, INTENSIONAL
 
Constructor Summary
CachingOlapModel()
           
 
Method Summary
 Model decorate(Model modelToDecorate)
          decorates the modelToDecorate with this
 Result getResult()
          runs the query and returns the result
 void modelChanged(ModelChangeEvent e)
          invalidates the current result
 void structureChanged(ModelChangeEvent e)
          invalidates the current result
 
Methods inherited from class com.tonbeller.jpivot.olap.model.OlapModelDecorator
addExtension, addModelChangeListener, destroy, getBookmarkState, getDelegate, getDimensions, getExtension, getExtensions, getID, getMeasures, getRootModel, getTopDecorator, initialize, removeModelChangeListener, setBookmarkState, setDelegate, setID, setLocale, setServletContext
 
Methods inherited from class com.tonbeller.jpivot.core.ExtensionSupport
getId, getModel, modelInitialized, setId, setModel
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CachingOlapModel

public CachingOlapModel()
Method Detail

modelChanged

public void modelChanged(ModelChangeEvent e)
invalidates the current result

Specified by:
modelChanged in interface ModelChangeListener

structureChanged

public void structureChanged(ModelChangeEvent e)
invalidates the current result

Specified by:
structureChanged in interface ModelChangeListener

getResult

public Result getResult()
                 throws OlapException
Description copied from interface: OlapModel
runs the query and returns the result

Specified by:
getResult in interface OlapModel
Overrides:
getResult in class OlapModelDecorator
Throws:
OlapException

decorate

public Model decorate(Model modelToDecorate)
Description copied from class: OlapModelDecorator
decorates the modelToDecorate with this

Specified by:
decorate in interface Extension
Overrides:
decorate in class OlapModelDecorator
Parameters:
modelToDecorate - the model to decorate. It may be different from the model passed to setModel() because other extensions may already have decorated modelToDecorate.
See Also:
Extension.decorate(Model)