org.objectweb.speedo.mim.api
Interface SpeedoHome

All Superinterfaces:
org.objectweb.jorm.util.api.Loggable, org.objectweb.jorm.api.PClassMapping, UserCacheManager
All Known Implementing Classes:
SpeedoHomeImpl

public interface SpeedoHome
extends org.objectweb.jorm.api.PClassMapping, UserCacheManager, org.objectweb.jorm.util.api.Loggable

It defines a home for a persitent class. The home groups common fields and methods.

Author:
S.Chassande-Barrioz

Nested Class Summary
 
Nested classes inherited from class org.objectweb.jorm.api.PClassMapping
org.objectweb.jorm.api.PClassMapping.ReferenceConfigurator
 
Field Summary
static byte ALL
           
static byte CACHED
           
static byte FIXED
           
static byte NO_CACHE
           
 
Fields inherited from interface org.objectweb.jorm.api.PClassMapping
CLEANUP_DONOTHING, CLEANUP_REMOVEALL, CLEANUP_REMOVEDATA, CREATE_STRUCTURE_IF_NEEDED
 
Method Summary
 void addInstanceLifeCycleListener(javax.jdo.listener.InstanceLifecycleListener listener)
           
 QueryDefinition addNamedQuery(java.lang.String name, QueryDefinition query)
          Defines a named query
 boolean allLoaded()
           
 void attachCopy(SpeedoProxy sp, ProxyManager pm, java.util.Map map, java.lang.Object clone, SpeedoAccessor sa, boolean makeTransactional)
           
 SpeedoProxy detachCopy(SpeedoProxy sp, ProxyManager pm, java.util.Map map, java.lang.Object clone, java.util.Collection fgHints)
           
 java.util.Properties getClassProperties()
           
 QueryDefinition getNamedQuery(java.lang.String name)
          Retrieves a query defintion from its name.
 java.lang.String getPath()
           
 boolean getPrefetchOnExtent()
           
 boolean getPrefetchOnGenClass()
           
 boolean getPrefetchOnQuery()
           
 java.lang.String getProjectName()
           
 ProxyManagerFactory getProxyManagerFactory()
           
 SpeedoAccessor getSpeedoAccessor(SpeedoProxy sp)
           
 org.objectweb.perseus.persistence.api.TransactionalPersistenceManager getTransactionalPersistenceManager()
           
 byte getVersioningStrategy()
          The versioning strategy.
 boolean hasToFix()
           
 void initSH()
           
 boolean isCacheable()
          Indicates if the state of persistent instance managed by this home, are kept between two transaction.
 boolean isDetachable()
          Indicates if the class has been marked as detacheable
 boolean isFieldLockingLevel()
          Indicates if the locking level must be the field.
 SpeedoAccessor readIntention(SpeedoProxy sp, long[] fields)
          Notifies the transactional persistency manager of a read intention for the given persistent instance.
 void removeInstanceLifeCycleListener(javax.jdo.listener.InstanceLifecycleListener listener)
           
 QueryDefinition removeNamedQuery(java.lang.String name)
          Remove a named query
 void sendEvent(int eventType, java.lang.Object source, java.lang.Object target, boolean pre)
           
 void setCachePolicy(byte v)
          Permit to Indicate if the state of persistent instance managed by this home, are kept between two transaction.
 void setFieldLockingLevel(boolean val)
          Permits to Indicate if the locking level must be the field.
 void setPrefetchOnExtent(boolean prefetch)
          Indicates if the prefetching must be activated on extents when they return instance corresponding to this home.
 void setPrefetchOnGenClass(boolean prefetch)
          Indicates if the prefetching must be activated genclass loading.
 void setPrefetchOnQuery(boolean prefetch)
          Indicates if the prefetching must be activated on queries when they return instance corresponding to this home.
 void setProxyManagerFactory(ProxyManagerFactory _pmf)
          It assignes a PersistenceManagerFactory
 void setTransactionalPersistenceManager(org.objectweb.perseus.persistence.api.TransactionalPersistenceManager _tpm)
          It assignes a TransactionalPersistenceManager
 SpeedoAccessor writeIntention(SpeedoProxy sp, long[] fields)
           
 SpeedoAccessor writeIntention(SpeedoProxy sp, long[] fields, java.lang.Object thinLock)
          Notifies the transactional persistency manager of a write intention for the given persistent instance.
 
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, getPType, getSubPCMs, init, init, isConform, match, read, read, resolve, setPBinder, write
 
Methods inherited from interface org.objectweb.speedo.usercache.api.UserCacheManager
activeUserCache, getActiveUserCache, getUserCache, getUserCache, userCacheEntryUnbound
 
Methods inherited from interface org.objectweb.jorm.util.api.Loggable
getLogger, getLoggerFactory, setLogger, setLoggerFactory
 

Field Detail

NO_CACHE

public static final byte NO_CACHE
See Also:
Constant Field Values

CACHED

public static final byte CACHED
See Also:
Constant Field Values

FIXED

public static final byte FIXED
See Also:
Constant Field Values

ALL

public static final byte ALL
See Also:
Constant Field Values
Method Detail

getProjectName

public java.lang.String getProjectName()
Specified by:
getProjectName in interface org.objectweb.jorm.api.PClassMapping

isDetachable

public boolean isDetachable()
Indicates if the class has been marked as detacheable


isCacheable

public boolean isCacheable()
Indicates if the state of persistent instance managed by this home, are kept between two transaction.

Returns:
true means the state is kept between transaction.

hasToFix

public boolean hasToFix()

allLoaded

public boolean allLoaded()

setCachePolicy

public void setCachePolicy(byte v)
Permit to Indicate if the state of persistent instance managed by this home, are kept between two transaction.


isFieldLockingLevel

public boolean isFieldLockingLevel()
Indicates if the locking level must be the field. A false value (default) means the locking level has to be done at instance level.


setFieldLockingLevel

public void setFieldLockingLevel(boolean val)
Permits to Indicate if the locking level must be the field. A false value (default) means the locking level has to be done at instance level.


getVersioningStrategy

public byte getVersioningStrategy()
The versioning strategy.

See Also:
org.objectweb.speedo.metadata.SpeeedoVersion.DATE_TIME, org.objectweb.speedo.metadata.SpeeedoVersion.STATE_COMPARISON, NO_VERSION

getProxyManagerFactory

public ProxyManagerFactory getProxyManagerFactory()
Returns:
the PersistenceManagerFactory representing the data support where the proxy is persistent.

setProxyManagerFactory

public void setProxyManagerFactory(ProxyManagerFactory _pmf)
It assignes a PersistenceManagerFactory

Parameters:
_pmf - is the PersistenceManagerFactory representing the data support where the proxy is persistent.

getTransactionalPersistenceManager

public org.objectweb.perseus.persistence.api.TransactionalPersistenceManager getTransactionalPersistenceManager()
Returns:
the TransactionalPersistenceManager which manages the concurrency, loading, caching ... of the proxies.

setTransactionalPersistenceManager

public void setTransactionalPersistenceManager(org.objectweb.perseus.persistence.api.TransactionalPersistenceManager _tpm)
It assignes a TransactionalPersistenceManager

Parameters:
_tpm - is the TransactionalPersistenceManager which manage the concurrency, loading, ... of the proxy.

readIntention

public SpeedoAccessor readIntention(SpeedoProxy sp,
                                    long[] fields)
Notifies the transactional persistency manager of a read intention for the given persistent instance.

Parameters:
sp - is the SpeedoProxy which the read access is requested.
fields - the ids of the fields that may be accessed by the caller of this method. If the i-th bit of 'fields' is set to 1, then the i-th field of the given speedo accessor may be accessed by the caller of this method.

writeIntention

public SpeedoAccessor writeIntention(SpeedoProxy sp,
                                     long[] fields,
                                     java.lang.Object thinLock)
Notifies the transactional persistency manager of a write intention for the given persistent instance.

Parameters:
sp - is the SpeedoProxy which the write access is requested.
fields - the ids of the fields that may be accessed by the caller of this method. If the i-th bit of 'fields' is set to 1, then the i-th field of the given speedo accessor may be accessed by the caller of this method.
thinLock - permits to allocate a lock on only a part of the resource. The locking size is thinner than a lock on the persistent object entirely. This parameter can be typically used to lock at the field or the genclass element levels.

writeIntention

public SpeedoAccessor writeIntention(SpeedoProxy sp,
                                     long[] fields)

getSpeedoAccessor

public SpeedoAccessor getSpeedoAccessor(SpeedoProxy sp)

detachCopy

public SpeedoProxy detachCopy(SpeedoProxy sp,
                              ProxyManager pm,
                              java.util.Map map,
                              java.lang.Object clone,
                              java.util.Collection fgHints)

attachCopy

public void attachCopy(SpeedoProxy sp,
                       ProxyManager pm,
                       java.util.Map map,
                       java.lang.Object clone,
                       SpeedoAccessor sa,
                       boolean makeTransactional)

getClassProperties

public java.util.Properties getClassProperties()

addNamedQuery

public QueryDefinition addNamedQuery(java.lang.String name,
                                     QueryDefinition query)
Defines a named query

Parameters:
name - is the name identifying the query
query - is the definition of the query
Returns:
the old query definition corresponding to the name, if it existed one.

removeNamedQuery

public QueryDefinition removeNamedQuery(java.lang.String name)
Remove a named query

Parameters:
name - is the name of the query definition to remove
Returns:
the removed query definition (null if not found)

getNamedQuery

public QueryDefinition getNamedQuery(java.lang.String name)
Retrieves a query defintion from its name. If the name is not known, the null value is returned.

Parameters:
name - is the name the wanted query definition

initSH

public void initSH()

getPath

public java.lang.String getPath()

setPrefetchOnQuery

public void setPrefetchOnQuery(boolean prefetch)
Indicates if the prefetching must be activated on queries when they return instance corresponding to this home.


getPrefetchOnQuery

public boolean getPrefetchOnQuery()

setPrefetchOnExtent

public void setPrefetchOnExtent(boolean prefetch)
Indicates if the prefetching must be activated on extents when they return instance corresponding to this home.


getPrefetchOnExtent

public boolean getPrefetchOnExtent()

setPrefetchOnGenClass

public void setPrefetchOnGenClass(boolean prefetch)
Indicates if the prefetching must be activated genclass loading. This method is only applicable for gen class home.


getPrefetchOnGenClass

public boolean getPrefetchOnGenClass()

addInstanceLifeCycleListener

public void addInstanceLifeCycleListener(javax.jdo.listener.InstanceLifecycleListener listener)

removeInstanceLifeCycleListener

public void removeInstanceLifeCycleListener(javax.jdo.listener.InstanceLifecycleListener listener)

sendEvent

public void sendEvent(int eventType,
                      java.lang.Object source,
                      java.lang.Object target,
                      boolean pre)