org.ow2.jonas.lib.ejb21.jorm
Class MedorFactory

java.lang.Object
  extended by org.ow2.jonas.lib.ejb21.JFactory
      extended by org.ow2.jonas.lib.ejb21.JEntityFactory
          extended by org.ow2.jonas.lib.ejb21.jorm.JormFactory
              extended by org.ow2.jonas.lib.ejb21.jorm.MedorFactory
All Implemented Interfaces:
TimerService, org.objectweb.jorm.api.PClassMapping, org.objectweb.jorm.api.PClassMappingCtrl, BeanFactory
Direct Known Subclasses:
RdbFactory

public abstract class MedorFactory
extends JormFactory

This class does the initialisation of Medor and permits to access to the query. The optimisation of the query tree is done during the first time that it is used.

Author:
S.Chassande-Barrioz

Nested Class Summary
 
Nested classes/interfaces inherited from interface org.objectweb.jorm.api.PClassMapping
org.objectweb.jorm.api.PClassMapping.ReferenceConfigurator
 
Field Summary
protected  org.objectweb.medor.optim.api.ExecPlanGenerator indexesGenerator
           
protected  org.objectweb.jorm.metainfo.api.Manager miManager
           
protected  boolean optimizeAtInit
           
protected  org.objectweb.medor.optim.api.QueryTransformer queryTransformer
          This field references the query transformer which must be used to optimize the medor requests.
 
Fields inherited from class org.ow2.jonas.lib.ejb21.jorm.JormFactory
ecd, mapped, mapper, relNonInit
 
Fields inherited from class org.ow2.jonas.lib.ejb21.JEntityFactory
bctxlist, cmp2, datasource, hardLimit, home, instanceCount, localhome, lockPolicy, prefetch, readTimeout, reentrant, shared, txlist
 
Fields inherited from class org.ow2.jonas.lib.ejb21.JFactory
beanclass, cont, dd, dispatcher, ejb10Env, ejbname, ejbTimeoutSignature, isClusterReplicated, JNDICtx, maxCacheSize, minPoolSize, myTimerService, naming, passivationDir, stopped, timerTxAttr, tm, txbeanmanaged, wm
 
Fields inherited from interface org.objectweb.jorm.api.PClassMapping
CLEANUP_DONOTHING, CLEANUP_REMOVEALL, CLEANUP_REMOVEDATA, CREATE_STRUCTURE_IF_NEEDED
 
Constructor Summary
MedorFactory()
           
 
Method Summary
 org.objectweb.medor.tuple.api.TupleCollection evaluate(Object conn, int methodIndex, org.objectweb.medor.expression.api.ParameterOperand[] parameters)
          It evaluate an optimized medor request according to the specified parameters To evalute the medor request the query evaluator is used.
 EjbqlQueryTreeHolder getQueryTreeHolder(int methodIndex)
          Build the EjbqlQueryTreeHolder or just return it if already there.
 void init(EntityDesc ed, JContainer c, String mapperName)
          Initialization of the factory.
 
Methods inherited from class org.ow2.jonas.lib.ejb21.jorm.JormFactory
configurePnc, createNewContext, decodePK, encodePK, getConnection, getJEntitySwitch, getMapper, initGenClassPrefetch, newGCMInstance, releaseConnection, setMapper, stop
 
Methods inherited from class org.ow2.jonas.lib.ejb21.JEntityFactory
bindEJB, calculateAutomaticPk, checkTransaction, createNewInstance, createTimer, createTimer, createTimer, createTimer, dirtyInstances, dummyFinderException, existEJB, getCacheSize, getCurrentWaiters, getDataSource, getDeadlockTimeout, getEJB, getEntityCounters, getHome, getInactivityTimeout, getJContext, getLocalHome, getLockPolicy, getMaxWaitTime, getPassivationTimeout, getPoolSize, getReadTimeout, getSelectForUpdate, getTimers, getTimerService, init, initInstancePool, isCMP2, isDeadLocked, isHardLimit, isPrefetch, isReentrant, isShared, rebindEJB, reduceCache, registerContext, registerEJB, releaseJContext, releaseJContext, removeEJB, removeTxListener, setDeadlockTimeout, setInactivityTimeout, setMaxWaitTime, setPassivationTimeout, storeInstances, syncDirty, syncForFind, syncForSelect, synchronizeEntities, tooManyInstances, unregisterContext
 
Methods inherited from class org.ow2.jonas.lib.ejb21.JFactory
checkJonasVersion, checkSecurity, checkTransactionContainer, getContainer, getDeploymentDescriptor, getDispatcher, getEjb10Environment, getEJBName, getEjbTimeoutSignature, getEnv, getFileList, getInitialContext, getMaxCacheSize, getMinPoolSize, getPassivationDir, getResourceCheckerManager, getTimerTxAttribute, getTransactionManager, getWorkManager, init, isClassAvailable, isStopped, isTxBeanManaged, myClassLoader, postInvoke, postInvokeRemote, preInvoke, preInvokeRemote, resetComponentContext, restartTimers, setComponentContext, setDispatcher, setResourceCheckerManager, stopContainer
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.objectweb.jorm.api.PClassMapping
addAssociation, classDefined, configureRefFields, createPBinding, exist, getAssociationTable, getClassName, getClassPNameCoder, getDecodedPName, getGenClassMapping, getGenClassMapping, getIndexesTable, getMetaInfo, getPBinder, getPMapper, getPNameCoder, getPNameCoder, getPNameIterator, getPNameIterator, getProjectName, getPType, getSubPCMs, init, init, isConform, match, read, read, read, resolve, setPBinder, write
 
Methods inherited from interface org.objectweb.jorm.api.PClassMappingCtrl
setClassPNameCoder, setGenClassMapping, setGenClassMapping, setPNameCoder, setPNameCoder, setProjectName
 

Field Detail

queryTransformer

protected org.objectweb.medor.optim.api.QueryTransformer queryTransformer
This field references the query transformer which must be used to optimize the medor requests.


miManager

protected org.objectweb.jorm.metainfo.api.Manager miManager

indexesGenerator

protected org.objectweb.medor.optim.api.ExecPlanGenerator indexesGenerator

optimizeAtInit

protected boolean optimizeAtInit
Constructor Detail

MedorFactory

public MedorFactory()
Method Detail

getQueryTreeHolder

public EjbqlQueryTreeHolder getQueryTreeHolder(int methodIndex)
                                        throws Exception
Build the EjbqlQueryTreeHolder or just return it if already there.

Parameters:
methodIndex - is method index which permits to find a medor request.
Returns:
the QueryTreeHolder for that method
Throws:
Exception

evaluate

public org.objectweb.medor.tuple.api.TupleCollection evaluate(Object conn,
                                                              int methodIndex,
                                                              org.objectweb.medor.expression.api.ParameterOperand[] parameters)
                                                       throws org.objectweb.medor.api.MedorException
It evaluate an optimized medor request according to the specified parameters To evalute the medor request the query evaluator is used.

Parameters:
conn - is the connection handle
methodIndex - is method index which permits to find a medor request.
parameters - is the parameters (key=parameter name / value=parameter value)
Returns:
TupleCollection is the result of the request
Throws:
org.objectweb.medor.api.MedorException

init

public void init(EntityDesc ed,
                 JContainer c,
                 String mapperName)
Description copied from class: JormFactory
Initialization of the factory. This is called just after the newInstance() from the JContainer (addBean method)

Overrides:
init in class JormFactory


Copyright © 2010 OW2 Consortium. All Rights Reserved.