org.objectweb.speedo.query.lib
Class SpeedoQueryManager

java.lang.Object
  extended by org.objectweb.speedo.query.lib.SpeedoQueryManager
All Implemented Interfaces:
AttributeController, BindingController, CacheEntryFactory, CacheEventListener, QueryManager, QueryManagerAttribute
Direct Known Subclasses:
EJBQueryManager, JDOQueryManager

public abstract class SpeedoQueryManager
extends java.lang.Object
implements QueryManager, CacheEntryFactory, CacheEventListener, BindingController, QueryManagerAttribute

SpeedoQueryManager manages the association between SpeedoQuery and the the compiled query: SpeedoCompiledQuery.

Author:
S.Chassande-Barrioz

Field Summary
static java.lang.String COMPILED_QUERY_CACHE_BINDING
           
protected  org.objectweb.util.monolog.api.Logger cqlogger
           
protected  org.objectweb.util.monolog.api.Logger cqpflogger
           
protected  org.objectweb.util.monolog.api.Logger cqpvlogger
           
static java.lang.String JORM_FACTORY_BINDING
           
protected  JormFactory jormFactory
           
protected  org.objectweb.util.monolog.api.Logger logger
           
protected  org.objectweb.jorm.api.PMapper mapper
           
static java.lang.String MAPPER_BINDING
           
static java.lang.String PMF_BINDING
           
protected  PrefetchBufferFactory prefetchBufferFactory
           
 
Constructor Summary
SpeedoQueryManager()
          creates a new SpeedoQueryManager object.
 
Method Summary
 void bindFc(java.lang.String s, java.lang.Object o)
           
 void clean()
          Clean the query manager.
 FixableCacheEntry create(java.lang.Object id, java.lang.Object obj)
           
protected abstract  CompiledQuery createCompileQuery(QueryDefinition qd)
           
 void entryBound(CacheEvent event)
          An entry has been added in the cache.
 void entryUnbound(CacheEvent event)
          An entry has been evicted from the cache.
 POManagerFactoryItf getPMF()
           
 boolean getPrefetchActivatedOnExtent()
          Indicates of the prefetching mode on extent
 boolean getPrefetchActivatedOnQuery()
          Indicates of the prefetching mode on query
 CompiledQuery getQueryCompiler(QueryDefinition qd)
          returns a CompiledQuery implementation, creates it if it does not exists, or just returns an existing one.
 java.lang.String[] listFc()
           
 java.lang.Object lookupFc(java.lang.String s)
           
 void setPMF(POManagerFactoryItf pmf)
           
 void setPrefetchActivatedOnExtent(boolean prefetch)
          Assignes of the prefetching mode on extent
 void setPrefetchActivatedOnQuery(boolean prefetch)
          Assignes of the prefetching mode on query
 void unbindFc(java.lang.String s)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MAPPER_BINDING

public static final java.lang.String MAPPER_BINDING
See Also:
Constant Field Values

JORM_FACTORY_BINDING

public static final java.lang.String JORM_FACTORY_BINDING
See Also:
Constant Field Values

COMPILED_QUERY_CACHE_BINDING

public static final java.lang.String COMPILED_QUERY_CACHE_BINDING
See Also:
Constant Field Values

PMF_BINDING

public static final java.lang.String PMF_BINDING
See Also:
Constant Field Values

mapper

protected org.objectweb.jorm.api.PMapper mapper

jormFactory

protected JormFactory jormFactory

prefetchBufferFactory

protected PrefetchBufferFactory prefetchBufferFactory

logger

protected org.objectweb.util.monolog.api.Logger logger

cqlogger

protected org.objectweb.util.monolog.api.Logger cqlogger

cqpvlogger

protected org.objectweb.util.monolog.api.Logger cqpvlogger

cqpflogger

protected org.objectweb.util.monolog.api.Logger cqpflogger
Constructor Detail

SpeedoQueryManager

public SpeedoQueryManager()
creates a new SpeedoQueryManager object.

Method Detail

create

public FixableCacheEntry create(java.lang.Object id,
                                java.lang.Object obj)
Specified by:
create in interface CacheEntryFactory

getPrefetchActivatedOnQuery

public boolean getPrefetchActivatedOnQuery()
Description copied from interface: QueryManagerAttribute
Indicates of the prefetching mode on query

Specified by:
getPrefetchActivatedOnQuery in interface QueryManagerAttribute

setPrefetchActivatedOnQuery

public void setPrefetchActivatedOnQuery(boolean prefetch)
Description copied from interface: QueryManagerAttribute
Assignes of the prefetching mode on query

Specified by:
setPrefetchActivatedOnQuery in interface QueryManagerAttribute

getPrefetchActivatedOnExtent

public boolean getPrefetchActivatedOnExtent()
Description copied from interface: QueryManagerAttribute
Indicates of the prefetching mode on extent

Specified by:
getPrefetchActivatedOnExtent in interface QueryManagerAttribute

setPrefetchActivatedOnExtent

public void setPrefetchActivatedOnExtent(boolean prefetch)
Description copied from interface: QueryManagerAttribute
Assignes of the prefetching mode on extent

Specified by:
setPrefetchActivatedOnExtent in interface QueryManagerAttribute

listFc

public java.lang.String[] listFc()
Specified by:
listFc in interface BindingController

lookupFc

public java.lang.Object lookupFc(java.lang.String s)
Specified by:
lookupFc in interface BindingController

bindFc

public void bindFc(java.lang.String s,
                   java.lang.Object o)
Specified by:
bindFc in interface BindingController

unbindFc

public void unbindFc(java.lang.String s)
Specified by:
unbindFc in interface BindingController

entryBound

public void entryBound(CacheEvent event)
An entry has been added in the cache.

Specified by:
entryBound in interface CacheEventListener
Parameters:
event - describes the added entry

entryUnbound

public void entryUnbound(CacheEvent event)
An entry has been evicted from the cache.

Specified by:
entryUnbound in interface CacheEventListener
Parameters:
event - describes the evicted entry

getQueryCompiler

public CompiledQuery getQueryCompiler(QueryDefinition qd)
returns a CompiledQuery implementation, creates it if it does not exists, or just returns an existing one.

Specified by:
getQueryCompiler in interface QueryManager
Parameters:
qd - a QueryDefinition
Returns:
a (new/existing) CompiledQuery instance.

getPMF

public POManagerFactoryItf getPMF()
Specified by:
getPMF in interface QueryManager

setPMF

public void setPMF(POManagerFactoryItf pmf)
Specified by:
setPMF in interface QueryManager

clean

public void clean()
Description copied from interface: QueryManager
Clean the query manager.

Specified by:
clean in interface QueryManager

createCompileQuery

protected abstract CompiledQuery createCompileQuery(QueryDefinition qd)