org.pentaho.reporting.engine.classic.core.states
Class CascadingDataFactory

java.lang.Object
  extended by org.pentaho.reporting.engine.classic.core.CompoundDataFactory
      extended by org.pentaho.reporting.engine.classic.core.states.CascadingDataFactory
All Implemented Interfaces:
Serializable, Cloneable, CompoundDataFactorySupport, DataFactory

public class CascadingDataFactory
extends CompoundDataFactory

The cascading data factory is a collection of data-factories. Each of the child datafactories is queried in the order of their addition to the collection. This is like the CompoundDataFactory but without deriving the datafactories on addition and without forwarding the open and close calls.

Implementation note: This is a purely internal class. Any attempt to use this class as a general datafactory implementation will give you a lot of fun and happy exceptions. Just dont do it.

Author:
Thomas Morgner
See Also:
Serialized Form

Field Summary
 
Fields inherited from interface org.pentaho.reporting.engine.classic.core.DataFactory
QUERY_LIMIT, QUERY_TIMEOUT
 
Constructor Summary
CascadingDataFactory()
           
 
Method Summary
 void add(DataFactory factory)
           
 void close()
          Closes the data factory and frees all resources held by this instance.
 DataFactory derive()
          Returns a copy of the data factory that is not affected by its anchestor and holds no connection to the anchestor anymore.
 void open()
          Opens the data factory.
 
Methods inherited from class org.pentaho.reporting.engine.classic.core.CompoundDataFactory
add, cancelRunningQuery, clone, get, getDataFactoryForQuery, getDataFactoryForQuery, getQueryNames, getReference, initialize, isFreeFormQueryExecutable, isNormalized, isQueryExecutable, isStaticQueryExecutable, normalize, normalize, queryData, queryFreeForm, queryStatic, remove, remove, set, size
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CascadingDataFactory

public CascadingDataFactory()
Method Detail

add

public void add(DataFactory factory)
Overrides:
add in class CompoundDataFactory

derive

public DataFactory derive()
Returns a copy of the data factory that is not affected by its anchestor and holds no connection to the anchestor anymore. A data-factory will be derived at the beginning of the report processing.

Specified by:
derive in interface DataFactory
Overrides:
derive in class CompoundDataFactory
Returns:
a copy of the data factory.

open

public void open()
          throws ReportDataFactoryException
Opens the data factory. This initializes everything. Performing queries on data factories which have not yet been opened will result in exceptions.

Specified by:
open in interface DataFactory
Overrides:
open in class CompoundDataFactory
Throws:
ReportDataFactoryException - if an error occured while opening the datafactory resources.

close

public void close()
Closes the data factory and frees all resources held by this instance.

Specified by:
close in interface DataFactory
Overrides:
close in class CompoundDataFactory