org.objectweb.speedo.api
Interface SpeedoProxy

All Superinterfaces:
SpeedoAccessor
All Known Subinterfaces:
SpeedoGenClassProxy

public interface SpeedoProxy
extends SpeedoAccessor

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 even in optimistic case. Finally it is also a SpeedoAccessor because in pessimistic mode or when the object is not active the state values are stored inside the proxy. In addition there are several fields:

Author:
S.Chassande-Barrioz

Method Summary
 java.lang.Object getJormConfig()
          It retrieves an object helping the configuration of the Jorm class.
 SpeedoAccessor getSpeedoAccessor()
          It retrieves the SpeedoAccessor instance used in the current context.
 java.util.Collection getSpeedoAccessors()
          It retrieves the SpeedoAccessor instance used in the current context.
 void jdoDeletePersistent(ProxyManager pm)
           
 java.lang.Object jdoGePNameHints()
          Retrieves the hints needed to build the PName of the persistent object during the export action.
 java.lang.String jdoGetJdoFileName()
           
 java.lang.String jdoGetMapperName()
           
 javax.jdo.PersistenceManagerFactory jdoGetPersistenceManagerFactory()
           
 ProxyManagerSwitch jdoGetPersistenceManagerSwitch()
           
 java.lang.String jdoGetProjectName()
           
 org.objectweb.perseus.persistence.api.TransactionalPersistenceManager jdoGetTransactionalPersistenceManager()
           
 boolean jdoIsActive()
          Tests whether the Proxy infrastructure has already been set.
 void jdoIsActive(boolean newvalue)
          Sets the new value of the proxy flags
 boolean jdoIsContainerId()
          Indicates the identity-type of this object
 void jdoLoadFieldsFromAccessor(SpeedoAccessor sa)
          Stores fields owned by the accessor into the proxy
 void jdoLoadFieldsInAccessor(SpeedoAccessor sa)
          Stores fields owned by this object into an accessor
 void jdoMakePersistent(ProxyManager pm)
           
 void jdoSetPersistenceManagerFactory(javax.jdo.PersistenceManagerFactory pmf)
          It assignes a PersistenceManagerFactory
 void jdoSetPersistenceManagerSwitch(ProxyManagerSwitch pms)
          It assignes the ProxyManager switch which will permit to find the ProxyManager which manages the proxy in a given context(thread)
 void jdoSetPNameHints(java.lang.Object hints)
          Assignes the hints needed to build the PName of the persistent object during the export action.
 void jdoSetTransactionalPersistenceManager(org.objectweb.perseus.persistence.api.TransactionalPersistenceManager tpm)
          It assignes a TransactionalPersistenceManager
 void removeSpeedoAccessor(SpeedoAccessor sa)
          Removes the given speedo accessor from the list of accessors of this proxy.
 
Methods inherited from interface org.objectweb.speedo.api.SpeedoAccessor
jdoChangeStatus, jdoGetSpeedoProxy, jdoGetStatus, jdoGetTransaction, jdoSetSpeedoProxy, jdoSetStatus, jdoSetTransaction
 

Method Detail

jdoLoadFieldsInAccessor

public void jdoLoadFieldsInAccessor(SpeedoAccessor sa)
Stores fields owned by this object into an accessor
Parameters:
sa - the accessor requiring persistent fields

jdoLoadFieldsFromAccessor

public void jdoLoadFieldsFromAccessor(SpeedoAccessor sa)
Stores fields owned by the accessor into the proxy
Parameters:
sa - the accessor containing persistent fields

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()

getSpeedoAccessor

public SpeedoAccessor getSpeedoAccessor()
It retrieves the SpeedoAccessor instance used in the current context. If the proxy is not active then 'this' is returned. If there is an active and otpimistic transaction then a $classNameFields is returned. Otherwise 'this' is returned.

removeSpeedoAccessor

public void removeSpeedoAccessor(SpeedoAccessor sa)
Removes the given speedo accessor from the list of accessors of this proxy.
Parameters:
sa - a speedo accessor of this proxy.

getSpeedoAccessors

public java.util.Collection getSpeedoAccessors()
It retrieves the SpeedoAccessor instance used in the current context. If the proxy is not active then 'this' is returned. If there is an active and otpimistic transaction then a $classNameFields is returned. Otherwise 'this' is returned.

jdoIsContainerId

public boolean jdoIsContainerId()
Indicates the identity-type of this object
Returns:
true if the object lets the JDO Implementation manages its identity, false otherwise (application identity)

jdoGetPersistenceManagerSwitch

public ProxyManagerSwitch jdoGetPersistenceManagerSwitch()
Returns:
the ProxyManager switch links to the proxy

jdoSetPersistenceManagerSwitch

public void jdoSetPersistenceManagerSwitch(ProxyManagerSwitch pms)
It assignes the ProxyManager switch which will permit to find the ProxyManager which manages the proxy in a given context(thread)
Parameters:
pms -  

jdoGetPersistenceManagerFactory

public javax.jdo.PersistenceManagerFactory jdoGetPersistenceManagerFactory()
Returns:
the PersistenceManagerFactory which represents the data support inside which the proxy is persistent.

jdoSetPersistenceManagerFactory

public void jdoSetPersistenceManagerFactory(javax.jdo.PersistenceManagerFactory pmf)
It assignes a PersistenceManagerFactory
Parameters:
pmf - is the PersistenceManagerFactory which represents the data support inside which the proxy is persistent.

jdoGetTransactionalPersistenceManager

public org.objectweb.perseus.persistence.api.TransactionalPersistenceManager jdoGetTransactionalPersistenceManager()
Returns:
the TransactionalPersistenceManager which manage the concurrency, loading, ... of the proxy.

jdoSetTransactionalPersistenceManager

public void jdoSetTransactionalPersistenceManager(org.objectweb.perseus.persistence.api.TransactionalPersistenceManager tpm)
It assignes a TransactionalPersistenceManager
Parameters:
tpm - is the TransactionalPersistenceManager which manage the concurrency, loading, ... of the proxy.

getJormConfig

public java.lang.Object getJormConfig()
It retrieves an object helping the configuration of the Jorm class. Currently Jorm is not fractalize then the returned object is the PBinder class name.

jdoMakePersistent

public void jdoMakePersistent(ProxyManager pm)

jdoDeletePersistent

public void jdoDeletePersistent(ProxyManager pm)

jdoGetMapperName

public java.lang.String jdoGetMapperName()
Returns:
return the mapper name by which the instance is persistent.

jdoGetProjectName

public java.lang.String jdoGetProjectName()
Returns:
return the mapper name by which the instance is persistent.

jdoGetJdoFileName

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

jdoGePNameHints

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

jdoSetPNameHints

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