org.objectweb.speedo.genclass.api
Interface SpeedoGenClassPO

All Superinterfaces:
CacheEntry, FixableCacheEntry, org.objectweb.jorm.api.PBinding, PersistentObjectItf, ReplaceableCacheEntry, SpeedoGenClassCoherence
All Known Implementing Classes:
ArrayListImpl, CollectionImpl, EJBGenClass, GenClass, HashMapImpl, HashSetImpl, HashtableImpl, JDOGenClass, LinkedListImpl, ListImpl, MapImpl, PropertiesImpl, SetImpl, TreeMapImpl, VectorImpl

public interface SpeedoGenClassPO
extends PersistentObjectItf, SpeedoGenClassCoherence

This interfaces represents a PersistentObjectItf for a generic class (Collectio, Set, Map, ...) It permits to specify the mapper throught the generic class is persistent. The Mapper name permits to know the type of GenClassMapping and GenClassBinding (rdb, fos, ...). The PType of the generic class permit to known which is GenClassMapping instance to use.

Author:
S.Chassande-Barrioz

Field Summary
 
Fields inherited from interface org.objectweb.jorm.api.PBinding
ACTION_BIND, ACTION_EXIST, ACTION_EXPORT, ACTION_READ, ACTION_UNBIND, ACTION_UNEXPORT, ACTION_WRITE, LIFECYCLE_ACTIVEFORIO, LIFECYCLE_DELTOWRITE, LIFECYCLE_ERROR, LIFECYCLE_NEWTOWRITE, LIFECYCLE_NOTBOUND
 
Method Summary
 void clear()
           
 java.lang.Object createGenClass()
           
 void fireSpeedoElementAdded(java.lang.Object elem)
          Notifies the listeners of this gen class that an element has been added to this gen class.
 void fireSpeedoElementRemoved(java.lang.Object elem)
          Notifies the listeners of this gen class that an element has been removed to this gen class.
 void init(org.objectweb.jorm.type.api.PType ptype, java.lang.String linkedField, java.lang.Object pnameHints, org.objectweb.util.monolog.api.Logger logger)
          Initializes a Genclass instance
 void setElements(java.lang.Object o)
          Assignes the new value of the generic class (Collection, Map or Array or ...).
 void speedoAddGenClassListener(SpeedoGenClassListener l)
          Adds a listener to this gen class instance.
 java.lang.String speedoGetGenClassId()
           
 org.objectweb.jorm.api.PBinding speedoGetPBinding()
           
 org.objectweb.jorm.type.api.PType speedoGetPType()
           
 void speedoSetGcId(int gcid)
          Sets the id of this gen class instance (id of the field that references this instance).
 void speedoSetLinkedField(java.lang.String lf)
          Assignes the linked field name for this generic class.
 void speedoSetPBinding(org.objectweb.jorm.api.PBinding pb)
          assignes the PBinding to use to load/store the generic class Call this method with null value means that the generic is no more persistent.
 void speedoSetPNameHints(java.lang.Object hints)
          Assignes the hints needed to build the PName of the persistent object during the export action.
 void speedoSetPType(org.objectweb.jorm.type.api.PType ptype)
          Assignes the PType of the generic class.
 
Methods inherited from interface org.objectweb.speedo.mim.api.PersistentObjectItf
speedoAdd, speedoCopyState, speedoCreateState, speedoGetEncodedPName, speedoGetHome, speedoGetPNameHints, speedoGetPOManager, speedoGetReferenceState, speedoGetState, speedoIsActive, speedoIsActive, speedoIsPersistent, speedoSetEncodedPName, speedoSetReferenceState
 
Methods inherited from interface org.objectweb.jorm.api.PBinding
bind, exist, export, export, getPClassMapping, getPName, getStatus, init, read, read, read, unbind, unexport, write
 
Methods inherited from interface org.objectweb.perseus.cache.replacement.api.ReplaceableCacheEntry
getCeAge, setCeAge
 
Methods inherited from interface org.objectweb.perseus.cache.api.FixableCacheEntry
fixCe, getCeFixCount, unfixCe
 
Methods inherited from interface org.objectweb.perseus.cache.api.CacheEntry
getCeIdentifier, getCeObject
 
Methods inherited from interface org.objectweb.speedo.genclass.api.SpeedoGenClassCoherence
speedoAdd, speedoRemove
 

Method Detail

speedoSetPType

void speedoSetPType(org.objectweb.jorm.type.api.PType ptype)
Assignes the PType of the generic class.

Parameters:
ptype - of the generic class

speedoGetPType

org.objectweb.jorm.type.api.PType speedoGetPType()
Returns:
the PType of the generic class.

speedoGetGenClassId

java.lang.String speedoGetGenClassId()
Returns:
a string which represents the fully path of the persistent field of the class with wich the generic class is persistent. If the linked fiekf is the 'f1' provided by the class 'com.foo.Bar' then the returned string will be 'com.foo.Bar/f1'

speedoSetLinkedField

void speedoSetLinkedField(java.lang.String lf)
Assignes the linked field name for this generic class.

Parameters:
lf - is tring which represents the fully path of the persistent field of the class with wich the generic class is persistent. If the linked fiekf is the 'f1' provided by the class 'com.foo.Bar' then the expected string is 'com.foo.Bar/f1'

speedoSetPBinding

void speedoSetPBinding(org.objectweb.jorm.api.PBinding pb)
assignes the PBinding to use to load/store the generic class Call this method with null value means that the generic is no more persistent.

Parameters:
pb - is the PBinding.

speedoGetPBinding

org.objectweb.jorm.api.PBinding speedoGetPBinding()
Returns:
the pbinding associated to the generic class. The value is not used if the generic class is not persistent.

setElements

void setElements(java.lang.Object o)
Assignes the new value of the generic class (Collection, Map or Array or ...).


createGenClass

java.lang.Object createGenClass()

speedoSetGcId

void speedoSetGcId(int gcid)
Sets the id of this gen class instance (id of the field that references this instance).

Parameters:
gcid - the new id of this gen class instance.

speedoAddGenClassListener

void speedoAddGenClassListener(SpeedoGenClassListener l)
Adds a listener to this gen class instance. This listener will be notified each time an element is added or removed for this gen class.

Parameters:
l - a gen class listener.

fireSpeedoElementAdded

void fireSpeedoElementAdded(java.lang.Object elem)
Notifies the listeners of this gen class that an element has been added to this gen class.

Parameters:
elem - the element that has been added.

fireSpeedoElementRemoved

void fireSpeedoElementRemoved(java.lang.Object elem)
Notifies the listeners of this gen class that an element has been removed to this gen class.

Parameters:
elem - the element that has been removed.

clear

void clear()

init

void init(org.objectweb.jorm.type.api.PType ptype,
          java.lang.String linkedField,
          java.lang.Object pnameHints,
          org.objectweb.util.monolog.api.Logger logger)
Initializes a Genclass instance

Parameters:
ptype - is the PType of the genclass
linkedField - is the name of the field referencing the genclass
pnameHints - is a helper using for the identifier allocation (export) persistent
logger - is the logger instance for logging.

speedoSetPNameHints

void speedoSetPNameHints(java.lang.Object hints)
Assignes the hints needed to build the PName of the persistent object during the export action.