org.objectweb.speedo.genclass.api
Interface SpeedoGenClassProxy

All Superinterfaces:
org.objectweb.perseus.cache.api.CacheEntry, org.objectweb.perseus.cache.api.FixableCacheEntry, org.objectweb.jorm.api.PBinding, javax.jdo.spi.PersistenceCapable, org.objectweb.perseus.cache.replacement.api.ReplaceableCacheEntry, SpeedoGenClassCoherence, SpeedoProxy
All Known Implementing Classes:
ArrayListImpl, GenClass, HashMapImpl, HashSetImpl, HashtableImpl, LinkedListImpl, PropertiesImpl, TreeMapImpl, VectorImpl

public interface SpeedoGenClassProxy
extends SpeedoProxy, SpeedoGenClassCoherence

This interfaces represents a SpeedoProxy 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

Nested Class Summary
 
Nested classes inherited from class javax.jdo.spi.PersistenceCapable
javax.jdo.spi.PersistenceCapable.ObjectIdFieldConsumer, javax.jdo.spi.PersistenceCapable.ObjectIdFieldManager, javax.jdo.spi.PersistenceCapable.ObjectIdFieldSupplier
 
Field Summary
 
Fields inherited from interface javax.jdo.spi.PersistenceCapable
CHECK_READ, CHECK_WRITE, DETACHED, LOAD_REQUIRED, MEDIATE_READ, MEDIATE_WRITE, READ_OK, READ_WRITE_OK, SERIALIZABLE
 
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
 java.lang.String jdoGetGenClassId()
           
 org.objectweb.jorm.api.PBinding jdoGetPBinding()
           
 org.objectweb.jorm.type.api.PType jdoGetPType()
           
 void jdoSetLinkedField(java.lang.String lf)
          Assignes the linked field name for this generic class.
 void jdoSetPBinding(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 jdoSetPNameHints(java.lang.Object hints)
          Assignes the hints needed to build the PName of the persistent object during the export action.
 void jdoSetPType(org.objectweb.jorm.type.api.PType ptype)
          Assignes the PType of the generic class.
 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.
 void speedoSetGcId(int gcid)
          Sets the id of this gen class instance (id of the field that references this instance).
 
Methods inherited from interface org.objectweb.speedo.mim.api.SpeedoProxy
copyAccessor, createAccessor, getEncodedPName, getReferenceAccessor, getSpeedoAccessor, getSpeedoHome, jdoGetJdoFileName, jdoGetPNameHints, jdoIsActive, jdoIsActive, setEncodedPName, setReferenceAccessor, speedoAdd
 
Methods inherited from interface javax.jdo.spi.PersistenceCapable
jdoCopyFields, jdoCopyKeyFieldsFromObjectId, jdoCopyKeyFieldsToObjectId, jdoCopyKeyFieldsToObjectId, jdoGetObjectId, jdoGetPersistenceManager, jdoGetTransactionalObjectId, jdoGetVersion, jdoIsDeleted, jdoIsDetached, jdoIsDirty, jdoIsNew, jdoIsPersistent, jdoIsTransactional, jdoMakeDirty, jdoNewInstance, jdoNewInstance, jdoNewObjectIdInstance, jdoNewObjectIdInstance, jdoProvideField, jdoProvideFields, jdoReplaceField, jdoReplaceFields, jdoReplaceFlags, jdoReplaceStateManager
 
Methods inherited from interface org.objectweb.jorm.api.PBinding
bind, exist, export, export, getPClassMapping, getPName, getStatus, init, 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

jdoSetPType

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

Parameters:
ptype - of the generic class

jdoGetPType

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

jdoGetGenClassId

public java.lang.String jdoGetGenClassId()
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'

jdoSetLinkedField

public void jdoSetLinkedField(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'

jdoSetPBinding

public void jdoSetPBinding(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.

jdoGetPBinding

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

setElements

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


createGenClass

public java.lang.Object createGenClass()

speedoSetGcId

public 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

public 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

public 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

public 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

public void clear()

init

public 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.

jdoSetPNameHints

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