org.objectweb.medor.datasource.api
Interface WrapperFactory

All Known Implementing Classes:
MedorWrapperFactory

public interface WrapperFactory

A WrapperFactory is called at evaluation time by the QueryEvaluator when reaching a QueryLeaf. The WrapperFactory generates the appropriate Wrapper for the QueryLeaf. It maintains its pool of Wrappers.

Author:
Sebastien Chassande-Barrioz

Method Summary
 void bindDataStoreToWrapper(short dataStoreType, java.lang.Class wrapperClass)
          For a given data store type, associates a Wrapper class.
 Wrapper getWrapper(DataStore dl)
           
 

Method Detail

getWrapper

public Wrapper getWrapper(DataStore dl)
                   throws DataSourceException
Throws:
DataSourceException

bindDataStoreToWrapper

public void bindDataStoreToWrapper(short dataStoreType,
                                   java.lang.Class wrapperClass)
                            throws DataSourceException
For a given data store type, associates a Wrapper class. This will be used by the evaluator to associate the right Wrapper to each query leaf (data store). The Wrapper class must have an empty constructor (because it is instanciated using newInstance).

Parameters:
dataStoreType - is the type of data store (DataStore.getDataStoreType())
wrapperClass - is the java Class for the associated Wrapper.
Throws:
DataSourceException