|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
org.objectweb.speedo.runtime.genclass.GenClass
This class is a basic implementation of the SpeedoGenClassProxy interface. It uses a delegate PBinding.
Field Summary | |
protected SpeedoAccessor |
accessor
Accessor used in pessimistic and persistent non transactional mode |
protected java.util.Collection |
accessors
It is the list of accessors (optimistic case) |
protected long |
age
This field is a logical clock used by the ReplacementManager |
protected int |
fixCount
This field counts the fix operation done over this ReplaceableCacheEntry |
protected java.lang.Object |
inner
|
protected boolean |
jdoIsActive
This fields indicates if the proxy is active (attached to at least a Proxy Manager) |
protected byte |
jdoStatus
The status of the instance used in pessimistic mode or outside a transaction. |
protected java.lang.String |
linkedField
TODO |
protected org.objectweb.util.monolog.api.Logger |
logger
The logger used to trace this generic class |
protected java.lang.String |
mapperName
is the name of the mapper inside which the generic class is persistent |
protected org.objectweb.jorm.api.PBindingCtrl |
pbinding
is the PBinding which permits to store/load the data into/from the support |
protected javax.jdo.PersistenceManagerFactory |
pmf
This is field is null when the proxy is not active |
protected ProxyManagerSwitch |
pms
This is field is null when the proxy is not active |
protected java.lang.Object |
pnameHints
Is the PName which |
protected java.lang.String |
projectName
is the name of the project name inside which the generic class is used. |
protected org.objectweb.jorm.type.api.PType |
ptype
is the type of the generic class |
protected org.objectweb.perseus.persistence.api.TransactionalPersistenceManager |
tpm
This field is the Transactional persistence manager. |
protected Transaction |
tx
This field is the transaction (Working set associate to the proxy used in pessimistic mode or outside transaction. |
Constructor Summary | |
GenClass()
|
|
GenClass(org.objectweb.jorm.type.api.PType ptype,
java.lang.String linkedField,
java.lang.Object pnameHints,
java.lang.String mapperName)
|
Method Summary | |
void |
bind(org.objectweb.jorm.naming.api.PName name)
|
protected abstract SpeedoAccessor |
createAccessor()
|
boolean |
elementIsReference()
|
boolean |
exist(java.lang.Object o)
|
org.objectweb.jorm.naming.api.PName |
export(java.lang.Object o)
|
org.objectweb.jorm.naming.api.PName |
export(java.lang.Object o,
java.lang.Object o1)
|
void |
fixCe()
|
long |
getCeAge()
|
int |
getCeFixCount()
|
java.lang.Object |
getCeIdentifier()
|
java.lang.Object |
getCeObject()
|
abstract java.util.Collection |
getGenClassElements(SpeedoAccessor sa)
|
java.lang.Object |
getJormConfig()
It retrieves an object helping the configuration of the Jorm class. |
org.objectweb.util.monolog.api.Logger |
getLogger()
|
org.objectweb.util.monolog.api.LoggerFactory |
getLoggerFactory()
|
java.lang.Object |
getMemoryInstance()
|
org.objectweb.jorm.api.PClassMapping |
getPClassMapping()
|
org.objectweb.jorm.naming.api.PName |
getPName()
|
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. |
byte |
getStatus()
|
void |
init(org.objectweb.jorm.api.PClassMapping mapping)
|
void |
jdoChangeStatus(byte action)
Changes the status of this object |
void |
jdoCopyFields(java.lang.Object pc,
int[] fieldNumbers)
|
void |
jdoCopyKeyFieldsFromObjectId(javax.jdo.spi.PersistenceCapable.ObjectIdFieldConsumer objectIdFieldConsumer,
java.lang.Object o)
|
void |
jdoCopyKeyFieldsToObjectId(java.lang.Object o)
|
void |
jdoCopyKeyFieldsToObjectId(javax.jdo.spi.PersistenceCapable.ObjectIdFieldSupplier objectIdFieldSupplier,
java.lang.Object o)
|
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 |
jdoGetGenClassId()
|
java.lang.String |
jdoGetJdoFileName()
|
java.lang.String |
jdoGetMapperName()
|
java.lang.Object |
jdoGetObjectId()
|
javax.jdo.PersistenceManager |
jdoGetPersistenceManager()
|
javax.jdo.PersistenceManagerFactory |
jdoGetPersistenceManagerFactory()
|
ProxyManagerSwitch |
jdoGetPersistenceManagerSwitch()
|
java.lang.String |
jdoGetProjectName()
|
org.objectweb.jorm.type.api.PType |
jdoGetPType()
|
SpeedoProxy |
jdoGetSpeedoProxy()
|
byte |
jdoGetStatus()
Gets the current status of this object |
Transaction |
jdoGetTransaction()
|
java.lang.Object |
jdoGetTransactionalObjectId()
|
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()
The identifier of a generic class is based on the identifier of the class which references this generic class. |
boolean |
jdoIsDeleted()
|
boolean |
jdoIsDirty()
|
boolean |
jdoIsNew()
|
boolean |
jdoIsPersistent()
|
boolean |
jdoIsTransactional()
|
abstract void |
jdoLoadFieldsFromAccessor(SpeedoAccessor sa)
Stores fields owned by the accessor into the proxy |
abstract void |
jdoLoadFieldsInAccessor(SpeedoAccessor sa)
Stores fields owned by this object into an accessor |
void |
jdoMakeDirty(java.lang.String fieldName)
|
void |
jdoMakePersistent(ProxyManager pm,
SpeedoProxy sp)
|
javax.jdo.spi.PersistenceCapable |
jdoNewInstance(javax.jdo.spi.StateManager sm)
|
javax.jdo.spi.PersistenceCapable |
jdoNewInstance(javax.jdo.spi.StateManager sm,
java.lang.Object oid)
|
java.lang.Object |
jdoNewObjectIdInstance()
|
java.lang.Object |
jdoNewObjectIdInstance(java.lang.String s)
|
void |
jdoProvideField(int fieldNumber)
|
void |
jdoProvideFields(int[] fieldNumbers)
|
void |
jdoReadIntention(SpeedoAccessor sa)
|
void |
jdoReplaceField(int fieldNumber)
|
void |
jdoReplaceFields(int[] fieldNumbers)
|
void |
jdoReplaceFlags()
|
void |
jdoReplaceStateManager(javax.jdo.spi.StateManager sm)
|
void |
jdoSetLinkedField(java.lang.String lf)
Assignes the linked field name for this generic class. |
void |
jdoSetMapperName(java.lang.String mn)
|
org.objectweb.jorm.api.PBinding |
jdoSetPBinding()
|
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 |
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 |
jdoSetPType(org.objectweb.jorm.type.api.PType ptype)
Assignes the PType of the generic class. |
void |
jdoSetSpeedoProxy(SpeedoProxy sp)
Assignes the SpeedoProxy attached to this state representation. |
void |
jdoSetStatus(byte newValue)
Forces the new value of the status |
void |
jdoSetTransaction(Transaction tx)
Assignes the context with which the accessor is bound. |
void |
jdoSetTransactionalPersistenceManager(org.objectweb.perseus.persistence.api.TransactionalPersistenceManager tpm)
It assignes a TransactionalPersistenceManager |
void |
jdoWriteIntention(SpeedoAccessor sa)
|
void |
read(java.lang.Object o,
org.objectweb.jorm.api.PAccessor accessor)
|
void |
read(java.lang.Object o,
org.objectweb.jorm.api.PAccessor pAccessor,
java.lang.Object o1)
|
void |
removeSpeedoAccessor(SpeedoAccessor sa)
Removes the given speedo accessor from the list of accessors of this proxy. |
void |
setCeAge(long l)
|
abstract void |
setGCValue(java.lang.Object o)
|
void |
setInner(java.lang.Object o)
Assignes the new value of the generic class (Collection, Map or Array or ...). |
void |
setLogger(org.objectweb.util.monolog.api.Logger _logger)
|
void |
setLoggerFactory(org.objectweb.util.monolog.api.LoggerFactory loggerfactory)
|
void |
setPName(org.objectweb.jorm.naming.api.PName pName)
|
void |
setStatus(byte b)
|
void |
unbind()
|
void |
unexport(java.lang.Object o)
|
void |
unfixCe()
|
void |
write(java.lang.Object o,
org.objectweb.jorm.api.PAccessor accessor)
|
Methods inherited from interface org.objectweb.speedo.api.SpeedoProxy |
jdoMakePersistent |
Field Detail |
protected boolean jdoIsActive
protected byte jdoStatus
protected javax.jdo.PersistenceManagerFactory pmf
protected ProxyManagerSwitch pms
protected org.objectweb.perseus.persistence.api.TransactionalPersistenceManager tpm
protected java.util.Collection accessors
protected Transaction tx
protected int fixCount
protected long age
protected org.objectweb.jorm.api.PBindingCtrl pbinding
protected SpeedoAccessor accessor
protected org.objectweb.util.monolog.api.Logger logger
protected java.lang.String mapperName
protected java.lang.String projectName
protected org.objectweb.jorm.type.api.PType ptype
protected java.lang.String linkedField
protected java.lang.Object pnameHints
protected java.lang.Object inner
Constructor Detail |
public GenClass()
public GenClass(org.objectweb.jorm.type.api.PType ptype, java.lang.String linkedField, java.lang.Object pnameHints, java.lang.String mapperName)
Method Detail |
public boolean elementIsReference()
public void jdoMakePersistent(ProxyManager pm, SpeedoProxy sp)
protected abstract SpeedoAccessor createAccessor()
public abstract void jdoLoadFieldsInAccessor(SpeedoAccessor sa)
SpeedoProxy
jdoLoadFieldsInAccessor
in interface SpeedoProxy
org.objectweb.speedo.api.SpeedoProxy
sa
- the accessor requiring persistent fieldspublic abstract void jdoLoadFieldsFromAccessor(SpeedoAccessor sa)
SpeedoProxy
jdoLoadFieldsFromAccessor
in interface SpeedoProxy
org.objectweb.speedo.api.SpeedoProxy
sa
- the accessor containing persistent fieldspublic abstract java.util.Collection getGenClassElements(SpeedoAccessor sa)
public abstract void setGCValue(java.lang.Object o)
public void bind(org.objectweb.jorm.naming.api.PName name) throws org.objectweb.jorm.api.PException
public boolean exist(java.lang.Object o) throws org.objectweb.jorm.api.PException
public org.objectweb.jorm.naming.api.PName export(java.lang.Object o) throws org.objectweb.jorm.api.PException
public org.objectweb.jorm.naming.api.PName export(java.lang.Object o, java.lang.Object o1) throws org.objectweb.jorm.api.PException
public org.objectweb.jorm.api.PClassMapping getPClassMapping()
public org.objectweb.jorm.naming.api.PName getPName()
public byte getStatus()
public void setPName(org.objectweb.jorm.naming.api.PName pName)
public void setStatus(byte b)
public void init(org.objectweb.jorm.api.PClassMapping mapping) throws org.objectweb.jorm.api.PException
public void read(java.lang.Object o, org.objectweb.jorm.api.PAccessor accessor) throws org.objectweb.jorm.api.PException
public void read(java.lang.Object o, org.objectweb.jorm.api.PAccessor pAccessor, java.lang.Object o1) throws org.objectweb.jorm.api.PException
public void unbind() throws org.objectweb.jorm.api.PException
public void unexport(java.lang.Object o) throws org.objectweb.jorm.api.PException
public void write(java.lang.Object o, org.objectweb.jorm.api.PAccessor accessor) throws org.objectweb.jorm.api.PException
public javax.jdo.PersistenceManager jdoGetPersistenceManager()
public void jdoReplaceFlags()
public javax.jdo.spi.PersistenceCapable jdoNewInstance(javax.jdo.spi.StateManager sm)
public javax.jdo.spi.PersistenceCapable jdoNewInstance(javax.jdo.spi.StateManager sm, java.lang.Object oid)
public java.lang.Object jdoNewObjectIdInstance()
public java.lang.Object jdoGetObjectId()
public java.lang.Object jdoGetTransactionalObjectId()
public void jdoReplaceField(int fieldNumber)
public void jdoReplaceFields(int[] fieldNumbers)
public void jdoProvideField(int fieldNumber)
public void jdoProvideFields(int[] fieldNumbers)
public void jdoCopyFields(java.lang.Object pc, int[] fieldNumbers)
public void jdoMakeDirty(java.lang.String fieldName)
public boolean jdoIsDirty()
public boolean jdoIsTransactional()
public boolean jdoIsPersistent()
public boolean jdoIsNew()
public boolean jdoIsDeleted()
public void jdoReplaceStateManager(javax.jdo.spi.StateManager sm)
public java.lang.Object jdoNewObjectIdInstance(java.lang.String s)
public void jdoCopyKeyFieldsToObjectId(java.lang.Object o)
public void jdoCopyKeyFieldsToObjectId(javax.jdo.spi.PersistenceCapable.ObjectIdFieldSupplier objectIdFieldSupplier, java.lang.Object o)
public void jdoCopyKeyFieldsFromObjectId(javax.jdo.spi.PersistenceCapable.ObjectIdFieldConsumer objectIdFieldConsumer, java.lang.Object o)
public void jdoSetMapperName(java.lang.String mn)
jdoSetMapperName
in interface SpeedoGenClassProxy
mn
- is the mapper name by which the instance is persistent.public void jdoSetPType(org.objectweb.jorm.type.api.PType ptype)
jdoSetPType
in interface SpeedoGenClassProxy
ptype
- of the generic classpublic org.objectweb.jorm.type.api.PType jdoGetPType()
jdoGetPType
in interface SpeedoGenClassProxy
public void jdoSetPBinding(org.objectweb.jorm.api.PBinding pb)
jdoSetPBinding
in interface SpeedoGenClassProxy
pb
- is the PBinding.public org.objectweb.jorm.api.PBinding jdoSetPBinding()
jdoSetPBinding
in interface SpeedoGenClassProxy
public java.lang.String jdoGetGenClassId()
jdoGetGenClassId
in interface SpeedoGenClassProxy
public void jdoSetLinkedField(java.lang.String lf)
jdoSetLinkedField
in interface SpeedoGenClassProxy
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'public void setInner(java.lang.Object o)
setInner
in interface SpeedoGenClassProxy
public java.lang.Object jdoGePNameHints()
SpeedoProxy
jdoGePNameHints
in interface SpeedoProxy
public void jdoSetPNameHints(java.lang.Object hints)
SpeedoProxy
jdoSetPNameHints
in interface SpeedoProxy
public java.lang.String jdoGetMapperName()
jdoGetMapperName
in interface SpeedoProxy
org.objectweb.speedo.api.SpeedoProxy
public java.lang.String jdoGetProjectName()
jdoGetProjectName
in interface SpeedoProxy
org.objectweb.speedo.api.SpeedoProxy
public boolean jdoIsActive()
SpeedoProxy
jdoIsActive
in interface SpeedoProxy
org.objectweb.speedo.api.SpeedoProxy
public void jdoIsActive(boolean newvalue)
SpeedoProxy
jdoIsActive
in interface SpeedoProxy
org.objectweb.speedo.api.SpeedoProxy
newvalue
- the new value of the proxy flagSpeedoProxy.jdoIsActive()
public SpeedoAccessor getSpeedoAccessor()
SpeedoProxy
getSpeedoAccessor
in interface SpeedoProxy
public java.util.Collection getSpeedoAccessors()
SpeedoProxy
getSpeedoAccessors
in interface SpeedoProxy
public void removeSpeedoAccessor(SpeedoAccessor sa)
SpeedoProxy
removeSpeedoAccessor
in interface SpeedoProxy
org.objectweb.speedo.api.SpeedoProxy
sa
- a speedo accessor of this proxy.public boolean jdoIsContainerId()
jdoIsContainerId
in interface SpeedoProxy
public ProxyManagerSwitch jdoGetPersistenceManagerSwitch()
jdoGetPersistenceManagerSwitch
in interface SpeedoProxy
org.objectweb.speedo.api.SpeedoProxy
public void jdoSetPersistenceManagerSwitch(ProxyManagerSwitch pms)
SpeedoProxy
jdoSetPersistenceManagerSwitch
in interface SpeedoProxy
org.objectweb.speedo.api.SpeedoProxy
pms
- public javax.jdo.PersistenceManagerFactory jdoGetPersistenceManagerFactory()
jdoGetPersistenceManagerFactory
in interface SpeedoProxy
org.objectweb.speedo.api.SpeedoProxy
public void jdoSetPersistenceManagerFactory(javax.jdo.PersistenceManagerFactory pmf)
SpeedoProxy
jdoSetPersistenceManagerFactory
in interface SpeedoProxy
org.objectweb.speedo.api.SpeedoProxy
pmf
- is the PersistenceManagerFactory which represents the data
support inside which the proxy is persistent.public org.objectweb.perseus.persistence.api.TransactionalPersistenceManager jdoGetTransactionalPersistenceManager()
jdoGetTransactionalPersistenceManager
in interface SpeedoProxy
org.objectweb.speedo.api.SpeedoProxy
public void jdoSetTransactionalPersistenceManager(org.objectweb.perseus.persistence.api.TransactionalPersistenceManager tpm)
SpeedoProxy
jdoSetTransactionalPersistenceManager
in interface SpeedoProxy
org.objectweb.speedo.api.SpeedoProxy
tpm
- is the TransactionalPersistenceManager which manage the
concurrency, loading, ... of the proxy.public void jdoReadIntention(SpeedoAccessor sa)
public void jdoWriteIntention(SpeedoAccessor sa)
public java.lang.Object getJormConfig()
SpeedoProxy
getJormConfig
in interface SpeedoProxy
public java.lang.String jdoGetJdoFileName()
jdoGetJdoFileName
in interface SpeedoProxy
org.objectweb.speedo.api.SpeedoProxy
public void jdoDeletePersistent(ProxyManager pm)
jdoDeletePersistent
in interface SpeedoProxy
public java.lang.Object getMemoryInstance()
public void jdoChangeStatus(byte action)
SpeedoAccessor
jdoChangeStatus
in interface SpeedoAccessor
org.objectweb.speedo.api.SpeedoAccessor
action
- the action that may change the statusLifeCycle
public byte jdoGetStatus()
SpeedoAccessor
jdoGetStatus
in interface SpeedoAccessor
org.objectweb.speedo.api.SpeedoAccessor
LifeCycle
public void jdoSetStatus(byte newValue)
SpeedoAccessor
jdoSetStatus
in interface SpeedoAccessor
org.objectweb.speedo.api.SpeedoAccessor
newValue
- the new status of this objectLifeCycle
public SpeedoProxy jdoGetSpeedoProxy()
jdoGetSpeedoProxy
in interface SpeedoAccessor
org.objectweb.speedo.api.SpeedoAccessor
public void jdoSetSpeedoProxy(SpeedoProxy sp)
SpeedoAccessor
jdoSetSpeedoProxy
in interface SpeedoAccessor
public Transaction jdoGetTransaction()
jdoGetTransaction
in interface SpeedoAccessor
org.objectweb.speedo.api.SpeedoAccessor
public void jdoSetTransaction(Transaction tx)
SpeedoAccessor
jdoSetTransaction
in interface SpeedoAccessor
org.objectweb.speedo.api.SpeedoAccessor
tx
- is the contextpublic java.lang.Object getCeObject()
public java.lang.Object getCeIdentifier()
public void fixCe()
public void unfixCe() throws org.objectweb.perseus.cache.api.UnFixProtocolException
public int getCeFixCount()
public long getCeAge()
public void setCeAge(long l)
public void setLogger(org.objectweb.util.monolog.api.Logger _logger)
public void setLoggerFactory(org.objectweb.util.monolog.api.LoggerFactory loggerfactory)
public org.objectweb.util.monolog.api.Logger getLogger()
public org.objectweb.util.monolog.api.LoggerFactory getLoggerFactory()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |