org.objectweb.speedo.mim.api
Interface HomeItf

All Superinterfaces:
org.objectweb.jorm.util.api.Loggable, org.objectweb.jorm.api.PClassMapping, UserCacheManager
All Known Implementing Classes:
AbstractGenClassHome, AbstractHomeImpl, EJBAbstractHomeImpl, EJBGenClassHome, JDOAbstractHomeImpl, JDOGenClassHome

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

It defines a home for a persitent class. Homes manage some properties (detacheable, cacheable, prefetch on query, prefetch on extent, ...) and some features (the user cache, named queries). It references the TPM, the PMF.

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
static byte ALL
           
static byte CACHED
           
static byte FIXED
           
static byte NO_CACHE
           
static int POST_ATTACH
           
static int POST_CLEAR
           
static int POST_CREATE
           
static int POST_DELETE
           
static int POST_DETACH
           
static int POST_DIRTY
           
static int POST_LOAD
           
static int POST_NEW
           
static int POST_REMOVE
           
static int POST_UPDATE
           
static int PRE_ATTACH
           
static int PRE_CLEAR
           
static int PRE_CREATE
           
static int PRE_DELETE
           
static int PRE_DETACH
           
static int PRE_DIRTY
           
static int PRE_NEW
           
static int PRE_REMOVE
           
static int PRE_UPDATE
           
 
Fields inherited from interface org.objectweb.jorm.api.PClassMapping
CLEANUP_DONOTHING, CLEANUP_REMOVEALL, CLEANUP_REMOVEDATA, CREATE_STRUCTURE_IF_NEEDED
 
Method Summary
 void addInstanceLifeCycleListener(java.lang.Object listener)
           
 QueryDefinition addNamedQuery(java.lang.String name, QueryDefinition query)
          Defines a named query
 boolean allLoaded()
           
 void attachCopy(PersistentObjectItf sp, POManagerItf pm, java.util.Map map, java.lang.Object clone, StateItf sa)
           
 PersistentObjectItf detachCopy(PersistentObjectItf sp, POManagerItf 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()
           
 POManagerFactoryItf getPOManagerFactory()
           
 boolean getPrefetchOnExtent()
           
 boolean getPrefetchOnGenClass()
           
 boolean getPrefetchOnQuery()
           
 java.lang.String getProjectName()
           
 StateItf getState(PersistentObjectItf sp)
           
 TransactionalPersistenceManager getTransactionalPersistenceManager()
           
 byte getVersioningStrategy()
          The versioning strategy.
 boolean hasInstanceLifeCycleListeners()
           
 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.
 boolean isShareable()
           
 StateItf readIntention(PersistentObjectItf sp, long[] fields)
          Notifies the transactional persistency manager of a read intention for the given persistent instance.
 void removeInstanceLifeCycleListener(java.lang.Object listener)
           
 QueryDefinition removeNamedQuery(java.lang.String name)
          Remove a named query
 void sendEvent(int eventType, java.lang.Object source, java.lang.Object target)
           
 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 setPOManagerFactory(POManagerFactoryItf _pmf)
          It assignes a PersistenceManagerFactory
 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 setShareable(boolean v)
           
 void setTransactionalPersistenceManager(TransactionalPersistenceManager _tpm)
          It assignes a TransactionalPersistenceManager
 StateItf writeIntention(PersistentObjectItf sp, long[] fields)
           
 StateItf writeIntention(PersistentObjectItf 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, 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

PRE_NEW

static final int PRE_NEW
See Also:
Constant Field Values

POST_NEW

static final int POST_NEW
See Also:
Constant Field Values

PRE_CREATE

static final int PRE_CREATE
See Also:
Constant Field Values

POST_CREATE

static final int POST_CREATE
See Also:
Constant Field Values

PRE_REMOVE

static final int PRE_REMOVE
See Also:
Constant Field Values

POST_REMOVE

static final int POST_REMOVE
See Also:
Constant Field Values

PRE_DELETE

static final int PRE_DELETE
See Also:
Constant Field Values

POST_DELETE

static final int POST_DELETE
See Also:
Constant Field Values

POST_LOAD

static final int POST_LOAD
See Also:
Constant Field Values

PRE_UPDATE

static final int PRE_UPDATE
See Also:
Constant Field Values

POST_UPDATE

static final int POST_UPDATE
See Also:
Constant Field Values

PRE_CLEAR

static final int PRE_CLEAR
See Also:
Constant Field Values

POST_CLEAR

static final int POST_CLEAR
See Also:
Constant Field Values

PRE_DIRTY

static final int PRE_DIRTY
See Also:
Constant Field Values

POST_DIRTY

static final int POST_DIRTY
See Also:
Constant Field Values

PRE_DETACH

static final int PRE_DETACH
See Also:
Constant Field Values

POST_DETACH

static final int POST_DETACH
See Also:
Constant Field Values

PRE_ATTACH

static final int PRE_ATTACH
See Also:
Constant Field Values

POST_ATTACH

static final int POST_ATTACH
See Also:
Constant Field Values

NO_CACHE

static final byte NO_CACHE
See Also:
Constant Field Values

CACHED

static final byte CACHED
See Also:
Constant Field Values

FIXED

static final byte FIXED
See Also:
Constant Field Values

ALL

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

getProjectName

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

isDetachable

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


isCacheable

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

boolean hasToFix()

allLoaded

boolean allLoaded()

setCachePolicy

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


isShareable

boolean isShareable()

setShareable

void setShareable(boolean v)

isFieldLockingLevel

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

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

byte getVersioningStrategy()
The versioning strategy.

See Also:
speedo.metadata.SpeeedoVersion, speedo.metadata.SpeeedoVersion, NO_VERSION

getPOManagerFactory

POManagerFactoryItf getPOManagerFactory()
Returns:
the PersistenceManagerFactory representing the data support where the po is persistent.

setPOManagerFactory

void setPOManagerFactory(POManagerFactoryItf _pmf)
It assignes a PersistenceManagerFactory

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

getTransactionalPersistenceManager

TransactionalPersistenceManager getTransactionalPersistenceManager()
Returns:
the TransactionalPersistenceManager which manages the concurrency, loading, caching ... of the proxies.

setTransactionalPersistenceManager

void setTransactionalPersistenceManager(TransactionalPersistenceManager _tpm)
It assignes a TransactionalPersistenceManager

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

readIntention

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

Parameters:
sp - is the PersistentObjectItf 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

StateItf writeIntention(PersistentObjectItf 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 PersistentObjectItf 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

StateItf writeIntention(PersistentObjectItf sp,
                        long[] fields)

getState

StateItf getState(PersistentObjectItf sp)

detachCopy

PersistentObjectItf detachCopy(PersistentObjectItf sp,
                               POManagerItf pm,
                               java.util.Map map,
                               java.lang.Object clone,
                               java.util.Collection fgHints)

attachCopy

void attachCopy(PersistentObjectItf sp,
                POManagerItf pm,
                java.util.Map map,
                java.lang.Object clone,
                StateItf sa)

getClassProperties

java.util.Properties getClassProperties()

addNamedQuery

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

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

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

void initSH()

getPath

java.lang.String getPath()

setPrefetchOnQuery

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


getPrefetchOnQuery

boolean getPrefetchOnQuery()

setPrefetchOnExtent

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


getPrefetchOnExtent

boolean getPrefetchOnExtent()

setPrefetchOnGenClass

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


getPrefetchOnGenClass

boolean getPrefetchOnGenClass()

addInstanceLifeCycleListener

void addInstanceLifeCycleListener(java.lang.Object listener)

removeInstanceLifeCycleListener

void removeInstanceLifeCycleListener(java.lang.Object listener)

sendEvent

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

hasInstanceLifeCycleListeners

boolean hasInstanceLifeCycleListeners()