org.objectweb.speedo.mim.api
Interface SpeedoProxy

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
All Known Subinterfaces:
SpeedoGenClassProxy
All Known Implementing Classes:
ArrayListImpl, GenClass, HashMapImpl, HashSetImpl, HashtableImpl, LinkedListImpl, PropertiesImpl, TreeMapImpl, VectorImpl

public interface SpeedoProxy
extends javax.jdo.spi.PersistenceCapable, org.objectweb.jorm.api.PBinding, org.objectweb.perseus.cache.replacement.api.ReplaceableCacheEntry

This interface what is a Proxy in Speedo. A proxy a PersistentCapable instance because it is the user object. It is the jorm PBinding because it is unique. There are several fields:

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 copyAccessor(SpeedoAccessor src, SpeedoAccessor dest)
          Copies persistent fields from an accessor to another.
 SpeedoAccessor createAccessor()
           
 java.lang.Object getEncodedPName()
           
 SpeedoAccessor getReferenceAccessor()
           
 SpeedoAccessor getSpeedoAccessor()
          It retrieves the SpeedoAccessor instance used in the current context.
 SpeedoHome getSpeedoHome()
           
 java.lang.String jdoGetJdoFileName()
           
 java.lang.Object jdoGetPNameHints()
          Retrieves the hints needed to build the PName of the persistent object during the export action.
 boolean jdoIsActive()
          Tests whether the Proxy infrastructure has already been set.
 void jdoIsActive(boolean newvalue)
          Sets the new value of the proxy flags
 void setEncodedPName(java.lang.Object encodedPName)
          Set the encoded PName of the detach copy to allow serialization.
 void setReferenceAccessor(SpeedoAccessor refAcc)
          Assignes the reference accessor to the SpeedoProxy The Reference accessor is used for non persistent instance, as cache value and for pessimistic policy.
 void speedoAdd(java.lang.Object elem, int gcFieldNumber)
          Adds an element in the gen class field whose number is given.
 
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
 

Method Detail

jdoIsActive

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

Returns:
true if this object is a Proxy.

jdoIsActive

public void jdoIsActive(boolean newvalue)
Sets the new value of the proxy flags

Parameters:
newvalue - the new value of the proxy flag
See Also:
jdoIsActive()

getSpeedoHome

public SpeedoHome getSpeedoHome()

getSpeedoAccessor

public SpeedoAccessor getSpeedoAccessor()
It retrieves the SpeedoAccessor instance used in the current context. If the proxy is not active then the reference state is returned. otherwise a $classNameFields is returned


getReferenceAccessor

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

setReferenceAccessor

public void setReferenceAccessor(SpeedoAccessor refAcc)
Assignes the reference accessor to the SpeedoProxy The Reference accessor is used for non persistent instance, as cache value and for pessimistic policy.

Parameters:
refAcc - the new reference accessor

createAccessor

public SpeedoAccessor createAccessor()
Returns:
a new SpeedoAccessor instance.

copyAccessor

public void copyAccessor(SpeedoAccessor src,
                         SpeedoAccessor 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

setEncodedPName

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

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

getEncodedPName

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

jdoGetJdoFileName

public java.lang.String jdoGetJdoFileName()
Returns:
The file name of the jdo descriptor. This file must be availlable in the class at runtime.

jdoGetPNameHints

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


speedoAdd

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