org.objectweb.speedo.mim.api
Interface PersistentObjectItf

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

public interface PersistentObjectItf
extends org.objectweb.jorm.api.PBinding, ReplaceableCacheEntry

This interface what is a Peristent Object in Speedo. It is the jorm PBinding because it is unique. The Persistent object is an entry of the L2 cache. A persistent object is linked to its home which is also the Mapping. A persistent object is linked to several state (StateIf) containing the persistent data.

Author:
S.Chassande-Barrioz
See Also:
HomeItf, StateItf

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 speedoAdd(java.lang.Object elem, int gcFieldNumber)
          Adds an element in the gen class field whose number is given.
 void speedoCopyState(StateItf src, StateItf dest)
          Copies persistent fields from an accessor to another.
 StateItf speedoCreateState()
           
 java.lang.Object speedoGetEncodedPName()
           
 HomeItf speedoGetHome()
           
 java.lang.Object speedoGetPNameHints()
          Retrieves the hints needed to build the PName of the persistent object during the export action.
 POManagerItf speedoGetPOManager()
           
 StateItf speedoGetReferenceState()
           
 StateItf speedoGetState()
          It retrieves the StateItf instance used in the current context.
 boolean speedoIsActive()
          Tests whether the po infrastructure has already been set.
 void speedoIsActive(boolean newvalue)
          Sets the new value of the po flags
 boolean speedoIsPersistent()
           
 void speedoSetEncodedPName(java.lang.Object encodedPName)
          Set the encoded PName of the detach copy to allow serialization.
 void speedoSetReferenceState(StateItf refAcc)
          Assignes the reference accessor to the PersistentObjectItf The Reference accessor is used for non persistent instance, as cache value and for pessimistic policy.
 
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
 

Method Detail

speedoIsActive

boolean speedoIsActive()
Tests whether the po infrastructure has already been set. A po has a correct PClassMapping linked to a PBinder, a PName obtained thanks to this PClassMapping.


speedoIsActive

void speedoIsActive(boolean newvalue)
Sets the new value of the po flags

Parameters:
newvalue - the new value of the po flag
See Also:
speedoIsActive()

speedoIsPersistent

boolean speedoIsPersistent()

speedoGetHome

HomeItf speedoGetHome()

speedoGetState

StateItf speedoGetState()
It retrieves the StateItf instance used in the current context. If the po is not active then the reference state is returned. otherwise a $classNameFields is returned


speedoGetReferenceState

StateItf speedoGetReferenceState()
Returns:
the reference accessor of the PersistentObjectItf instance. It can be * null. The Reference accessor is used for non persistent instance, as cache value and for pessimistic policy.

speedoSetReferenceState

void speedoSetReferenceState(StateItf refAcc)
Assignes the reference accessor to the PersistentObjectItf The Reference accessor is used for non persistent instance, as cache value and for pessimistic policy.

Parameters:
refAcc - the new reference accessor

speedoCreateState

StateItf speedoCreateState()
Returns:
a new StateItf instance.

speedoCopyState

void speedoCopyState(StateItf src,
                     StateItf dest)
Copies persistent fields from an accessor to another.

Parameters:
src - is the accessor containing peristent fields to copy
dest - is the accessor where persistent fields have to be copied

speedoSetEncodedPName

void speedoSetEncodedPName(java.lang.Object encodedPName)
Set the encoded PName of the detach copy to allow serialization.

Parameters:
encodedPName - : the encoded PName of the persistent object

speedoGetEncodedPName

java.lang.Object speedoGetEncodedPName()
Returns:
the encoded PName of the detached copy

speedoGetPNameHints

java.lang.Object speedoGetPNameHints()
Retrieves the hints needed to build the PName of the persistent object during the export action.


speedoAdd

void speedoAdd(java.lang.Object elem,
               int gcFieldNumber)
Adds an element in the gen class field whose number is given. This method must call the speedoAdd method of the SpeedoGenClassCoherence interface, or the Collection.add method (if the field contains a collection that does implement the previous interface). If the field is null, a new (speedo) collection must be created first.


speedoGetPOManager

POManagerItf speedoGetPOManager()